I have run into a bit of a problem in my project. I have constant +12 volts from a connector and another connector that pulses ground at about 1 Hz.
So I need to read pulse count between those connectors. I know I can do this with relay but I want this project to be silent so I was wondering what is the best way of doing this when my counter takes in 5 volts and 20 mA.
Regulator, pnp transistor, etc?
Thanks in adcance and sorry for spelling mistakes, english isnt my first language.
I have run into a bit of a problem in my project. I have constant +12 volts from a connector and another connector that pulses ground at about 1 Hz.
So I need to read pulse count between those connectors. I know I can do this with relay but I want this project to be silent so I was wondering what is the best way of doing this when my counter takes in 5 volts and 20 mA.
Regulator, pnp transistor, etc?
Thanks in adcance and sorry for spelling mistakes, english isnt my first language.
From your circuit, a simple voltage divider between pin 1 and ground could solve the high voltage issue.
Is pin 2, an output or input?
I think you mean pin 2 of the connector, in this case it is an output terminal.
And the MCU pin 13 is the pulse pin, set as input (high impedance)... right?
Should you use the 12V of the connector instead of the 5V of the MCU, in case you will find out that pin 2 is an open collector?
From your circuit, a simple voltage divider between pin 1 and ground could solve the high voltage issue.
Is pin 2, an output or input?
I think you mean pin 2 of the connector, in this case it is an output terminal.
And the MCU pin 13 is the pulse pin, set as input (high impedance)... right?
Should you use the 12V of the connector instead of the 5V of the MCU, in case you will find out that pin 2 is an open collector?
The problem I can see is not in the pulse measuring circuit but How your +12 VDC power supply is connected to ground, or how this ground .line is interrupted.
You hAve a 12 VDC source with +12 VC to one connector, and its ground line , "0"v connected to ground, or not? If you connect the return to ground interrupted, then you must generate the +5VDC against GND by a 5 V ZEner diode via a 1 kOhm resistor, so the +5V, 20 mA input receives the required input voltage.
In my opinion you are lost in the input power supply schematic. Please offer the complete circuit, otherwise you are still lost.