12V -> resistor -> collector, collector -> gate? That sounds like a pull-up resistor on the gate meaning it will always be on ;-).
Using an optocoupler you could probably use the circuit I attached below. R2 is a pull-down resistor to keep the gate closed when there is no activity through the optocoupler. The PC817 optocoupler is a cheap and small (4-pin dip) chip that also gives you the benefit that it isolates your PIC completely from the noisy motor circuit. As previously mentioned (in another post) there is an upper limit to how fast this can be pulsed so you’d probably have some gap between stop and slow forward and between fast forward and full throttle. The PC817 has rise and fall times of about typical 5 us.
Yes. I was proposing a pullup on the gate, but I was hoping that applying voltage to the base would ground the gate through the Tx.
I don’t see why the opto-isolator would work where the transistor failed, though. With the exception of an additional pulldown resistor, isn’t your circuit the same as mine?
I accidentally added a 500ohm pulldown resistor to mine and when I put 5V at the base, I get 5V at the source. When I take the 5V away from the gate, I get 3V at the source.
I replaced it with a 10K, and now I get 12V at the source regardless of the state of the gate.
I know this is not exactly an answer to your post but it’s a solution to your problem so here goes :-).
You can drive the gate using a voltage comparator (which is a specialized op-amp). This is exactly what you need, I think! You just need to create the 2.5V reference (don’t need to be very precise - just well above 0V and well below 5V) - you can just do a voltage divider with two equal valued resistors. When voltage from PIC is below 2.5V the comparator will output 0V and 12V otherwise. I’ve used an LM339 quad comparator since this is what I have at home and they are really cheap.
Nope. Won’t work. I need to pull the gate above 12V for source/drain flow.
I have moved the motor on to the drain side of the FET. I don’t know if my solution is only working bu fluke, but I think that what’s happening is that the resistance of the motor means that the voltage at the drain is lower than the 12V being supplied to the gate by the transistor. I’m pretty sure this is a requirement of the FET.
My terminology might be complete nonsense, but this may be called “saturation”. Either way, I appear to have max voltage, acceptable current and no heat.
If anyone understands FETs and can explain them inBoA-speak, please do so.
Yeah I don’t really know why I forgot about that in the design. I still think that thing with the resistor and the BJT looks strange and I would go for the voltage comparator solution, but if it works and the FETs stay cool then I see no obvious reason to change it.
Please excuse me if I am adding redundant info: There is no path through source->gate-> emitter in the original drawing, FETs use a capacitor to change states. That is why the diagram is always drawn with G separate from the rest of the FET. What is happening in the original drawing, is you are charging the Gate capacitor when you turn it on. With your design their is no way to Discharge the Gate, so it remains open until at some point it will leak away.
The way I understand it is, FETs operate by charging and discharging of the Gate capacitor, vs Transistors which work by a small current flow. FET Gates need to be all the way on or all the way off, Transistors can accept more variability in the Base current flow.
When Transistors heat up they conduct more through the Collector -> Emitter.
When FETs heat up they conduct less through the Drain->Source. That is why you can use FETs in parallel to build massive switches, because they are stable, in a parallel Transistor circuit, you would get run-away heat/voltage in one of the transistors, vs the auto-balancing behavior of the FETs.
I have mostly seen N channel FETs and NPN Transistors connected to the low side of motors. Typically when I put a NPN on the high side it will generate more heat vs attaching it on the low side, I assumed this was the case with the N channel FETs, but have no empirical data.
Is the last diagram the one the fried your PIC? I don’t see why it should unless the resistor off of the PIC is not biased enough to prevent the over-sourcing the pin.
No the last diagram didn’t fry the PIC. In fact, it was teh one which gave me full ooomph and no heat.
I only applied the rework to one of the two channels on my PCB, then having discovered the sweet smell of success, I applied it to the second channel and that’s when teh PIC fried. I’m looking for a solder spash or something just now.
PS - found nothing. Removed the PIC. Applied +5V to the output pin holes in turn with +12V applied. Found no strange feedbacks. Decided to risk a new chip. Plugged it in and it works fine. I guess it was just his time to go.
your Big Chaser looks very impressive. One of my dreams is, to build my own Segway.
One tip from me, although i am no electronics experts, but I know, when switching inductive loads like relays or motors is the need of flyback diodes, to kill the reverse voltage of the inductive. Without flyback diodes, you will kill your electronics! Maybe this fried your PIC.