![]() |
Forum Index : Microcontroller and PC projects : Counting Pulses
Author | Message | ||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
I have a Hall Effect sensor on a rain gauge, the output is 3.3v and goes low when the magnet passes (ie when the bucket tips). I am having trouble counting the pulses. I have set pin 15 to CIN connected to the output pin, but when the bucket tips nothing happens. I can see on my meter that the pin is going low at each tip but it won't count. Paul. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
It should work. I use all 4 counting pins 15 - 18 for counting hall effect flow meters. I read the pins every 30 seconds without any issues. You could try another pin - just in case, or try setting an interrupt to see if the 'mite is getting the change of level. Jim VK7JH MMedit |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
I tried using an Interrupt with limited success. SetPin 15,INTL,RainFall Sub RainFall Rain=Rain+1 Print Rain End Sub But the interrupt does not trigger every time the Pin goes low. Edit.. Just tried Pin 18 same problem This is a new E-28 first time used, I will try another one. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Maybe it needs a pull-up resistor. My flow meters have one built-in. VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
My flow meters use a WSH130 hall effect and the ones that got fried with the lightning 3 years ago were replaced with A3144 hall effect. They have a 10k resistor as a pull-up and I run mine at 5V. (The counting pins are 5V tolerant) You might not be pulling the signal pin low enough if the pull-up is too low resistance. Jim VK7JH MMedit |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Got it working with COUNT pin on a 28-Backpack, must be a problem with the E-28. Thanks Jim. Edit...now working with E-28 "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |