Controlling 12v circuit from a high or low pin

jpacman

Member
hey guys,

i want to have a 12V circuit be on or off depending on if my pin is high or low on my picaxe. I think i should be using a TTL level FET but i'm not sure on what one to get or how to set it up on my picaxe.

cheers Jordan
 

oracacle

Senior Member
how much current do you want to hold, IIRC the BC548 trasnsistor has a 30v base-emitter and base-collector but only has about 500mA collector current. it maybe also depend on what you are switching on, a light bulb or relay may need a fly back diode using a transistor but most FETs don't need them
 

oracacle

Senior Member
PWM? you maybe better of using a relay if you are switching them on and of 15A is a fair amount of juice and how you attach the FET to the 12v lines will have to be considered (perf board if rate for 500mA IIRC). I would think there is a FET that will do it, but you may not get logic level and have to design a drive circuit for a power MOSFET if you still want to go that route
 

jpacman

Member
yeah thats my problem im not sure how to do it, i want to know what the best way of doing it would be =, if i was going to use a relay how would i set that up ?
 

oracacle

Senior Member
you need to read manual 3, page 6 for relay interface.

you should go picaxe>resistor>transistor>relay with back EMF diode. the TECs will then connect to the switch side of the relay

I take you do not need PWM signal to your TECs to control there temperature. also if you are going to use 2 they will draw 15 amps each not total, total will be closer to 30A - that is a lot of current and you should be extremely careful

also read this:
http://electronicdesign.com/components/simple-design-equations-thermoelectric-coolers
running TEC isn't necessarily as simple as giving it power, it really dpends on what you want to achieve
 

jpacman

Member
ok cool i will look now and no don't I need PWM im just turning them on and off depending on my DS18B20 temp reading.

also are u able to suggest a transistor and relay for this application ?
 

oracacle

Senior Member
the manual seems to suggest BCX38C - I have not seen the data sheet on this item so can not suggest if it is suitable. What is the coil resistance of the planned relays? - once you know that you can find a transistor that has a good enough current rating. I am not a transistor expert and other help will most likely be needed
 

oracacle

Senior Member
pretty much any transistor should do the job then.
also the second relay you linked to is for a PCB mounted, not sure how you want to hook it up but you will need beefy PCB traces to hand the sort of current you are talking about.
 

jpacman

Member
ok cool, yeah thats ok iv got the sorted and it is mounting on a PCB but the closing circuit 12V will be wire only
 

Goeytex

Senior Member
Switching a relay on/off with 12V@15amps through the contacts will require a fairly robust relay. Contact arcing will likely lead to reduced contact life unless arc suppression circuitry is incorporated.

15 amps is the absolute max on this device, not the recommended operating current. To extend the life of the device I would keep the voltage below well below 15V. At 12V, I imagine the current will be around 10 amps, but you should refer to the performance curves in the datasheet as temperature is also a derating factor.

Many commercial TEC Controllers use an H-Bridge for bidirectional control (heating /cooling used for lasers). However for cooling only a synchronous buck controller could be used. In both of these cases a control signal determines the DC Voltage and thus the current through the TEC device. These circuits are not trivial and are not easily built on breadboards or home made boards.

Direct PWM via a FET is another option, but I have not seen this used commercially and have not tried it myself. If you try this I might suggest a logic level FET such as the IRLB8721 or something similar. Certainly this will be less problematic than a relay.

What is "best" depends upon the application and how accurate temperature control you need. What is the application ?
 

oracacle

Senior Member
how would you suggest to get power in and out of the FET, that's is my biggest concern, part of the reason I suggested using a relay was due to the fact that they come in non PCB mounted variants meaning that the hefty current could be routed thought automotive connectors rated for at least 30A. 30A wire isn't thin either.

In post #6 I did suggest it may not be as simple as switching it on and off. I just hope there is no injuries or death from a single mistake with the sort of current we are dealing with here
 

Circuit

Senior Member
fairly wire hopefully, you need to make sure you completely comfortable with what you are doing, the sort of current you are using is very dangerous - it can take as little as 100mA is enough to kill a human, at 30A you are 300 time more likely to be killed - well give or take

https://www.physics.ohio-state.edu/~p616/safety/fatal_current.html
I think you have got things a little confused here. Yes, the current matters but there is a threshold voltage aspect as well. Generally speaking, handling cables with 24 volts or less is considered safe. Just think; a car battery has several hundred amps available at its terminals but car batteries are generally regarded as non-lethal! Provided our enquirer is only switching 12 volts then there should be little risk at all apart from the obvious one of causing a fire by short-circuiting such a current in a non-fused circuit. I would go with Goeytex on this one and switch it with a big MOSFET. I would look at a IRLU7843PbF which has a continuous drain current of 100 amps or so at 30 volts peak. A 5 volt PICAXE should be able to fire this up to allow 15 amps through quite nicely; the datasheet specifies a very low RDS(on) at 4.5V VGS with a gate threshold of 1.4-2.3 volts.
 

Goeytex

Senior Member
You can look at wire gauge attached to the PEC to see what is needed. The large ones I have here, (salvaged from "wine coolers") look to have either 16 or 18 gauge stranded wire. As far as getting power out of the FET(s,) a small driver board with wide traces should be sufficient. Or use perf board and directly solder the wires to the FET pins. With slow on/off control, the choice of FET (and Rdson) will be the primary factors that determine if a heat sink is needed for the FET. Sticking a FET that is sourcing 30 Amps into a breadboard may result in some melted plastic or arcing in the source / Drain holes on the breadboard. I would certainly not recommend it.

However, an automotive relay might be easier to install, but at the expense of a reduced life cycle. If the temperature control is not critical then several degrees of hysteresis can be incorporated in to the code to prevent excessive cycling of the relay(s). To reduce contact wear due to arcing, a simple RC clamp can be placed across the relay contacts. A relay rated at 100,000 cycles with no arc suppression may only last a week or so (depending upon hysteresis and load).

I would use a MOSFET.
 
Last edited:

binary1248

Senior Member
That spec link you gave us has no coil rating, in other words, how much coil current or what is the coil resistance. That will determine what you need for a driver.
 

Circuit

Senior Member
That spec link you gave us has no coil rating, in other words, how much coil current or what is the coil resistance. That will determine what you need for a driver.
Eh, I think we are losing the plot here a little... The OP stated in post 3 that he wants to switch "a TEC1-12715 possibly even two and i believe these are about 15A and 12V"
Later on the subject of the relay in post 11: "...and the coil specs are 12V coil resistance 90 and rated current 133mA" but he originally stated that he wanted to switch it with a MOSFET. He has been provided with a number of options in using a MOSFET and the disadvantages of a relay have been highlighted.
 

jpacman

Member
ok so after all this discussion a FET would be the best to use, can someone give me a quick schematic of a FET set up with the picaxe pin, FET and TEC ?
 

Goeytex

Senior Member
See Attached for diagram

tec_fet.png

EDIT: Changed FET to TO-220 through-hole type for easy mounting.
 
Last edited:

Dippy

Moderator
You ought to give jpacman some advice on heatsinking.
For kitchentable-tronics it may be easier (mechanically) to choose MOSFETs with a tab with an 'ole for mounting.
I've noticed people talking about PWMing; the MOSFET could get hotter without a proper driver.
(They could get hotter with a proper driver but not as bad as direct driving).
(And there is some dubiosity about PWM and Peltier chips but I can't remember what it is, someone else can search).

Talking of heatsinks, jpacman have you considered how much heatsinking you'll need for the Peltier?
Have you done any calculations?
 

Circuit

Senior Member
See Attached for diagram
QUOTE]

Goey, I notice that you are using a 180R on the serial out from the PICAXE. I have seen some legacy diagrams showing this in place but none recently. Why do you choose to put a 180R here? I can see that it offers shorting protection, but any other reason? I can never make up my mind about putting it in or otherwise. Do you have any experience that shows it to be prudent or is it just a case of a belt, braces and a nail through the navel?
 
Last edited:

Goeytex

Senior Member
See Attached for diagram
QUOTE]

Goey, I notice that you are using a 180R on the serial out from the PICAXE. I have seen some legacy diagrams showing this in place but none recently. Why do you choose to put a 180R here? I can see that it offers shorting protection, but any other reason? I can never make up my mind about putting it in or otherwise. Do you have any experience that shows it to be prudent of is it just a case of a belt, braces and a nail through the navel?
I use it for protection of cheap USB/TTL adapters that typically have 3.3v I/O circuitry. It makes these "5V tolerant" when the Picaxe is operating at 5V. I use an AXE027 where it is not necessary, however there is no way of knowing what other folks are using. The 180R resistor adds an extra level of protection. I have used values as high as 1K with no ill effects. Consider that the serin uses 22K and still works fine.

With oddball USB/TTL adapters I also add a 10K resistor from the serout Pin to ground. This prevents a garbage character from appearing in the PE Terminal when the terminal opens the virtual serial port. I think the AXE027 includes this resistor, however a genuine FTDI adapter from another source required this resistor.
 
Last edited:

jpacman

Member
You ought to give jpacman some advice on heatsinking.
For kitchentable-tronics it may be easier (mechanically) to choose MOSFETs with a tab with an 'ole for mounting.
I've noticed people talking about PWMing; the MOSFET could get hotter without a proper driver.
(They could get hotter with a proper driver but not as bad as direct driving).
(And there is some dubiosity about PWM and Peltier chips but I can't remember what it is, someone else can search).

Talking of heatsinks, jpacman have you considered how much heatsinking you'll need for the Peltier?
Have you done any calculations?
I have done no calcaluations for heatsinks im using these for the cold side and a lga775 heatsink for the hotside(similar to a stock size cooler) do you think these will be ok ?
 

Dippy

Moderator
Re: your heatsink link; I don't know. Where does it give degrees/Watt?
Guesswork could result in damage/destruction of the Peltier element. (Or you could be dead-lucky and smug :) )


Firstly, you MUST do some first-order (aka 'ball-park') calcs to save the Peltier and save your money.
For example, how many watts (worst case) are going to be generated by Peltier when run flat out?
The physical and ambient conditions will affect the figure.

Have you read the Datasheet for TEC1-12715?
I only had a quick look at one (2 pages) and it is woefully inadequate to design from it.
You won't know some of the parameters for the hefty equation posted earlier.

So, you are into partial trial-and-error territory.

The total worst case power will be something along the lines of:-
I2R + Cooling power

If you are making a small, well insulated, fridge then you can reduce this as the teperature reduces.
If you are making a dehumidifier for a big room the this power may remain high.
Hot-side ambient temperatures will affect things.
So, it depends on the application.

Other than preventing destruction another aspect is the Delta T.
If your hot-side is 70oC then the cold-side will never get colder than HotT-DeltaT oC.
And that's at Vmax and Imax with ideal hot-side heat-sink.
It'll be worse as you PWM it and with a weedy heat sink.
If you don't use it properly the results WILL disappoint you.

In my own first experiments (ah those were the days) I used a 75W Peltier with a fan cooled 0.8oC/W Heatsink.
For prototyping I added some thermal bimetallic cut-out switches on the hot-side heat-sink... and I'm glad I did.
My first tests I drove from a bench PSU (Thurlby-Thandar with V & I limiting) to slowly ramp it up.
This also allows your knowledge to be slowly ramped up ;)
Diving in head-first can end in tears. (I'm turning into my Father).

If I drivvel on for much longer this post will be un-readable.
SO, may I strongly suggest that BEFORE you destroy your TE Device or waste money on unsuitable heatsinks go to the RS Website.
Search on 'Peltier'. [EXAMPLE]
1. Read the Design & Application Notes.
2. Read the Melcor Application Notes.
3. Read anything else - that's why the info is provided,

Once these have been read and absorbed anyone can be an expert and post sound advice ;)
Good luck.
 

jpacman

Member
Re: your heatsink link; I don't know. Where does it give degrees/Watt?
Guesswork could result in damage/destruction of the Peltier element. (Or you could be dead-lucky and smug :) )


Firstly, you MUST do some first-order (aka 'ball-park') calcs to save the Peltier and save your money.
For example, how many watts (worst case) are going to be generated by Peltier when run flat out?
The physical and ambient conditions will affect the figure.

Have you read the Datasheet for TEC1-12715?
I only had a quick look at one (2 pages) and it is woefully inadequate to design from it.
You won't know some of the parameters for the hefty equation posted earlier.

So, you are into partial trial-and-error territory.

The total worst case power will be something along the lines of:-
I2R + Cooling power

If you are making a small, well insulated, fridge then you can reduce this as the teperature reduces.
If you are making a dehumidifier for a big room the this power may remain high.
Hot-side ambient temperatures will affect things.
So, it depends on the application.

Other than preventing destruction another aspect is the Delta T.
If your hot-side is 70oC then the cold-side will never get colder than HotT-DeltaT oC.
And that's at Vmax and Imax with ideal hot-side heat-sink.
It'll be worse as you PWM it and with a weedy heat sink.
If you don't use it properly the results WILL disappoint you.

In my own first experiments (ah those were the days) I used a 75W Peltier with a fan cooled 0.8oC/W Heatsink.
For prototyping I added some thermal bimetallic cut-out switches on the hot-side heat-sink... and I'm glad I did.
My first tests I drove from a bench PSU (Thurlby-Thandar with V & I limiting) to slowly ramp it up.
This also allows your knowledge to be slowly ramped up ;)
Diving in head-first can end in tears. (I'm turning into my Father).

If I drivvel on for much longer this post will be un-readable.
SO, may I strongly suggest that BEFORE you destroy your TE Device or waste money on unsuitable heatsinks go to the RS Website.
Search on 'Peltier'. [EXAMPLE]
1. Read the Design & Application Notes.
2. Read the Melcor Application Notes.
3. Read anything else - that's why the info is provided,

Once these have been read and absorbed anyone can be an expert and post sound advice ;)
Good luck.
would this heatsink be sufficent for the FET and alot of other people i have seen are useing LGA775 heatsinks for this peltier unit and have been getting some good results.
 

Dippy

Moderator
A 10oC/Watt heatsink? (For the hot-side I assume?). No chance.

How many watts will each Peltier be chucking out if flat out 15Amps?
For starters pretend it was a resistor of 0.75 Ohms running at 15Amps.

So, how hot do you think that 10oC/W heatsink would get?
Well, the Peltier would die (90oC max) before it got far.
And that doesn't even include peltier heat transfer.
Oooh fry those eggs ;)

To get the heat transfer the hot-side heatsink musn't get too hot - basic Physics.
(Heat transfer, dissipation and deltaT)

You'll need a far bigger heatsink probably fan-cooled for efficient operation.
I can't comment on the LGA775 heatsink as I don't know the specs.

If you want it good and reliable you will have dig out your calculator and reduce guessing to a minimum :).
But I would (AGAIN) strongly suggest that you add a thermal switch to the heatsink.

I've already said the spec of the heatsink I tried - maybe you missed it. 0.8oC/W + fan.
I'm not having a pop here, but do you understand the basic heatsink specs.?

You need to dust off your calculator and get a ballpark figure for power in your application.
Just the basic stuff, no need for triple integral calculus.
 
Top