Shop OBEX P1 Docs P2 Docs Learn Events
Diesel Manager on a stamp — Parallax Forums

Diesel Manager on a stamp

Diesel StampDiesel Stamp Posts: 3
edited 2007-07-05 02:14 in BASIC Stamp
I've read enough of the forums to know that the more info I can provide about my project, the better chance I have of tapping into the fast knowledge resources available in this forum.

I am in the process of rebuilding a HUMV 6.2L diesel and put it into my gas guzzling pickup and run it on vegetable oil.· I got it in a government auction from the Army and it has no electronics, sensors, manuals, etc.· So I had the brilliant idea to use a Basic Stamp to

a) monitor startup time and temp to control the glow plugs
b) monitor engine temperature to control my electric fan
c) monitor vehicle speed to control my overdrive lockup torque converter
d) monitor vegetable oil temperature and control a series of valves to switch the vehicle from running diesel to running vege oil
e) control a couple of indicator lights so the driver (me) knows what's going on.

To help me in my quest, I went down to my local· Fry's electronics and bought the BS2 Homework Board and practiced the exercises in the "What a Microcontroller" workbook. From that I think I figured out how to create the circuits to capture temperature, control digital signals, turn transistors on and off, and how to monitor the status of a switch and/or jumper.

My problem is electrical engineering. I can usuall write pretty good code, I but I can never figure out where to put a resistor and/or capacitor, what sizes to use, and how to avoid frying things as I go.

My question are thus:

a) can I tie a pin directly to the base of a transistor with ground connected to the collector and the emitter connected to the ground side of a 12V relay?· No power will be going thru the stamp, all power to the vehicle devices (glow plugs, electric fan, TCC solenoid, indicator lights, and fluid valves) will be at 12 volts thru the relays.

b) my vehicle speed sensor (VSS) is a 2 wire square wave generator pulsing 4000 pulses per mile.· Can I hook that directly to a digital pin and ground or do I need some kind of intervening circuitry? I planned to use COUNT to get the pulses and calculate miles per hour, is there a better way?

c) can I run the stamp off my 12 volt vehicle battery and rely on the voltage regulator to do it's job or do I need something else to protect my little project?

d) after designing my schematic, I found the super carrier board. I'd much rather use somebody elses design and just plug and solder, is there any reason I shouldn't do that?

Thanks for any help you can provide.

I tried to attach a copy of my program and my sorry attempt at a schematic to this posting. If it didn't come out please let me know how to make the files available and I'll put them up right away.
2448 x 1836 - 527K

Comments

  • Diesel StampDiesel Stamp Posts: 3
    edited 2007-07-04 07:08
    I also forgot to ask for advice on what to use in the way of valves for the vege oil. The oil will be heated with a heat exchanger and when up to temp, I need to switch from diesel to oil. Any ideas on a 12 volt solenoid I should be thinking about? I don't know if it's appropriate, but I've also considered using servos instead. Again, I have no idea what's available, any suggestions would be appreciated.
    Thanks
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-07-04 13:32
    Looks like your Diesel Manager has a lot of exciting things to do, lots of them (all) at the same time.· This looks like a job for The Propeller (because it multi-tasks.)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-07-04 15:59
    To answer your question about the transistors: yes, you will need base resistors to limit the base-emitter current. Also, don't forget to put diodes across the relay coils tp protect the transistors from overvoltage spikes when they turn off.

    As to whether the BASIC Stamp can do what you want: I believe it can. You've got a lot going on, but none of it is real-time-critical. The program you've posted demonstrates that you've got a handle on the situation.

    Your biggest challenge is likely to be isolating the logic from alternator noise and other power transient issues. But at least you don't have sparkplug and distributor arcing to contend with!

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 7/4/2007 4:05:38 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-04 16:15
    b) Two potential problems with using the VSS directly: 1) The pulses might not be 0/5V which the Stamp requires. If they're 0/12V, you will need some kind of signal conditioning (like a voltage divider - 10K resistor in series with VSS signal, 4.7K resistor across VSS to ground - reduces range of 12-14V signal to 4-4.7V). 2) If the Stamp is busy with some other function when the VSS pulse appears, it might miss the pulse. You could use a simple flip-flop that's set by the VSS pulse and reset by the Stamp when it reads the flip-flop setting.

    c) You probably could run the Stamp off the 12V except that, in vehicles, the supply voltage can be higher ... like 13-14V ... and very noisy with high voltage spikes like during starting. It's much better to add some additional supply conditioning: a series inductor parallel capacitor filter and an additional regulator to drop the vehicle supply to 8-9V. Use a regulator designed for vehicles and use a largish output capacitor on that regulator (like 470uF or 1000uF).

    d) The Super Carrier Board is handy for this kind of thing.
  • phil kennyphil kenny Posts: 233
    edited 2007-07-04 17:32
    In addition to the suggestions already offered, I highly recommend
    that you use a fuse between the battery power line and the +12v
    going to your board(s). Test leads can slip and mis wires can happen,
    along with a host of other bad events. The battery can deliver
    a very large current under short circuit conditions.

    phil
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2007-07-04 18:06
    You might want to check out some of these books to help with the electronics theory stuff:

    Getting Started in Electronics by Forrest Mims
    Practical Electronics for Inventors by Paul Scherz
    United States Navy Electricity & Electronics Training Series

    The first 2 you can get from Amazon or a local bookstore.

    The third can be downloaded here: www.phy.davidson.edu/instrumentation/NEETS.htm
  • Diesel StampDiesel Stamp Posts: 3
    edited 2007-07-05 01:04
    Phil,

    You said to put a diode across the relay coils. What exactly to did you mean? I revisisted the schematics from my megasquirt project (see http://www.megasquirt.org for a full blown DIY-EFI computer) and on page 3 it has the schematic for wiring the IDLE and FUEL PUMP to a transistor to turn a relay on and off. Is this what you mean? As for power conditioniong, refer to the top of page 4 of the same schematic. Is this what I need to do to protect my stamp? Or would it be enough to bring power into a 7805 and leave the rest to the development board?

    Mike,

    when you mentioned a voltage divider and listed a 10K resistor and 4.7K resistor to ground for the VSS, are those the dividers or is there some other discreet device called "voltage divider"?· If the 10K and 4.7K resistors are the answer, do I use both of them or was that an either/or suggestion? And if I put a voltmeter to the VSS and while rotating I find it's putting out 5 volts, do I need anything more than just a hardwire connection to the appropriate pin?

    Anybody have any suggestions on the vegetable oil control valves?



    Thanks for everything.

    Tom
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-07-05 01:17
    Tom,

    Yes, the output circuit for IDL is exactly what I meant. As to the power conditioning on page 4, yes again. There's some good stuff there, and I wouldn't consider any of it overkill.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-05 01:34
    Tom,
    If you put two resistors in series and connect a voltage source across the two, a current will flow according to Ohm's law (I = E / R). In this case we have I = 12V / (10K + 4.7K). To make the math easy, we'll use 14.7V so I = 14.7 / 14.7K = 1ma. If we apply Ohm's law again to just the 4.7K resistor, we have E = I x R = 1ma x 4.7K = 4.7V. If we attach a high impedance input across the 4.7K resistor, it won't change the current to any significant extent and we have a voltage divider that divides the input voltage according to the ratio of the two resistors. If you want to read more on this, search the Wikipedia with an internet search for "Wiki voltage divider".

    Regarding the diode across the solenoid (or relay), you should download the "What's a Microcontroller?" tutorial from the Stamps in Class section of Parallax's download webpage. There are other tutorials there as well that might be useful. The Nuts and Volts columns (also linked from the Downloads page) are also very useful.
  • pwillardpwillard Posts: 321
    edited 2007-07-05 02:14
    Here is what I use for driving relays...



    Post Edited (pwillard) : 7/5/2007 2:20:54 AM GMT
    412 x 313 - 3K
Sign In or Register to comment.