Omega Owners Forum
Chat Area => General Discussion Area => Topic started by: PaulW on 06 October 2009, 14:05:35
-
Hi all, after a bit of help if you can...
I'm trying to make a circuit which will run within a car or something, its to allow a programmed switching of 2 lighting units, using a PIC12F629, couple of P-ch mosfets, and some other bits...
I think I've got something going with this, but I have no idea how to get it to run on a 12v source... Also need to figure a way of having it as a switched override too so I can bypass the PIC for a steady-on sort of thing...
This is what I've got so far...
http://i130.photobucket.com/albums/p266/PaulW21781/86e4c6d9.png
I "think" this is right for how the PIC is connected... I need to get the input voltage down and regulated to 5v though from the 12v source from the car... Also trying to work out how to get both as a steady-on when a switch is triggered (otherwise, the outputs will switch independantly/together depending on cycle)
Reason aswell I'm using the mosfets, is I will be switching the outputs at about a 10ms cycle rate. (they will be 12v 4A LED lighting units connected)
Probably making no sense... But any help would be appreciated :y
-
look for this guy on ebay
he has helped me with a circuit set up
lewisrendal thats his ebay name
hope that is of use to you :y
-
Well, as to running it on a 12v source, the easiest way is probably a voltage regulator such as a 78L05 to provide a stable 5v supply for the PIC.
You'd need to consider that a car's supply can be dirty and can deliver huge current so it needs to be adequately fused, decoupled before and after the regulator and, personally, I'd add a transient supressor (tranzorb) and reverse-biased diode across the 12v supply so that any spikes don't kill the circuit.
Regarding switching them manually - why not connect a switch to an input to the and do it in code PIC - or don't you trust the code? ;)
Kevin
-
Oh, and just noticed the LEDs in series with the gates of the MOSFETs. They won't do anything as the current into the gate of a MOSFET is really only what's required to charge the tiny capacitance of the devise, so you need to drive these either from the output of the PIC against ground or the output of the MOSFET, with a suitable series resistance.
Kevin
-
I just thought about the LM78L05 regulator, added it in... Circuit is a bit more complete now
http://i130.photobucket.com/albums/p266/PaulW21781/595c5e37.png
In regards to what you say about the mosfets, I've read up on the schematics (as best as I can understand them) do they look right in regards to how they are connected? They haven't changed, I've just labelled the voltage bits now (VSS, VDD)
Also... can I use GP2 on the PIC as an input to detect a switch? I thought the GPx were just outputs...
As for coding, I'm going to be attempting that one! First time for everything and all that... :-X
*edit*
Just noticed I messed the previous one up... so this is new as of 4:04
-
A couple more concerns:
You might find that 5v from the PIC is not enough to turn the mosfet hard on meaning it will dissipate power and be inefficient.
You might also find that at that switching speed you don't have enough current drive from the PIC to charge the gate of the MOSFET rapidly enough leading to slow switching times and, again, inefficiency. Your series resistor and diode in series with the gate won't help here (and those LEDs need to go as said) but of course you might need to limit the current outside the PIC (can't remember if their outputs current limit to protect themselves).
All of these could be resolved by using a driver IC between the PIC and the MOSFETS. I haven't done the sums so I'm not sure if you could get away with driving directly or not, but I suspect, at that switching frequency and current, it might be marginal.
Note: You can also get MOSFETS designed to be driven by logic levels.
Kevin
-
I got the timing wrong... 100ms not 10ms ::)
LED's and resistors removed from after the PIC anyway... reason I'm probably making plenty of mistakes, is I've never done something like this before! I'm reading up quite a few books, and various sites, so this is what I've amalgamated from various sources of information so far...
-
Couple more things:
(Would be easier to scrawl a diagram on a fag packet and post it if I could!):
Your MOSFETs look like P Channel but I think they should be N channel devices in that circuit.
What is the purpose of the 1n4148 diodes? I would get rid of them (and the LEDs, as said) you need to ensure there is a path for current to be sunk out of the MOSFET gate into the PIC when it turns off too.
So, you should have PIC -> Resistor (as low as you can get away with) -> Gate.
Using something like an MC34151P as a driver in between would be my preference.
Kevin