1
\$\begingroup\$

I would like to build a circuit to perform a timed shutdown, based on logic inputs from headlamp wires and ignition wires.

I have decided on PIC10F200 (datasheet) to perform the logic.

I also have many spare 7805 linear regulators, so thought I'd use those to perform 12V->5V regulation before connecting directly to PIC pins configured as inputs. Is this a terrible idea? I have added pulldown resistors so that the PIC input pins can read defined values.

Using Fritzing, i've created a circuit: enter image description here

I'm still tinkering at the moment, and this being my first PIC circuit, I want to make sure I can avoid all the possible traps when working in an environment like this.

So basically, is the circuit okay, or have I overlooked things?

All and any help appreciated, please go easy on me. I'm new!

Update:

Following advice from Olin and Wouter, I now have this:

enter image description here Is this ok?

Olin says making use of the weak pullups on the PIC could save on component count, yhis is how i've interpreted him: enter image description here This works in the simulator, but I've no idea if my pile of BC547 are suitable!

I also don't know which to choose, or why?

Thanks again guys.

\$\endgroup\$
2
\$\begingroup\$

You can use 7805's this way, but as they only replace one resistor (and require 2 additional decoupling capacitors each!) I would never do it this way. My suggestions:

  • replace the two 'sensor' 7805's by resistor / zener-diode combinations. Use 4v7 zeners.
  • add two 100nF capacitors at the input and utput of the remaining 7805
  • add a suppressor diode over the relays coil!!
  • I am not sure a jellybean 7805 is a good idea in an automotive environment, there can be nasty spikes on the power line.
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$
  1. We can't easily tell if the PIC is hooked up right since you only show pin numbers, not functional names. No, I'm not going to look thru the datasheet to see which pins are what. Also, a 10F200 has 6 pins in most cases. Are you using the 8 pin package for some reason or accidentally drew 8 pins? We can't tell without proper documentation in the schematic.
  2. 7805 regulators should not be connected directly to "12V" car power. The problem is that car power can momentarily glitch higher than a 7805 can stand. You can use regulators specifically designed for car power, or add some clamping in front of the 7805s.
  3. The regulator intended to make 5 V from the car power should have a input and output capacitor physically close to it. See the regulator datasheet for minimum requirement, including possible ESR requirements on the caps.
  4. Even if a 7805 could safely regulate car power to 5V, it is not a good idea to use one as a 12V to 5V logic signal converter. It may take a while for its output to drop since there may not be anything actively pulling it down. A simple resistor divider that makes 5 V from the lowest valid "12V" power with a zener clamp to ground will work fine. That's only two resistors and a 5 V zener diode.


    Another approach is to have the voltage divider turn on a NPN transistor with grounded emitter. The PIC pin is then driven from the collector with a pullup resistor. Some of the PIC pins have internal pullups, so you can possibly tie the collector to the PIC pin without additional parts in some cases. This inverts the logic level at the PIC pin, but that can be easily adjusted for in firmware.

  5. We don't know what that coil-looking thing is that Q1 is driving, but there should be a diode accross the coil else the inductive kickback when will fry Q1 when it is turned off.
  6. How is the PIC going to be programmed? There seems to be no consideration to in-circuit programming. That's OK if you don't plan to program in circuit, but that's usually what you'd want.
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.