Go Down

Topic: Is this right? Counter IC triggered by spinning magnet/hall effect sensor.  (Read 366 times) previous topic - next topic

Johnny010

Hey.

I am planning on making an wind speed measurement device as part of the STEM club at the school I teach at.

I was thinking a magnet could be used to trigger a hall effect sensor...making this relatively low power (no LEDs).

I have quickly scanned this paper Wind Speed Measurement Paper, they have used a similar idea except used an "always awake" MCU to count pulses from an LED being cut off by a vane from an LDR. I want to keep the IC (an ESP8266) asleep for an hour, wake up, get the number of rotations from a binary counter IC.

Essentially I was thinking this:

Vane turns -> Magnet Passes Hall Effect Sensor -> Hall effect sensor increments 16 bit counter -> MCU wakes up -> MCU triggers some parallel to Serial converter ICs to read and send the data serially to the MCU.

Now, the hall effect sensor may "jitter" around the voltage point where a counter IC may register multiple "pulses" on each pass of the magnet. So I was thinking, would a schmitt trigger and a capacitor of some sort be a way to "de-bounce" the signal?

The Schmitt would say only "trigger" once 2.5V out of 5 had been reached and the capacitor "absorbs" any noise/ bounces.

Is this the correct way to do this?

Does the counter Dual 16 Bit SN74lv8154 Counter already have some form of "de-noising"?

Grumpy_Mike

Quote
Now, the hall effect sensor may "jitter" around the voltage point where a counter IC may register multiple "pulses" on each pass of the magnet.
No it won't, hall switches will have hysteresis already.


Quote
Does the counter Dual 16 Bit SN74lv8154 Counter already have some form of "de-noising"?
No.

Sleeping for so long you will miss gusts and it will average out.


 

tinman13kup

How big of a unit are you talking? I'm thinking the reason optical sensors are used is because holes have no weight, unlike a magnet.

Like Mike said, this seems more like a mass airflow sensor rather than a wind speed sensor.
It's not a hobby if you're not having fun doing it. Step back and breathe

Johnny010

How big of a unit are you talking? I'm thinking the reason optical sensors are used is because holes have no weight, unlike a magnet.

Like Mike said, this seems more like a mass airflow sensor rather than a wind speed sensor.
A few grams of neodymium magnet at the end of a steel/wooden shaft shouldnt effect the moment of the shaft that much.

MarkT

The SN74LV8154 is a dual 16 bit counter with 8 bit parallel output which can be married with a parallel->serial shift register such as a 74HC299.

The SN74LV8154 can be configured as a single 32 bit counter if you want - each of the 4 bytes can be
accessed on the output bus using a separate select pin.  I've used it in the past as a frequency counter (since it can go to 40MHz or so), but its CMOS so very low power at low frequencies.  Its also available as through-hole and runs from 2V to 5.5V.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Johnny010

Update:

With help from Paul B on the forum, I have changed my thinking towards using the MCU itself with no separate counter.

The Hall Sensors will go LOW and act as a sink causing an external interrupt.

The Hall Effect sensors will be wired about 15-30cm off the board away from the MCU.

full res

full res


Phoenixxl

I use a hall effect sensor instead of a reed sensor to measure my gas ( heating not car ) usage.
It's not a sensor that's connected to an analog input but one with a cutoff potentiometer on that is connected to a digital pin.

looks like this:


The thing gives a constant LOW when the dial is between 1 and 7 and a constant HIGH when on 9. when it's between 7 and 9 it flutters between 1 and 0 . also when the dial is between 9 and 1.

I add up a few hundred reads then process the result. when it's above 95% I put 1 in a secondary counter which gets subtracted when not above 95% . I do the same with a second secondary counter when values of the first are 5% or lower. When that HIGH secondary counter secondary counter gets to 12 there is a boolean that gets set to true. Call it switchingAllowed. When that secondary LOW counter gets to 12 and switchingAllowed is true I set switchingAllowed to false and add 1 to my rotation counter. The 12 are like a moving window.

A full rotation looks something like this..

Pin Reads: (lot more of course)

1111111111111111110111010101101010101010010100000000000000000001010101010101111111111111111111111111111111111111

Let's assume I read 200 states in a row my results after that would be:

200,200,200,200,200,198,187,192,140,123,90,93,82,76,47,23,4,2,6,5,1,2,3,0,0,0,0,0,0,0,0,0,1,0,2,4,17,28,45,78,95,123,146,168,184,189,192,198,200,200,200,200,200,200,200

The secondary counters would look something like this over time after the first turn.

low:
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,2,3,4,5,6,7,8,9,10,11,12,12,12,12,12,12,12,11,10,9,8 ....

high:
12,12,12,12,12,12,12,12,12,12,12,12,12,11,10,9,8,7,6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9 ......

When explained like this I'm sure it can seem a bit bulky or weird but in code I'm sure you can see it's just a few lines.

In short , a turn counter isn't allowed to be added unless I'm sure the dial was on the other side first.

This is running on a PI. If I had an arduino for it at the time I would probably have gone analog for the reads.

Maybe your "jitter" issue can be solved in the same way?

I also believe, like others replies going optical is the better solution.

regards.


PS: 4 coffee measuring spoons, a few bits of lego technic, a tracking or "obstacle avoidance" sensor and a piece of tin foil should make a great test setup before you buy anything expensive.

EDIT
PPS: Thinking about it some more I'm sure those things turn backwards or swing in certain low wind
situations too no ? This could probably be detected by adding a second optical sensor.



or if you want to be absolutely sure, use 3 sensors and only count a turn when sensor 1, 2, 3 registered a turn in that order. If 1 triggered followed by 3 or 2 followed by 1 it was going backwards..
Or 1, 1 ,1 in that case the piece of tin foil was swinging over a sensor.



In this scenario if this is important,  your precision has also augmented to 1/3 turn instead of a full turn. Every time the sequence of the last 3 triggers was 123, 231 or 312 you can be pretty sure 1/3 turn went ok.


EDIT2:
hanging a ping pong ball on 4 springs or elastic bands and point a few distance measuring lasers at the thing ?
idk what precision/price ratio that would be though..

Or maybe a ping pong ball wired to 4 load cell sensors measuring the force on the ball from any direction.
Not sure about the precision of that one.

If you make a 3D grid of those things you should even be able to measure local gusts and quick wind turns.

Or you can also use an antenna to sense the movement of an object close to it like again a ping pong ball  :P  the same way a theremin works..

All this to say, there's a lot you can do yourself that doesn't have to look like or work like commercial windspeed meters either.


EDIT3:
The "flex and stretch" bit here contains some useful info:
http://hackaday.com/2016/09/16/resistance-in-motion-everything-you-should-know-about-variable-resistors/

Idk if this particular item is precise enough at that diameter for suspending a ping pong ball and measuring wind forces on it but still an interesting read. There's probably finer elastic resistors being developed as we speak, maybe even available idk.

Johnny010

I use a hall effect sensor instead of a reed sensor to measure my gas ( heating not car ) usage.
It's not a sensor that's connected to an analog input but one with a cutoff potentiometer on that is connected to a digital pin.
You have provided some lovely ideas! I will refer to this later once I ensure my mainboard works correctly!

Gone for Pull Up resistors to 3.3V on the GPIO 12,13 and 14 pins with diodes out allow "pull to ground" sensors to trigger interrupts.

The "sensor boards" I will work on later for specific needs, which some of your ideas will come in handy!

full res

full res

tauro0221

Hi,
Suggestion  you can use an "Obstacle Avoidance Sensor Module Infrared Reflection Photoelectric Sensor". I used it to read the rpm of a turntable. It give you a pulse every time  that pass over a  reflective marker. I use it to trigger an interrupt and take the time that take the platen for one revolution and calculate the RPM. It is easy to use. Just ground , VCC and output signal. Do a google with the above description or in Ebay. The cost is just $2.00.


Go Up