I have a project where I need to read a signal coming in and double the number of signals going out.
- The signal I will need to feed into the Arduino will be a square wave 12v signal. The signal is normally high, then a ground is applied to make the signal low for a brief period (3-5ms).
- For every 1 peak, I would like to output 2 peaks.
- Ideally, the peaks would be equally spaced, so the Arduino code would take a reading to determine the period between two signal inputs and equally space the output signals.
I have only done basic Arduino tutorials and on the outset this seems very possible from the Arduino's capability, but I need a little help with the circuitry and maybe code.
First: Is this possible?
Secondly: My thoughts on the code & circuitry are this:
a) I will need to condition the 12v signal down to a 5V signal to feed into the analog input.
b) The arduino code will process the analog signal to get a period, then output to a digital output.
c) A circuit will need to amplify the digital output to replicate a 12v signal.
I couldn't find any examples where someone was doing something ilke this. Can anyone point me in the right direction? Any similar circuits or code that someone has done something similar before?