Shop OBEX P1 Docs P2 Docs Learn Events
Using the propeller with automotive voltages — Parallax Forums

Using the propeller with automotive voltages

PainlessPainless Posts: 69
edited 2009-06-02 13:38 in Propeller 1
I've just been reading through the sticky thread reference using 5v inputs / outputs with the propeller, but really wanted to run this past everyone before moving forward with my own project.

I'm currently working on a piggy-back system for a vehicle's engine management computer using the propeller, the majority of the input and output will be handled by ADC's and DAC's, however, one part of the project requires me to sample the signal being sent to the engines fuel injectors. In more detail, I want to measure the length of the pulse each time the cylinder 1 fuel injector is switched on and off by the fuel injection system. This will mean reading a signal which could be anywhere between 12 and 14 volts (with the vehicles alternator running).

One idea I had was to use a 3.3v zener diode and two 2k resistors to drain out excess voltage:

Input Pin
/\/\/\/\---|--/\/\/\/\
12+v signal
...................................|
...................................~
...................................^ (3.3v zener diode)
................................... |
................................Ground

Another alternative idea was to use an n-channel MOSFET with the injector signal connected to the gate and the propellers Vdd and I/O pin connected across drain and source. If this won't work as required, perhaps a SPST analog switch IC with a sufficiently fast switching time?

Post Edited (Painless) : 5/28/2009 9:57:27 PM GMT

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-05-29 01:06
    Is it definitely 12-14V, or could it fluctuate? I'm thinking - what would that voltage actually be if someone disconnected the battery but left the alternator running. There are voltage spikes too. The simple answer assuming a perfect smooth 13V would be a voltage divider with 2 resistors. Divide by 6 or something similar.

    Over at the Picaxe forum interfacing with cars has been discussed a lot. Certainly you need to build a regulator and think about interference and voltage spikes. But I have a picaxe that senses the water temperature with a temp sensor taped to the side of the rubber hose going to the radiator, and a relay that turns on the radiator fan. It replaces the standard temp sensor (which failed, cooking the engine. Twice). This circuit has been working reliably for 3 years now (as is the third engine), and soon I am thinking it may actually be more reliable than the standard temp sensor arrangement which is exposed to coolant (and hence corrodes).

    If I were sensing an on/off 12V signal that had come from the engine bay of a car, I'd look at an optocoupler. On the led side, a 1k resistor in series with an external led (so you can see it going on and off) and then that goes to the led inside the optocoupler. On the other side, 3V=>4k7=>the internal phototransistor=>gnd. Sample at the 4k7. Put the optocoupler in a socket, and if it gets zapped it is a 50c component instead of an expensive propeller. I can draw a schematic if the above is confusing.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-05-29 01:35
    An optocoupler should work, or a pulled up NPN with a 10K input from the injector. I know the NPN works because I have done precisely what you are doing. I have a new board in the testing stage that uses optos, but haven't tried it out in the real world yet.

    If you use a voltage divider, be sure to include a zener in there or you can still fry the inputs.

    Post Edited (Erik Friesen) : 5/29/2009 1:43:19 AM GMT
  • grindelgrindel Posts: 68
    edited 2009-05-29 06:52
    Sort of off topic, but what would the best way to power the prop from a 12-14V source?

    Thanks.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-05-29 10:51
    A switching reg would be nice, but I haven't found one that seemed robust enough. I think that a good old regulator and heatsink is the best for auto applications. I have a 5v regulator rated for an input of up to 40 volts, and a transient voltage suppressor 6ka??? on the input side, and that feeds into a small 3.3v reg.

    I was using a reg that was rated to only 20 volts on an application on a chevy pickup and it kept frying, probably because of some transient, so I had to find a better reg and add the TVS.
  • virtuPICvirtuPIC Posts: 193
    edited 2009-05-29 11:41
    I remember a thread on powering a uC in a car from another forum. Well, you have to expect steep spikes of several ten volts from the ignition. Someone in the thread mentioned the official robustness criteria. Something of a series of several spikes of up to 150 V of milliseconds duration each...

    I recommend an LC filter, maybe even varistors, some fast circuit that blocks any remaining spikes, (an emitter follower with zener reference and a fast transistor?) and finally a linear regulator. Maybe this would even be nuclear-EMP-resistant, but who cares...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-05-29 12:34
    With such high voltages, high currents and temerature extremes·the automotive is a harsh enviroment. I have used opto-isolators before but more to cut out the earth current problems which gave all sorts of unexplained problems.

    Years ago I had to use a whole bank of isolators between two halves of a·hilltop building, every time it got blasted by lightning, about twice a week, the fault reporter (TTL mostly) didn't want to play anymore. All the earths were bonded, all the inputs were filtered and protected but TTL verses Thor always ended one way. The opto bit was exagerated for reliablity later on by 2 metres of fibre.
  • PainlessPainless Posts: 69
    edited 2009-05-29 13:42
    I still need to pull a T off of the number one fuel injector control signal and verify, but at worst case it is going to be 14v. I definitely agree though that protection against spikes would be a must, the injectors are right next to the spark plugs so I cannot rule out the possibility of an accidentally inducted current either. Maxim seems to stock voltage regulators approved for automotive use, I'll need to check into the protection afforded there. I'll be using 5v and 3.3v in my system.

    Optics sounds like an interesting approach to be considered for this, how would it affect the responsiveness of the prop to the signal? At 6,000 rpm, the injectors will be firing 50 times a second and I will need to accurately measure the width of each of these pulses. Will this still be feasible with the optical solution?

    Thanks for the input, it is appreciated.
  • Jim FouchJim Fouch Posts: 395
    edited 2009-05-29 13:43
    I have used a LM339 Comparator fed into an opto-coupler to interface the fuel injectors on my projects. Be very careful connecting anything that will load the circuit you're trying to read. I'd also have some sort of micro fuse. The last thing you want is to short the injector and mess up your fuel mixture. Even driving an LED using an Opto-Coupler w/o the LM339 can add 10ma or more to the sensor/signal you’re trying to read. I’ve had some motorcycles’ tachometer’s needles act strangely after interfacing to them. I think the extra wire can act like an antenna and pick up strange noise from the system and interject it back into the tachometer. By using the LM339 you are only adding micro amps instead of milliamps by using an opto coupler alone.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jim Fouch

    FOUCH SOFTWARE
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2009-05-29 15:25
    I always use the 4N35 and a resistor for things like this. I have a lot of these optocouplers
    and have had good luck with them, they are very inexpensive and robust parts.

    I have used small switching pwr supplies to power AVR chips from car power. I buy them from Thailand
    for 2.65 they are 5v pieces but I suppose you could use a few dropping diodes to power the propeller.
    These supplies are good for about 1amp.

    The 78xx type parts do a good job and are very inexpensive....not as efficient as a switcher but still
    a good choice.

    http://www.ereshop.com/index.php?main_page=product_info&cPath=75&products_id=188
  • PainlessPainless Posts: 69
    edited 2009-06-02 10:34
    Thanks for all the replies, I think I'm going to try out the comparator idea first as it offers some inexpensive testing (I have a few of them lying around!) and sounds like a very good solution.

    As for power, I'm going to need both 5v and 3.3v in my system, so I'm going to run the automobile voltage to a 7805 and then power an LM2937 3.3v regulator from the 7805. This should at least provide two levels of protection. Some further spike protection before the 7805 probably wouldn't be a bad idea though.
  • northcovenorthcove Posts: 49
    edited 2009-06-02 11:56
    I've been using the 7-30v input switch mode regulators from Dimension Engineering with both 12v & 24v systems with no issues. 5v regulator product details is at http://www.dimensionengineering.com/DE-SW050.htm. Price $15.
  • JavalinJavalin Posts: 892
    edited 2009-06-02 13:38
    be careful of back-EMF. The injectors coils will produce 50v or more when they shut. Make sure you're diode is upto it.

    James
Sign In or Register to comment.