This Page is About a PIC Experiment
Before we begin I should point out that the way the PIC is used in this application is very simple. We could have easily used a 555 Timer in this application. However, the use of a programmable Micro-Controller leaves open additional possibilities. The uC used is a 12F683 manufactured by Microchip Corporation. This is a PICAXE version of the chip known as the 08M. These modified 12F683 chips have a pre loaded boot loader making programming the chip easy. The data sheet from PICAXE may be found here along with other useful information.
The objective is to generate a "one shot" pulse of a specific duration based on an event. The event in this case will be the turning off of an automotive ignition system. The automotive ignition system will hold an input pin of the chip at a logic high level. When the ignition is turned off the input will transition to a logic low triggering a pulse output on another pin.
Initially Starting From An Off Ignition
We see that when the ign is turned on the voltage at the ign transitions from a logic low to logic high state. However, the pulse out line remains in a logic low state. I should point out that a 12 Volt input to this chip would cook the chip so the 12 volt ign is divided down to a safe input level for the chip.
Ignition Turned On Pulse Out Low At The Cursor Arrows
At this point in time at the cursor the ign is in an on state providing a logic high to our chip input. Nothing is really happening.
Ignition Being Shut Off Initiates The Start Of A Pulse Out
At the same time the ignition is shut off and does a transition to a logic low the pulse out pin begins it's transition to a logic high state. The width of the pulse will be determined by the programming code embedded into the chip.
Pulse Width Complete The Pulse Out Transitions To A Logic Low
With the ign off the pulse out continues in its high state while the ign remains low until the pulse out times out. This amounts to a "one shot" providing a uniform pulse of amplitude and duration.
The Actual PIC Program Looks Like This
I intentionally left the program code in the program editor. We can see there really isn't too much to it. Just a few lines have this tiny 8 pin chip doing what it does. Pin3 is the signal from the ignition and pin4 is the output pin.
The Actual Electrical Circuit Looks Like This
NOTE: The MOSFET used as Q1 is an IRF 510 and a poor choice for use with a PIC chip. A much better choice would be a "Logic Level MOSFET" that only requires 5 volts to turn on the gate!
This entire circuit can be constructed on a small breadboard. The circuit uses a 12 Volt always on line from a 12 Volt source that is always on within the automotive system. One line of always on is fed to the load which could be a solenoid doing some work while another always on is fed to a LM7805 voltage regulator to provide power to our chip. Capacitors C3 through C6 ensure that the chip sees clean DC power and eliminate any noise. A similar configuration is used for the ignition in line. Resistors R1 & R2 divide the incoming Ignition In line down to a safe input level for the chip. Since these chips have a limited current output (about 20 mAmp max) the chip output is driving a small N Channel MOSFET transistor capable of driving about a 4.0 Amp load.
The chip could be programed to do much more using additional In/Out pins. For example a complimentary pulse could output when the ignition was turned on.
Maybe More Later... Ron