Controlling Heating Cartridges with Arduino Uno

Hello everyone.

I'd like to run and control three heating cartridges (12V, 40W) with an Arduino Uno. I'm totally new to this and would like to ask you how I could do it. I've read some threads but didn't really find a straight forward solution. I would appreciate it if you could give me some advice :slight_smile:

Kind regards

I would recommend something simple like a relay or a MOSFET. Nothing complex.
Just have them powered externally and control the MOSFET/Relay with the Arduino. Connect the grounds of both circuits.

Then first tell us what you are CONTROLLING? Heat or current? Can we guess the 12 v is DC? You can change the current for DC by using a MOSFET driven by an Arduino pin.

Just some "big picture" comments -

The Arduino doesn't put-out enough current to directly-drive a relay coil but there are lots of "relay boards" that have a driver circuit, and you can find boards with multiple relays.

There are solid state relays that can be driven directly from the Arduino. (But assuming you are switching DC, make sure to get one made for DC. AC & DC solid state relays are not interchangeable.)

A MOSFET driver (for DC only) isn't too hard to build but a relay is easier.

Assuming you want to maintain a target temperature, of course you'll need to measure temperature.

There are analog & digital solid-state temperature sensors. The analog sensors are easier because they just wire into the Arduino's analog input and the reading is proportional to temperature.

Since temperature can't change instantly, virtually all heating & cooling systems cycle on & off (rather than controlling the power like a light dimmer).

So that's pretty easy... Turn-on the heat when you're below target temperature and turn-off when you are above it. The programming is super-easy and many thermostats don't have any kind of programmable microcontroller.

But in reality there is usually some hysteresis or "swing"... The heat is turned-on when you are 1 degree (or 1/10 of degree, etc.) below target and then it stays-on until you are 1 degree over target. That keeps it from turning on & off hundreds or thousands of times per second and it keeps a regular relay from "chattering".

If you need a temperature display (if the temperature is adjustable you usually want a display) that's actually more complicated than the actual temperature control.

As always - Work on your input (temperature reading) and output (relay switching) separately before attempting to put everything together. And if there is a temperature control knob or buttons (input) or a display (output) work on those separately too.

It also helps to "develop" your code a little at a time. If you're a beginner that often means one or two lines of code at a time. But that takes some skill too... You can't just start at the top and write the first-few lines because the complier needs to see a "complete program".

1 Like

Hello confused_student
Post your current sketch, well formated, with comments and in so called code tags "</>" and a schematic, not a Fritzy diagram, to see how we can help.
Have a nice day and enjoy coding in C++.
Дайте миру шанс

A logic level MOSFET should work:
MosHeater
https://www.infineon.com/dgdl/irlz44npbf.pdf?fileId=5546d462533600a40153567217c32725

Thank you for the reply! I will dig into that :slight_smile:

Yes, it's 12V DC. There will be a target temperature I need to controll. Thanks for the input!

Thank you for your answer, I really appreciate it. I've already started looking into ways for measuring the temperature and think, that using a thermistor is the best and easiest solution :slight_smile: Thank you also for explaining how everything works, that makes it much easier to understand. I have experience with C++ coding, my area of concern lies more on the hardware I need to purchase and the wiring. I will look into your tips and hope that everything works out :slight_smile:

Hello. I'm afraid I can't provide that yet since I'm not even close to being there. I will come back to your offer once I came up with schematics and code :slight_smile:

Thanks! I will look into that :slight_smile:

I suspected that. What range of temperatures? Will you ever change the set value?

Hello confused_student
To see how we can help post a block diagram and a list of physical charateristics of the system simply.
Have a nice day and enjoy coding in C++.
Дайте миру шанс!

200°C - 250°C. I usually don't change the temperature during operation.

Hello @paulpaulson
This would be a rough and simple block diagram of my system. I hope this is what you meant, because so far I have nothing more precise... The idea is to control the temperature of a heated part (obviously heated with the heating cartridges) and hold it at a certain value. I've already found a way to measure the temperature with a thermistor. I would like the Uno to basically "tell" the "Heating/Power Adjustment-Unit" what it has to do depending on the input of the temperature sensor. Please excuse the term "Heating/Power Adjustment-Unit", to me it's basically a black box. That would be exactly the part of the system I am wondering about :slight_smile:

Power Supply: 12V DC, 10A or 30A (haven't bought yet)
Heating Cartridges: 12V DC, 40W (used in 3D printer hotend), I am using three of them
Thermistor: 100 kOhm NTC3950 thermistor (also used in 3D printer hotend)
The temperature I want to hold lies between 200°C and 250°C, depending on the application (I need to melt plastic, so the temperature depends on the specific plastic).

So far this is all I can provide. I've also read things about PWM, maybe you could comment on that if this would be a feasible solution. I would really appreciate it if you could give me some tipps or provide a sketch/diagram of some sort, if time allows. I don't want to be too demanding, it just helps me a lot :slight_smile: I am looking forward to your answer!

Annotation: I am looking for the easiest solution

Kind regards

PWM for heating is useful ONLY when the device can respond quickly to power changes. You have the heat cartridges, how quickly do they respond to power changes? IF they only respond slowly, then a relay might be easier to implement.

With only a few MOSFETs and thermistors to run, you could power the Arduino with 12V through its Vin pin. If course, if you already have 5V easily available, it's best to use that, but if not, 12V power should be ok here because you have only a handful of low power components that will need a 5V supply.

If you have no other use for the Uno, then go ahead and use that. If you could use the Uno for some other project, perhaps involving a shield (what Uno is made for) then save it and use Nano/Pro Mini for this project. More compact, generally cheaper and far more practical for building circuits with than Uno.

They indeed have DC-DC solid state relays which are basically an an opto isolated packaged MOSFET. Your Google search terms will be "SSR DC-DC 25A" and you should find something which will be very easy to use.

Start with bang bang control. Turn the heating elements on when it's too cool and turn them off when it's too hot. Bit of hysteresis of course.

Depending on how accurate the temperature control needs to be, you may want to heat to temp with all three and just use one for holding it just so when you get there.

If you really want to be fancy, you can use PID, but I certainly wouldn't bother with it until you need to.

Thanks for the reply! I found the part you recommended. Can I directly connected the solid state relays to the arduino or are there further parts required?