# Pulse Counter

Im very new to arduino and am trying to replicate a old counter box my grandfather uses. It basically counts pulses from this device http://www.brodieintl.com.php5-21.ord1-1.websitetestlink.com/wp-content/uploads/ds351.pdf and displays them on an LCD. I cant figure out what pin i should connect the signal to i tried analog and digital and a few different code samples I found but Im getting weird numbers that don't match up (ie one revolution should give 250 pulses but im getting numbers in the thousands). Do i need something between the arduino and the signal? its critical that it counts every pulse... Any input will be greatly appreciated!

At 12-24V for the power, if you connect it to the Arduino you will damage it.
You should look at the O/P with a scope to see what the pulses look like.
The O/Ps may need pull ups.
I would guess Cahnnel A & B and maybe INDEX pulse are what you need.

The signal output is not 12v and thats all i was connecting to arduino, the pulser is actually just a photocell and a disc with 250 lines on it thats what creates the signal i believe the 12v is just to light up the led inside it.

The signal output is not 12v

Then what voltage is it?

around 2-3 when i tested it

I recommend you feed the O/P to a transistor circuit which is powered by 5 volts and feed that to the Arduino.

The transistor idea is probably the best way to go.

Something else that I might try is...
If you know what out put voltage is, then write code to look for that voltage. Then register a "pulse" each time. Hook into analog input on Arduino. Use simple sketch and Serial monitor to figure out what it's reading (probably between 400-600 somewhere)....we'll call that "pulseVoltage". Then, final sketch contains something similar to the following pseudo code:

``````If (analogRead(A0) >= pulseVoltage)
{
pulseCount++;
}
``````

This is basically an old style optical encoder. For correct sensor reading something has to beam to the photosensor. Thus you do need the 12V-24V to light the led. Ath the same time you no doubt will exceed the maximum ratings of the Arduino unless you use the internal 249 ohm internal pull-up. Apparently that is changeable.
Now it seems you are picking up shades where the photo transistor is picking up some voltage from the input pin of the Arduino (possibly)

Would a Diode be something i should use in this situation?