I'm looking to take an input signal from a coil pack which is a nominal 12V and feed it into an Ardunio Mega 2560. I have VERY basic electronics knowledge so am looking for the simplest solution possible.
I thought I would use a voltage divider with a 10k and 1k resistor but this drops the nominal 12V value to below the threshold for the Arduino to see a state change on the pin.
So my question is what's the easiest way to take a 12V signal which can spike up to ~40-50V and make it a nice clean 5V input. Is it optos?
You're talking about input signals, right? Not the power supply?
[u]Here[/u] are some over-voltage protection circuits. (I'd increase the resistor to between 1`K & 10K for an Arduino input.)
You can optionally add a "protection diode" to the Arduino input following a 12:5 voltage divider.
Is it optos?
You could potentially burn-up an opto-isolator with a spike. You'd probably be OK for short duration spikes, and the Arduino would still be protected if the opto-isolator fails.
If it is an automotive environment, you should assume the running voltage is 15v (the alternator is probably running at around 14.5v). So a 2/1 voltage divider will get you 5v.
If you are not trying to measure analog voltage but instead just detecting 12v or ground, you do not need a voltage divider.
However you do need to prevent an overvoltage sending more than 1ma through the internal protection diodes. A 50k resistor would be a minimum protection against 50v but automotive environments can have 200v spikes on occasion so a 200k resistor might be a better idea.
A 200k and 100k voltage divider would allow you to measure voltage but it would be little slow from the high resistance so a 0.1 µF capacitor across the 100k resistor would help.
Of course it is not best practice to depend on the arduino internal protection diodes. That 200k resistor is a bare minimum.
A 1:2 (22k:47k) voltage divider with a Schottky diode clamp from pin to VCC.
I don't see how that would work Leo considering the circuit input voltage is 12V and the 40V spikes are
inherent in the type of environment. It needs to supply 12V all the time but filter out 40V spikes (like
Paul's circuit)
If you give me the schematic I'll simulate it but I didn't bother with the voltage divider because then you
would no longer have 12V, and in case it isn't obvious, the 40V spikes are unpredictable.
My circuit is the same as Paul__B, but without D1.
D1 can be omitted if D2 has a lower threshold voltage than a 1N4148.
Schottky diodes, like the 1N5819, should be in every toolbox.
Leo..
Yes. Any small signal Schottky diode will do.
Point is that the external diode must conduct before the internal one does.
Measured internal threshold once at ~0.65volt@1mA.
The BAT54S could protect against positive and negative spikes.
pin1 to ground, pin2 to VCC, pin3 to pin.
But all of this is a bit academic.
There must be similar protection diodes inside the MCU, although Atmel has not specified it.
47k between source and pin 'should' already be safe enough for the occasional spike.
Leo..
R, C, D filters are good and worthwhile but, I see no inductors.
Also, the starter motor is the biggest spike generator, followed
by the fuel pump, windshield wipers, door locks, etc,
Herb