Picking up invisible fence cable with Arduino

ijourneaux:
Ok. I am finally getting back to this. It has been more difficult than I thought to get the hall sensor into a position (in the stem) where I could actually make some measurements in the field. You had mentioned logging data when not hooked up to the PC. How would that be accomplished?

Well ... I had hoped to have that for you. I went off and got the diff amp, selectable gains semi-working. By semi I mean I was able to get the diff amp working and saw gains = 1x and somethingX. But it seemed the 10x and 40x were both the same and something like 20x. I've still not resolved that and while looking a bit more, discovered that the diff amp can't be used on your SFE ProMicro. My Arduino Micro brings out the A4 and A5 ADC pins from the 32U4 to the connector. The SFE PM does not. The 10x and 40x gains only work when the other diff input is one of those pins. Stupid of me not to check that right up front ! :doh:

So I had a bit of a set back. Getting the logging code to work shouldn’t be an issue. I’ve done similar in the past. Basically to save EEPROM and make things simple, I was going to use only the 8 lsbs, as storing a byte is easy. That means a detection magnitude < 256 counts, which won’t be a problem now. So a fast sampling loop will run and save 600 samples continuously. When 3 or so consecutive samples above some threshold are seen, then the loop takes only the next 300 samples and then stores the whole 600 into EEPROM. They stay there until the next reset and pulse detection. They are spit out over the serial link to the monitor, to be recorded afterby you at the PC, upon every reset. I have coded up much of this already. I have to remove the non-functional diff amp parts and test it. I wasn’t sure if you had dropped this project or … so I have kinda slacked off there. :oops:

I’ll see what I can do (though not test) tonight and if it appears even close, I’ll post it tomorrow for you to peruse or even try out. Ideally after a few real tosses, the data can be looked at and the code can be further optimized to store less data per toss and more tosses. Less of a PITA to use that way I’d think.

ijourneaux:
Thinking a head alittle, The Allegro SOT hall sensor you proposed is probably the correct foot print for my application but I am going to need to be able to reliably connect up the three wires. For the USCA, I am proposing to create a retrofit kit that would reuse the existing handle and replace the post with the hall sensor and the ciruit board. I would need to design a new board that would fit in the space that would support the LEDs going through the handle and the micro processor (choice tbd). I am struggling to figure out a reliable way to get the hall sensor wired up and installed in the stem so that it is reliable.

I figured the mechanical parts of this would be the most trying. Alas there's not much I can do there w/o a kit to look at. And even then ... The one thing I will say is that a steel or iron end screw, that holds the bottom to the stem, is likely to help "focus" the magnetic field to the sensor just above it. Don't replace it with brass or some other non-ferrous metal. I did find a finite element magnetic modeling program (for some other use I'm fooling with), so if you ever get some particulars of the magnetic strip used, let me know. I should be able to come up with a prediction to compare to any measurements done above.

Thanks for the continued interest.

I am on the road for a couple of weeks again. so won’t have an opportunity to work on this until I get back. I will post some pictures of the union between the stock handle and the post with the hall sensor.

If this is successful, what is the recommended way to get the microprocessor, capacitance sensor onto a circuit board that can be integrated into an existing handle. Is the only way to get a custom circuit board or is there a way to build on demand?

Ian

OK here’s my 1’st cut (untested) at the “EEPROM code”. It looks OK to my eye and compiles but I’ve yet to test it. ATM my Micro is in the basement performing airsoft timing duties. I’ll see if I have a chance to test later today perhaps (crappy weather now). Since you can program, you can look at the code and find/fix errors as well ! If I find any, or make improvements, I’ll post another version in another post.

The code below is supposed to do the following …

It has 2 basic modes, verbose and … well, not verbose, let’s call it EEPROM mode. In verbose mode it should operate much like the prior testbed code, except there’s no cap sensor code and it’s LED has been re-purposed.

Upon boot the code waits a few secs for you to get the serial monitor up and recording and then it dumps the EEPROM (presumably containing the prior runs data) to the serial monitor. Presently that’s 600 bytes of data but that number is changable via a define statement. Then the code performs and reports an offset measurement on the Hall sensor input (as the prior code did). Then the code proceeds into an infinite loop, measuring and reporting data at about 1 sec intervals. This slow looping will be accompanied by the green LED blinking on/off every other second. No data is stored to EEPROM. The red LED will go on and off with the detected signal being above or below a threshold. The threshold is presently set to 5 given your prior data, that may be something that needs “tuning” with any change to the magnetic properties of the testbed or test magnet. It’s a constant you can set at the top of the code.

If you compile the code with the verBose flag/boolean set to true, then the bootup process is the same as the above but the looping changes. As before the code enters an “infinite” loop but now the data is not reported but rather stored, over and over, in a array. The green LED goes on and stays on while sampling, giving you an indication of verbose mode or not. If a pulse above the threshold is detected then the red LED will go on and the loop will run for just another (max # samples/2), presently 300, and stop. The green LED will go out for a short time while writing the data to EEPROM. The LSB of magnitude data will be written to EEPROM and then the mode will be reset to verbose and finally the sampling loop restarted, but now in verbose mode (so EEPROM is preserved). LEDs will function as they do in verbose mode. The data in EEPROM will be dumped (but not lost) on the next reset. EEPROM remains preserved until the next pulse is detected in EEPROM mode, so you have multiple chances to retrieve it, if it’s missed on the reset. Just keep any magnets away from the testbed ! :mrgreen:

One thing that definitely needs tuning is the loop time in EEPROM mode. I was aiming for an interval of ~500 usec but I’ve yet to test, or benchmark, the code. So a placeholder value is presently in the constant. And since the timing isn’t all that important, I’ve not bothered to setup an interrupt to keep it constant. It’s timing will depend on the code execution time and so will vary with the code path. No biggie IMO.

//Curling testbed code v2.0

//put includes here
#include <EEPROM.h>

//define constants used
const int capPin = 2;      //pin for cap sensor input
const int hallPin = A0;    //pin for Hall sensor input
const int grnLEDpin = 5;   //pin for green LED output
const int redLEDpin = 6;   //pin for red LED output

const int magThrsh = 5;    //magnitude of Hall reading needed to trip detection

const unsigned long looptimeM = 980;    //loop time for verbose mode, msecs
const unsigned long looptimeU = 100;    //loop time for EEPROM mode, usecs


//define variables used
bool verBose = false;       //flag for verbose mode or EEPROM mode

bool detect = false;        //flag indication pulse detected
int magOffset = 0;          //offset from Hall sensor
int magReading = 0;         //magnitude of raw Hall reading with offset removed
int cntr = 0;               //count of readings > threshold
int iCtr = 0;               //magnitude array index counter

#define iMax 600            //max number of samples to be stored

int iStop = iMax;           //stop point for index
byte mag[iMax];             //array to store LSB (byte) of magnitudes
float magSum = 0.0;         //sum used in computing offset


void setup() {
  Serial.begin(9600);
  pinMode(capPin, INPUT_PULLUP);
  pinMode(redLEDpin, OUTPUT);
  pinMode(grnLEDpin, OUTPUT);
  digitalWrite(redLEDpin, LOW);
  digitalWrite(grnLEDpin, LOW);
  delay(6000);
  //tell user that EEPROM dump is going to happen
  Serial.println("Prepare to store EEPROM data ,");
  delay(3000);
  //dump EEPROM
  for (int i = 0; i < iMax; i++) {
    //dump samples in proper order
    EEPROM.read(i);
  }
  //send a message re calibration
  Serial.println("Prepare to perform offset calibration ,");
  delay(3000);              //wait 3 secs
  Serial.println("Performing offset calibration ,");
  delay(1000);              //wait 1 sec
  //take 20 A/D readings spaced 1 msec apart
  for (int i = 0; i < 20; i++) {
    magSum += float(analogRead(hallPin));
    delay(1);
  }
  //now compute average
  magOffset = int(magSum / 20.0);
  Serial.println("Done ,");
  Serial.print("Offset is ,");
  Serial.println(magOffset);
  Serial.println("Proceeding to measurements ,");
  digitalWrite(grnLEDpin, HIGH);
}

void loop() {
  //loop forever sampling Hall sensor until pulse is detected
  //then store samples to EEPROM, if not verbose mode
  //then loop in verbose mode, sending data, until reset
  while (iCtr < iStop) {
    //loop while taking Hall sensor readings
    magReading = analogRead(hallPin);
    mag[iCtr] = byte(abs(magReading - magOffset));
    if (verBose) {
      //send descriptions and data to serial monitor
      Serial.print("raw Hall reading is ,");
      Serial.print(magReading);
      Serial.print(",");
      Serial.print(" Feild strength is ,");
      Serial.println(mag[iCtr]);
    }
    //Try to detect pulse leading edge
    if (magReading > magThrsh) {
      cntr ++;
    }
    else {
      cntr --;
      cntr = max(cntr, 0);
    }
    if (cntr > 3) {
      // pulse detected
      digitalWrite(redLEDpin, HIGH);
      if (!verBose && !detect) {
        detect = true;
        //set stop point ~half number of samples into the future
        iStop = iCtr + (iMax / 2);
        if (iStop >= iMax) {
          iStop -= iMax;
        }
      }
    }
    //increment counter for magnitude array, limit 0 to iMax-1
    iCtr++;
    if (iCtr >= iMax) {
      iCtr = 0;
    }
    if (verBose) {
      //set delay to get approx correct sampling interval
      delay(looptimeM);
      //in verbose mode blink LED
      if (iCtr % 2) {
        digitalWrite(grnLEDpin, LOW);
      }
      else {
        digitalWrite(grnLEDpin, HIGH);
      }
      //in verbose mode turn off red LED if no signal
      if (cntr == 0) {
        digitalWrite(redLEDpin, LOW);
      }
    }
    else {
      //not verbose mode, use short delay
      delayMicroseconds(looptimeU);
    }
  }

  //peak detected, sampling done, turn on off green LED
  digitalWrite(grnLEDpin, LOW);
  //store data away into EEPROM
  for (int i = 0; i < iMax; i++) {
    //store samples in proper order in EEPROM
    //iCtr was incremented and so left pointing to oldest sample
    int ii = i + iCtr;
    if (ii >= iMax) {
      ii = 0;
    }
    EEPROM.write(i, mag[ii]);
  }
  
  //set mode to verBose and restart sampling
  verBose = true;
  iStop = iMax;
  iCtr = 0;
  cntr = 0;

}

I was able to get the hall sensor out of the post assembly today. It was siliconed in place so it was difficult to remove. there was significant damage

Here is what I can tell.

  1. The three wires come in and are attached at one end of the circuit board (about 25mm x 7mm)

  2. From there there is a capacitor between two of the leads.

  3. The three leads coming on one side of an 8 pin surface mount chip (chip is missing)

  4. There is another capacitor mounted after the chip.

  5. From there is a second 8pin surface mounted chip (Chip intact but no markings).

The 2 surface mounted chips are oriented perpendicular to the ice. I was expected the chip would idealy be mounted horizontal to the ice.

Ian

ijourneaux:
The 2 surface mounted chips are oriented perpendicular to the ice. I was expected the chip would idealy be mounted horizontal to the ice.

Perhaps you could post a pic (or 2) ? I'm not quite "seeing" it.

I’ve been fooling with a magnetics program (for other purposes). It allows me to model the flux from various magnets and coils and I’ve been surprised by how well certain steels will “conduct” magnetic fields. Long story short, mounting the Hall sensor down near the ice, inside of a hollow metal tube now seems unnecessary to me. Instead I can see using a (proper) bolt to bring the magnetic field up to the PCB and putting the sensor there. Not only would this be easier to assemble but it may allow the use of other sensing IC’s, that wouldn’t fit in the tube. IIRC you gave some sizing details of the end screw and rod, etc. If so I’ll find them and see what the finite element analysis tells me. Feel free to re-post the details.

I had a chance to test and benchmark the code above. I found a couple of silly stupid errors and also modified the timing constants. The N&I code is posted below. So far as I can tell, it works as desired. One thing I can’t do is simulate a fast pulse

//Curling testbed code v2.1

//put includes here
#include <EEPROM.h>

//define constants used
const int capPin = 2;      //pin for cap sensor input
const int hallPin = A0;    //pin for Hall sensor input
const int grnLEDpin = 5;   //pin for green LED output
const int redLEDpin = 6;   //pin for red LED output

const int magThrsh = 5;    //magnitude of Hall reading needed to trip detection

const unsigned long looptimeM = 960;    //loop time for verbose mode, msecs
const unsigned long looptimeU = 376;    //loop time for EEPROM mode, usecs


//define variables used
bool verBose = false;       //flag for verbose mode or EEPROM mode

bool detect = false;        //flag indication pulse detected
int magOffset = 0;          //offset from Hall sensor
int magReading = 0;         //magnitude of raw Hall reading with offset removed
int cntr = 0;               //count of readings > threshold
int iCtr = 0;               //magnitude array index counter

#define iMax 600            //max number of samples to be stored

int iStop = iMax;           //stop point for index
byte mag[iMax];             //array to store LSB (byte) of magnitudes
float magSum = 0.0;         //sum used in computing offset

void setup() {
  Serial.begin(9600);
  pinMode(capPin, INPUT_PULLUP);
  pinMode(redLEDpin, OUTPUT);
  pinMode(grnLEDpin, OUTPUT);
  digitalWrite(redLEDpin, LOW);
  digitalWrite(grnLEDpin, LOW);
  delay(6000);
  if(verBose){
    Serial.println("Mode is verbose,");
  }
  //tell user that EEPROM dump is going to happen
  Serial.println("Prepare to store EEPROM data ,");
  delay(3000);
  //dump EEPROM
  for (int i = 0; i < iMax; i++) {
    //dump samples in proper order
    Serial.println(EEPROM.read(i));
  }
  //send a message re calibration
  Serial.println("Prepare to perform offset calibration ,");
  delay(3000);              //wait 3 secs
  Serial.println("Performing offset calibration ,");
  delay(1000);              //wait 1 sec
  //take 20 A/D readings spaced 1 msec apart
  for (int i = 0; i < 20; i++) {
    magSum += float(analogRead(hallPin));
    delay(1);
  }
  //now compute average
  magOffset = int(magSum / 20.0);
  Serial.println("Done ,");
  Serial.print("Offset is ,");
  Serial.println(magOffset);
  Serial.println("Proceeding to measurements ,");
  digitalWrite(grnLEDpin, HIGH);
}

void loop() {
  //loop forever sampling Hall sensor until pulse is detected
  //then store samples to EEPROM, if not verbose mode
  //then loop in verbose mode, sending data, until reset
  while (iCtr < iStop) {
    //loop while taking Hall sensor readings
    magReading = analogRead(hallPin);
    mag[iCtr] = byte(abs(magReading - magOffset));
    if (verBose) {
      //send descriptions and data to serial monitor
      Serial.print("raw Hall reading is ,");
      Serial.print(magReading);
      Serial.print(",");
      Serial.print(" Feild strength is ,");
      Serial.println(mag[iCtr]);
    }
    //Try to detect pulse leading edge
    if (mag[iCtr] > magThrsh) {
      cntr ++;
      cntr = min(cntr, 5);
    }
    else {
      cntr --;
      cntr = max(cntr, 0);
    }
    if (cntr > 3) {
      // pulse detected
      digitalWrite(redLEDpin, HIGH);
      if (!verBose && !detect) {
        detect = true;
        //set stop point ~half number of samples into the future
        iStop = iCtr + (iMax / 2);
        if (iStop >= iMax) {
          iStop -= iMax;
        }
      }
    }
    //increment counter for magnitude array, limit 0 to iMax-1
    iCtr++;
    if (iCtr >= iMax) {
      iCtr = 0;
    }
    if (verBose) {
      //set delay to get approx correct sampling interval
      delay(looptimeM);
      //in verbose mode blink LED
      if (iCtr % 2) {
        digitalWrite(grnLEDpin, LOW);
      }
      else {
        digitalWrite(grnLEDpin, HIGH);
      }
      //in verbose mode turn off red LED if no signal
      if (cntr == 0) {
        digitalWrite(redLEDpin, LOW);
      }
    }
    else {
      //not verbose mode, use short delay
      delayMicroseconds(looptimeU);
    }
  }

  //peak detected, sampling done, turn on off green LED
  digitalWrite(grnLEDpin, LOW);
  //store data away into EEPROM
  for (int i = 0; i < iMax; i++) {
    //store samples in proper order in EEPROM
    //iCtr was incremented and so left pointing to oldest sample
    int ii = i + iCtr;
    if (ii >= iMax) {
      ii = 0;
    }
    EEPROM.write(i, mag[ii]);
  }
  
  //set mode to verBose and restart sampling
  verBose = true;
  iStop = iMax;
  iCtr = 0;
  cntr = 0;

}

ijourneaux:
I was able to get the hall sensor out of the post assembly today. It was siliconed in place so it was difficult to remove. there was significant damage

Here is what I can tell.

  1. The three wires come in and are attached at one end of the circuit board (about 25mm x 7mm)

  2. From there there is a capacitor between two of the leads.

  3. The three leads coming on one side of an 8 pin surface mount chip (chip is missing)

  4. There is another capacitor mounted after the chip.

  5. From there is a second 8pin surface mounted chip (Chip intact but no markings).

The 2 surface mounted chips are oriented perpendicular to the ice. I was expected the chip would idealy be mounted horizontal to the ice.

Ian

Was this on the PCB that you previously posted a picture of ? Still unable to ID the sensor itself ? No matter, I think you're past that.

https://forum.sparkfun.com/download/fil … &mode=view

https://forum.sparkfun.com/download/fil … &mode=view

No this is a small pcb about 7mmx25mm that slips into the stem. This PCB include the hall sensor. If you look at the picture, you can see the group of wires (3 wires) heading from the main circuit board to the stem. The stem is made up of three parts

  1. the first part of the stem is stock on a curlex type handle

  2. The second part is a male to male coupling. The small circuit board is attached to the tip of this coupling.

  3. The third part is a female to female coupling. The mal/male unit with the small circuit board with the hall sensor attached is screwed into the female/female coupling. When it is inserted, plenty of silcone adhesive is used. to protect the sensor.

This would probably be the way to mount the Allegro 1304 hall sensor so that it can be installed in the stem.

To mount the Allegro hall sensor I need a small SOT-23 adaptor similar to the attached picture. In this case the width (7.62mm) is set by the standard hole spacing but it would be better if the board was thinner. The holes don’t need to be at a standard spacing.

Would you have any thoughts? do I need a custom piece? The second picture is thinner like I need but would have preferred if the three holes were staggered on on end.

Notice that this orientation would have the top of the Allegro chip being perpendicular to the ice.

ijourneaux:
Notice that this orientation would have the top of the Allegro chip being perpendicular to the ice.

Now I understand ! OK, my first thought is that mounting is going to be a problem. The Allegro IC is sensitive to magnetic fields than go from it's top through it's bottom (or the reverse). That's to say the field should be perpendicular to the PCB that the IC is mounted on.

I thought you had done some tests (using the Allegro) that showed that the field, when the magnet is set into the ice proper face down, rises up from the ice, perpendicular to the ice surface. If so then the Allegro sensor and PCB should be horizontal, parallel with the ice surface. Perhaps I should double check that post and data before going on but, if my recall is correct, then the vertical PCB mounting won’t work for the Allegro IC. That makes me wonder how it did work for the sensor used ?!? If the original sensor was in a traditional transistor package, like a TO-92, then I could see the sensing face being horizontal. The TO-92 would be perpendicular to the perpendicular PCB and so it’s sensing face (the flat face) would be horizontal.

http://upload.wikimedia.org/wikipedia/c … rs.svg.png

I recall that SFE sells a small SOT-23 breakout board. It’s dimensions are 0.34" x 0.46" (8.6mm x 11.7mm) and so I don’t think that will fit “horizontally” into the hollow stem ??

https://www.sparkfun.com/products/717

How does the normal Curlex handle bolt through the stone ? Is there any chance to have an adapter of some sort btw the bolt from the bottom and the top of the handle, and put a small PCB w/the Allegro on top of the bolt, btw the handle top and the bolt ? I’ll sketch up a drawing tomorrow to illustrate what I mean. I ask because if we use the right bolt (not the usual stainless steel) then it will “conduct” the magnetic flux up itself to the sensor (now in the handle) w/little loss in strength.

But perhaps we’re getting too far ahead of ourselves. The Allegro sensor was chosen because it seemed the best choice knowing nothing about the field produced by the magnet. Perhaps before stressing over mounting that sensor in a proper way, we should just find a way to get it to measure the field from a number of representative hoglines. Perhaps that data will allow (?mandate?) the use of a different sensor, with a different set of mounting problems. Perhaps just duct tape it in the depression in the bottom of a stone, with wires through the stone to the rest of the test bed hardware, sitting atop the stone (perhaps also duct taped in place). No Curlex handle for the moment. Push the stone by any means to deliver it across the hoglines. We collect some data with the Allegro set some known distance above the ice and see what we see ? That was my impression of the primary mission of the test bed as it sits now. Then we re-evaluate the sensor to be used. And meanwhile we can take some time and ponder alternate mounting schemes ?

I agree that I am getting ahead of myself. Just having a hard time getting the hall sensor into the correct position. The bolt that holds the handle in place attachs on the right, The left side screws into the handle.

The small circuti board actaully has a small extension (about 1/8in wide) that is held in place on the male-to-male union by a set screw.

With the circuit board attached, it looks like the assembly consisted of adding some silicon adhesive in the female-to-female union and screwing the two together. When it is assembled, the wires would come out of the assembly on the left and go up to the circuit board.

On the circuit board, there are two 8pin smt packages. I lost one of them in the removal process.

I am going to repeat the measurments using a new allegro sensor using a new technique for soldering the leads tha tshould be more robust.

ijourneaux:
I am going to repeat the measurments using a new allegro sensor using a new technique for soldering the leads tha tshould be more robust.

That might be very interesting. Here's a short article re: flexible 'fridge magnets. As you can see, their structure and field lines are very different from my earlier diagram (simple bar magnet, w/N-S axis pointed up). Perhaps the magnet used is not as simple as I thought it "should" be ?

http://education.mrsec.wisc.edu/background/fridgemag/

Interesting. Based in this description how would fridge magents actually stick to one another? Each side of the flexible magnet definitely has a stronger North and South side.

I am finally back to working on this. Using the SS49E Hall sensor. It outputs the magnetic field strength as an absolute number.

As we discussed the orientation of the magnetic field is important. The flat surface of the hall sensor (both the SS49E and the A1304) is very sensitive to orientation of the sensor relative to the magnetic strip. It seems that for both the SS49E and A1304 the easy orientation (mounted in the stem with flat surface perpendicular to the ice) is wrong for magnetic strip as placed in the ice. As you mentioned, I need to get the flat surface parallel to the ice and the magnetic strip.

It is hard to imagine the the sensor in the original ciruit is mounted in the correct orientation as it would seem very that the sensing area is the flat part of the IC and the way it is mounted is perpendicular to the ice.

Regarding the SS49E it seems that the signal is about 20 about an inch away. If I bend the pins 90 degrees, I may be able to get the chip into the correct orientation for my needs.

I think I have idea for a jig that will get us the data we need to validate the measurement. At this point, the plan involves the SS49E with the pins bend 90deg at the bottom of the stem. This is locate about 1-1.5in above the ice.

I have someone drawing up the figures required for the stem pieces so that I can get a machine shop to machine them for me.

If you go back to the original picture of the circuit board earlier in the thread, I won’t need as much surface area but I still need to support the LEDs. Any thoughts on how to integrate the Arduino (or other micro processor), capacitance sensor and support of the LEDs in a way that would require a custom circuit board? Is there a low cost servie to get a custom board?

Wouldn’t the SS49E sensor, mounted normally on the PCB mentioned above, end up w/it’s sensing face towards the ice … as depicted in the cutaway below ?

(click on to open)

good point and a better solution. I was just going to solder the wire wrap wire to the leads on the SS49E. THe installation of thehall sensor into the stem is a one way tripas it is cemented into place with silicon

ijourneaux:
good point and a better solution.

I wasn't trying to offer a solution, I was just trying to understand what was happening with the "bending the pins 90 deg". I'll guess that that was describing a way to use the TO-92 sensor with wires soldered (no PCB) to their leads.

In any case my guess is that the PCB you recovered was as I described and the popped off SMD’s were likely op-amps used to amp-up the signal from the Hall sensor.

In any case I eagerly await the results of your measurements. Should be interesting and most telling to further your design effort. And on that note … at work “I” have people to layout boards and do the manufacturing. For my personal uses I’ve relied on a simple milling machine and SW (in a back room at work) to cut my (simple) boards. A lot of hobbyists here use Eagle CAD SW to do a layout of their custom board and then do one, or both, of the following;

  • make a onesie twosie board(s) via the whole copier/hot press/etching home technique or

  • send the board design to a PCB house, who will make 2-X of your boards at a not unreasonable price. But if your design is wrong … that’s on you. SFE had one such house they advertised and offered up for customers, now dropped ??? … but when you get to that point it’s a sure thing a design can be made in “low” production quantities, albeit w/a 2-5 week wait period. You then get to populate and solder the boards. But that too can be outsourced.

Mee_n_mac

Just following up. I finally have a test bed assembled with the Arduino and capacitance breakout board attached to the top of a handle. I wired the capacitance breakout board antenna to the handle. So I think I am ready to actually collect some field data. That would probably be sometime later this month. With the current TO-92 hall sensor, the reading with a magnet is in the 30-80 range. with the magnet away from the sensor, the reading is 0-1

I still have to upload the new sketch you developed that will allow data to be logged to memory. Now that most of my home projects (washing the house, replacing vinyl siding, installing new yard sprinkler system etc, etc) are done I should be able to get to it within the next few days.

One thing I noticed with the capacitance breakout board (and not unexpectedly) it actually detects the hand when it is just in proximity to the handle, not just when the hand is touching the handling. I wasn’t able to locate a way to adjust the sensitivity of the capacitance sensor.

Ian

In the last sample code , I am trying to understand what this code is trying to do. As it stands right now in verbose mode, I can swipe the magnet under hall sensor and see that the sensor picks it up but i don’t see it the next time the arduino is restarted and you get a dump of the data in the EEPROM

Should this line

iStop -= iMax

be

iStop = iMax

    //Try to detect pulse leading edge
    if (mag[iCtr] > magThrsh) {
      cntr ++;
      cntr = min(cntr, 5);
    }
    else {
      cntr --;
      cntr = max(cntr, 0);
    }
    if (cntr > 3) {
      // pulse detected
      digitalWrite(redLEDpin, HIGH);
      if (!verBose && !detect) {
        detect = true;
        //set stop point ~half number of samples into the future
        iStop = iCtr + (iMax / 2);
        if (iStop >= iMax) {
          iStop -= iMax;
        }
      }
    }