What sensor to use to count rotations (unattended, outside, and next to metal)? - Page 1
Forum section: electronics / projects

author: Tweaker555
author_rank: Newbie
timestamp: October 08, 2022, 12:23:23 pm
content: Hi All,I'm working on a project in which I need to keep count of the rotations that a big rod will make. To do so I can only attach one sensor box to the rod (so no separate parts next to the box).The rod is really big and heavy, so the size of the sensor/solution does not really matter. The rod will not change the angle of the axis around which it rotates relative to the ground.It does however need to work for several years unattended (so battery life is also a concern).I was initially planning on making use of a combination of a magnetometer and accelerometer to track the rotation. However, this sensor box will be used outside and thus experience fairly big temperature changes.So I'm worried that the accelerometer will start to show offsets that might trick my software into thinking that it is rotating. I could perhaps use the magnetometer to help eliminate this, but there will also be a lot of cast iron nearby so I don't fully trust that this would work out.Another possible solution would be to make use of simple tilt sensors (the ones with a metal ball inside). I suppose I could use two of them mounted with 90 degrees offset relative to each other. But I worry that they might not survive years of rotations and I worry that the ball might bounce around too much.Lastly, I could use a hall effect angle sensor, and mount a magnet that can freely rotate with some type of offset weight added to it so that it will rotate if the sensor box is rotated. This would probably work well but does require a lot of extra hardware (I couldn't find any parts that integrate all of this into one package). I'm planning on making tens of these, so assembly time and costs do matter.What solution(s) would you guys pick? Or do you have other solutions?Thanks!

author: CatalinaWOW
author_rank: Super Contributor
timestamp: October 08, 2022, 01:53:49 pm
content: You don't mention rotation speed and whether speed or direction of rotation ever changes which might change your answer.A magnetometer approach will fail if your installation lines up with earth magnetic field (equatorial with shaft aligned north south). Unless your no other boxes rule is not so rigid that it prevents you from putting a magnet nearby. Also can be confused if there are nearby generators of varying magnetic fields at frequencies which can't easily be distinguished from your shafts rotation. All in all I would not choose a magnetometer.Accelerometers as should work well. Offsets are not an issue, they can be removed by simple signal processing. With a pair of accelerometers you can get direction of rotation.Other questions about your requirements could be important. Is rotation count relative to position relative to where power was turned on, or must an absolute angle be used. How many microradians of accuracy in reporting the completion of a rotation is needed. Is there any allowance for missed rotations?To me the most interesting question given your statement of the requirements is how you will report the results of your sensor. RF and othe similar methods require another off shaft box. The answer to this question might give other suggestions for sensing method.

author: Terry Bites
author_rank: Super Contributor
timestamp: October 09, 2022, 11:23:55 am
content: Battery free mechanical counter?Much more relaible.Tear down an old speedo or elecrtic meter.VCR, tape player etc.Mod a tally counter.https://www.aliexpress.com/item/32922940248.htmlStick in an ip66 box and forget.

author: Berni
author_rank: Super Contributor
timestamp: October 10, 2022, 05:28:22 am
content: If the shaft is horizontal (or just not vertical) and there are no large vibrations then an accelerometer is certainly the way to go. Magnetometers are noisy, need to point the right way and can be messed up by large metal objects. Hall sensor with a offset weighted magnet is just an accelerometer with extra steps. Ball tilt switch is also just a poor mans acceleration sensor.Gravity is a pretty big acceleration signal so temperature drift is not going to swamp it out. The sensors are also cheep, reliable and low power. That way you can sit in a low power sleep state until you see the acceleration change (be it polling every few seconds or a sensor with wakeup interrupt functionality). This way you can stay in sleep mode for long periods when the shaft is not moving, but then do measurements when it actually is.You should be able to easily run for a few years from a single battery. Best to go for non rechargeable cells, they tend to handle harsh environments better and suffer less from self discharge.

author: Haldor
author_rank: Newbie
timestamp: October 10, 2022, 07:10:04 pm
content: The classic way to do this is to add a metal tooth (screw, bolt, gear etc) to the shaft and sense the tooth with an inductive sensor, like this one.https://www.mpja.com/Proximity-Sensor-Inductive-PNP-NO-Output-LJ12A3-4-Z_BY/productinfo/30306+HD/