Diesel Manager on a stamp
Diesel Stamp
Posts: 3
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.
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.
bs2
6K
Comments
Thanks
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
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.
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
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
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
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
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.
Post Edited (pwillard) : 7/5/2007 2:20:54 AM GMT