12V to porta

Orville

New Member
Hello

In what way might I interface/buffer 12V (automotive) as digital input
to the Picaxe28X1? I'm supposing the voltage must be dropped to 4-5V?
What components, digital and/or IC should I use? Can anyone point me
to a cicuit?

Suggestions will be appreciated - I need help.

Orville
 

leftyretro

New Member
Hello

In what way might I interface/buffer 12V (automotive) as digital input
to the Picaxe28X1? I'm supposing the voltage must be dropped to 4-5V?
What components, digital and/or IC should I use? Can anyone point me
to a cicuit?

Suggestions will be appreciated - I need help.

Orville
two resistors in series forming a voltage divider is one simple way.
 

BeanieBots

Moderator
By "automotive" do you mean actually in a car?
That is a voltage anywhere between about 8v during cranking and 14v at idle with ~30v 20mS spikes and 1.5kV 3nS spikes from ignition or do you mean a 12v car battery on the bench of around 10.2v flat to 14.2v fast charged?

For a nominal ~12v then two resistors would be fine.
I'd suggest 6k8 on the top and 4k7 at the bottom.
That would give around V*0.41 = 4.9v @ 12v.
At 10v it would see about 4.1v which should still be enough for a logic high.
At 14.2v it would exceed the maximum input at just over 5.8v but the PIC input clamp diodes will shunt away excess current. If you want to use pin3 on an 08M you will need to fit a clamp diode between input and Vcc because that pin does not have an internal one.

If it's for use in a car, then (here we go again) you will need to do a lot more.
As a minimum, ferrite bead, probably drop the top resistor to 5k6 for reliable detection of cranking voltage (if that's what you need it to do) and fit a 100nF cap to the PICAXE input to absorb spikes. I'd also fit a fast switching clamp diode to the input and not rely on the internal one.
 

kevrus

New Member
I would use an opto-isolator, keeps things fairly simple and eliminates and nasties entering via the input pins, also no need to common up the -ve if a separate supply/batteries are used for the picaxe 5v. If you are powering the picaxe from the car supply then you only have to worry about filtering the one input (supply) as apposed to numerous inputs.
 

gengis

New Member
I second the opto isolator idea. There's all kinds of hash, low/high voltage, and spikes on auto electrical systems. Isolators prevent RF (hash) from jumping the divide, and are very tolerant of adverse conditions themselves - particularly if you select for that property.

If it is also supplying power to the picaxe an inductor is a good idea as Beanie Bots suggested, and I'd go one further and add a forward biased diode in the power to the voltage regulator to protect against reverse voltage (jumper cables connected backwards) and use a large cap to hold up the voltage to the 'axe in the case of the car cranking and a momentary sag in the battery voltage causing a reset or hung processor.

Outputs to the auto from the picaxe - more isolators.
 

Orville

New Member
Thanks for the suggestions.

Yes, this would be used in a car.

So, to use an poto-isolator like say a PC847, connect the 12V i/p's to the anodes and the cathodes to ground on the primary side. Then on the secondary
side, connect 5V to the collectors and connect the emitters to the porta pins.

If that's correct so far, What other components would the circuit need such as resistors, capacitors, diodes?

Orville

BTW, why the check marks in the ratings column?
 

kevrus

New Member
The inputs on an opto-isolator are effectively an infr-red LED hence a series resisitor will be required as per normal LED. The forward voltage drop and the operating current values will be required to calculate an appropriate resistor value.
You may also need to fit pull up/down (depending on wether you are switching +5v or -5v)resistors to the picaxe pins to avoid floating when the opto output is off, value is not that critical, but needs to be in the 'thousands of ohms' rather than 'tens of ohms'. I usually use 4.7K.
 

Shafto

Senior Member
I'm also looking for the right opto isolator for this job.

Searching around I found this:

http://optodatabook.liteon.com/DataBookFiles/11273/LTV-702F.pdf

well priced, under $0.30 each, and fast.

Response time ( tr : 2uS IF = 10mA, RL = 75Ω)

...so these say they are 50mA, but they respond better at 10mA? is it generally better to derate these?... what is RL? the inline resistor to the LED side of the isolator? with a 12-14.5v input I think a 1k would be a good choice, Vf of 1.4 would be around 10-12mA. I've never used opto isolators before, just want to make sure I'm implementing this properly..

They say in the data sheet that they're directly connectible to TTL, so I imagine all you need is the pull up/down on the picaxe pin plus the inline resistor for the input side and you're set right?
 

moxhamj

New Member
That will work. They are just leds and 10ma is a standard sort of led current so 1k would be fine. And on the other side a pull up/down resistor - if you are running straight into a picaxe 100R to 1M would work but I'd probably pick 10k.
 

gengis

New Member
Generally speaking, opto isolators do run faster at lower currents. If it is an input to the 'axe it is high impedance so won't require a lot of current and you could probably get by with less than a milliamp. Both the internal transistor and led take a little time to do their things (even if the coupling happens at the speed of light). If speed is important, you get a high speed isolator or use a pulse transformer.
 
Top