Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ttl switching 12V supply

Status
Not open for further replies.

ptewright

New Member
What's the simplest way to switch on/off an 12V supply at 1A using a TTL output from a PIC microprocessor? The TTL signal may be switching between 0.5-1Hz. Should I use a MOSFET? Does anyone have any circuits?
Thanks! :D
 
ptewright said:
What's the simplest way to switch on/off an 12V supply at 1A using a TTL output from a PIC microprocessor? The TTL signal may be switching between 0.5-1Hz. Should I use a MOSFET? Does anyone have any circuits?
Thanks! :D
Using Mosfet + small NPN transistor, that's the simpliest and safetest way. I am using it in my supply...
 
Jay.slovak said:
ptewright said:
What's the simplest way to switch on/off an 12V supply at 1A using a TTL output from a PIC microprocessor? The TTL signal may be switching between 0.5-1Hz. Should I use a MOSFET? Does anyone have any circuits?
Thanks! :D
Using Mosfet + small NPN transistor, that's the simpliest and safetest way. I am using it in my supply...

Thanks for the quick reply. Is there a particular Mosfet and npn you could suggest?
 
Do you want to switch +12V or -12V ?

You need a P channel MOSFET for the former but I could not find a cheap one. That is why I drew the circuit below for nppc recently, see

This circuit can be adapted for your needs.

Len
 

Attachments

  • driver_458.png
    driver_458.png
    2.8 KB · Views: 1,490
ljcox said:
Do you want to switch +12V or -12V ?

You need a P channel MOSFET for the former but I could not find a cheap one. That is why I drew the circuit below for nppc recently, see

This circuit can be adapted for your needs.

Len
I have good experiences with IRF9540 P channel MOSFET
 
ljcox said:
Do you want to switch +12V or -12V ?

You need a P channel MOSFET for the former but I could not find a cheap one. That is why I drew the circuit below for nppc recently, see

This circuit can be adapted for your needs.

Len

I only need +12V.
Your circuit shows 2 inputs (A and B) and uses +/-24V. If I only need +12V, then do I only need half of this circuit?
 
Do you think that this would work?
Is this safe for running a 1A motor?
 

Attachments

  • circuit_915.jpg
    circuit_915.jpg
    8.3 KB · Views: 1,262
ptewright said:
Do you think that this would work?
Is this safe for running a 1A motor?
Looks fine, just add a resistor between the Gate and GND, just for safety if the chip is off so the motor won't spin...
 
Jay.slovak said:
ptewright said:
Do you think that this would work?
Is this safe for running a 1A motor?
Looks fine, just add a resistor between the Gate and GND, just for safety if the chip is off so the motor won't spin...

Awesome!! :D
Is there a way to calculate the value of that resistor, or will something like 1k be ok?
 
ptewright said:
Jay.slovak said:
ptewright said:
Do you think that this would work?
Is this safe for running a 1A motor?
Looks fine, just add a resistor between the Gate and GND, just for safety if the chip is off so the motor won't spin...

Awesome!! :D
Is there a way to calculate the value of that resistor, or will something like 1k be ok?
"Calculate", anything between 1-20K will work fine. The lower resistor value, the higher curent it will suck, For example Udd=5V and R=1K, the current taken will be I=5mA... not a big deal...
 
ptewright said:
Do you think that this would work?
Is this safe for running a 1A motor?

You said that the IRF540 is a P channel MOSFET but it is an N channel.

So yes it will work.

However, you should also connect a 100 Ohm resistor between the PIC and the gate.

If you want the motor to be reversible, then you will need to use my circuit with both P channel (or if you can't buy a cheap one, use a darlington as drawn) and N channel MOSFETs

Len
 
ljcox said:
ptewright said:
Do you think that this would work?
Is this safe for running a 1A motor?

You said that the IRF540 is a P channel MOSFET but it is an N channel.

So yes it will work.

However, you should also connect a 100 ohm resistor between the PIC and the gate.

Len

So my diagram is wrong?
How would I connect the IRF540 differently if it's an N channel?
Then, do I also need a resistor between the gate and ground (as someone suggested earlier)? Or is the internal diode of the MOSFET enough to protect it from spikes?
 
No, your diagram is correct. A P channel MOSFET would not work with a positive supply.

So the MOSFET in your diagram must be an N channel.

I don't see the need for a resistor from the gate to gnd. If the "chip is off" as he said (I assume he means the PIC) then its outputs should be at gnd potential and so the MOSFET will be off.

I would leave the diode across the motor to suppress spikes. If you only rely on the internal diode, the spike current will have to go through the supply also.

Len
 
ljcox said:
I don't see the need for a resistor from the gate to gnd. If the "chip is off" as he said (I assume he means the PIC) then its outputs should be at gnd potential and so the MOSFET will be off.
Len
I wouldn't be that sure, most IC's have outputs in high impedance or pulled-high when they are off. And that would cause motor to spin.
 
Jay.slovak said:
I wouldn't be that sure, most IC's have outputs in high impedance or pulled-high when they are off. And that would cause motor to spin.

High impedance maybe, but pulled-high is a little bit difficult when the supply is OFF. Can you quote any examples?
 
ljcox said:
No, your diagram is correct. A P channel MOSFET would not work with a positive supply.

So the MOSFET in your diagram must be an N channel.

I don't see the need for a resistor from the gate to gnd. If the "chip is off" as he said (I assume he means the PIC) then its outputs should be at gnd potential and so the MOSFET will be off.

I would leave the diode across the motor to suppress spikes. If you only rely on the internal diode, the spike current will have to go through the supply also.

Len

I just tested my circuit. It works only when the motor is not connected, why is that???
When the motor is not connected, and I have a 5V output from the PIC, the source and drain of the MOSFET are shorted so I know that it is working. However, when the motor is connected, when the source and drain and shorted, nothing happens, the motor does not turn on.
Please help!

Oh, another little question, is there any harm done to the motor if it's continuous hooked up to the 12V supply, but the motor is not turned on?
 
Check again with a voltmeter connected across the motor.

If there is 12V and the motor isn't rotating, bad motor or motor not a DC normal brush motor but AC motor or stepper motor.

If there is no voltage, check all power connections for broken wires etc. Also check the 12V is healthy.
 
eblc1388 said:
Jay.slovak said:
I wouldn't be that sure, most IC's have outputs in high impedance or pulled-high when they are off. And that would cause motor to spin.

High impedance maybe, but pulled-high is a little bit difficult when the supply is OFF. Can you quote any examples?
What I was saying that if the IC is off (eg is in power save mode) while still powered, it's output may be pulled-up by internal or external resistor.
 
Sorry. Some sort of misunderstanding.

So you are saying most PIC's outputs would be pulled-high even they are LOW before the chip enter power save mode? Now that's worrying.
 
Status
Not open for further replies.

Latest threads

Back
Top