Where could I find FRC legal hall effect sensors that would work with a PWM cable? I’ve found this and this. Any recommendations for use, mounting, wiring, sourcing and buying? Also, how could you code one in Java or C++?
Custom Circuits are legal. Make sure all wiring is within the rules and the power is provided as legally required.
R39, R47, R54, R58, R69, R72 are a few.
We have used a hall effect in the past. I will direct some additional help to this thread.
You can code in anything. If you are running your robot using LabVIEW, I don’t see why you couldn’t do it in there too.
Here’s an email I got from another mentor:
Team 836 had great success using the linked Hall Effect sensor very similar, if not identical to your Digikey linked sensor (Hall effect sensor [US5881LUA] : ID 158 : $2.00 : Adafruit Industries, Unique & fun DIY electronics and kits). The magnet can also be found on Adafruit.
This particular hall effect sensor is sensitive to the south pole of a magnet and is active low, (eg. every time the sensor sees a south pole, it will connect the output to ground.) Please note this is a simple explanation.
As for ways to interface this sensor on the Digital Side Cars: all DIOs are pulled high by a 10K resistor built into the DS. When your sensor triggers, it will pull the line low, so your DIO pin will be at 5Volts until the magnet passes the sensor, momentarily returning 0V as the magnet passes, then return to 5V.
I would suggest you take a small piece of protoboard and solder a PWM cable directly to the sensor in this order: PWM signal to sensor output, PWM power to sensor power, and ground to ground. Put the solder joints on the back side of the board. Then bend the sensor and lay it flush with the protoboard, using some 26 gauge wire (CAT5 works well) and the other holes in the board to secure the pwm cable to the back side of the board and the sensor to the front of the board. This will provide some strain relief for the cable and something to keep your sensor flush with the protoboard. Next, drill a couple holes in your proto board for mounting to the robot. The other end of your PWM cable can hook to the digital side car DIO just as it normally would. Remember when you’re mounting, that these sensors work best <~1/4 inch away from the magnet.
As for coding this again pretty simple, look at the WPI documentation for gear tooth or counter. You will want to count either rising or falling edges then use the period output to give you the time between the edges ie time take for each rotation. A little math and presto… RPM!
Team 1726 has used both kinds of magnetic sensors with good results.
The gear tooth sensor will detect the presence of ferromagnetic material (such as a steel sprocket) passing by whereas the magnetic switch will require a magnet (North turns it on - South turns it off).
The magnetic switch will require some additional components but the gear tooth sensor is ready to use with a Digital IO.
The magnetic switch is a lot cheaper to purchase and is also available at Sparkfun Electronics.
Also, we found the output of the magnetic switch to be somewhat noisy electrically but using the Low Pass filter from the PID library can reduce the noise.
We used the hall effect sensor in your second link last year, combined with a 22 tooth steel sprocket on our shooter, with no issues.
Included below are some photos from our Facebook page showing the mounting.
https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-ash3/522803_406524346042984_192706845_n.jpg
https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-ash3/575273_442967602398658_343415980_n.jpg
We tried to use Hall Effect sensors to detect the bump last year, and it did not work at all for us. They were so finicky that if they were 1/64 higher or lower than the 1/8" mounting window, they wouldn’t work.
Hey! Finally somebody who knows where the “macro” button is on their camera
Oh no! I forgot to put the Gaussian blur effect on!
I feel your pain with the atrocious camera phone shots trying to clarify something.
We (3132) are using hall effect sensors with a buffering circuit this year. We developed them in the off-season for our 2012 shooter wheels.
We use Hall Effect sensors from RS (http://australia.rs-online.com/web/p/hall-effect-sensor-ics/7384743/).
We are mounting the board flat underneath our shooter wheel, and ‘hanging’ the magnets down off the wheel. The magnets are epoxied into a piece of aluminium hex stock that was turned to a taper and had a hole drilled in it for the magnet. A thread was then tapped into the other end of the piece, to mount it on the end of the bolt holding the wheel on.
When mounting them, make sure that the sensor itself can’t move, so that it can’t be sheared off by whatever it’s measuring or drift away from the magnet.
I’m attaching a picture of the board, and a picture of our magnet mounts (before the pcb is attached), as well as the schematic for the buffering circuit. Let me know if you have any questions.
A useful gear tooth sensor that wires directly into a digital input is the Allegro Microsystems ATS667LSG. We like to use them when we need speed information but not direction information and we don’t need the highest resolution. We also like that they’re $6.
In the photo below an ATS667LSG is mounted to a carrier board and installed in the side of a Cim-u-lator gearbox, with its face about 0.03" from the output gear. It gives us a nice, clean 27 pulses per output shaft revolution. The sensor on top of the right motor is just posing for the photo.
http://i152.photobucket.com/albums/s177/electroken/ATS667cimulator_zpsdb51c3fd.jpg
How are you decoding the signal?
Nice find! A few questions.
- Where did you purchase them?
- Did you wire them with the bypass and lowpass capacitors?
- Do you have any data on how it performs on chain sprocket teeth?
…steel? aluminum?
Steel. Gear Tooth Sensors have an embedded rare-earth magnet along with a hall effect sensor. They detect a change in the magnetic field that you’re not going to see with a non-ferrous target.
EDIT: Also, Digikey has 22,690 in stock. Better order quick before they run out.
I think Jim was yanking my chain (also non-ferrous) for not being more specific.
Thanks for the source info though. We’ll get our order in ASAP!
- Digi-Key (hurry… only 22,000 left!)
- The capacitor hiding in the epoxy is a 0.1uF 50V ceramic across power and ground.
- We haven’t tried reading sprocket teeth, but I would expect them to work well with steel sprockets and a small air gap.
That’s a good question. I told the student writing the code what to expect for a signal, and he said “Yeah, I got this”.
The decoding method makes a big difference in the quality of the signal, especially at high speeds (depending in the method used).
Could you ask him to join the discussion here?
It was a serious question, Dave, because the sprocket is aluminum and I thought they only worked on ferrous teeth.
Hi Katherine,
We (FRC #4774) are going to use the same sensor boards! Thanks for making them open for others
We (FRC #3132) *1 forgot to include the value of T1 on the schematic. It is a 2N2222 NPN transistor, a TO92 package. Part of me is wondering if we can make all components sit flat so the board could be laminated in a future revision?
BR,
Adam
*1 (Yes, I am a mentor for two teams)