Control fish tank heater with Arduino

I want to control the temperature of the system with an arduino, so being able to always change it, not that is going to happen but it's still good to have. I am going to use multiple waterproof ds18b20 temperature sensors to measure the temperature of the fish tank.

I am going to use a fan too cool the system but I still haven't figured out what to use to heat the system.

I thought a standard heater woulf be fine but as I stated I want to be able to control the temperature of my system through an Arduino, all automatically, but to change the temperature of a heater most of them require you to change it through a switch.

So how can I fix this problem and be able to control the temperature of the heater?

but to change the temperature of a heater most of them require you to change it through a switch.

You use the switch to turn the heater on or off. Turn the switch on, connect the heater to a relay, and use the Arduino to turn the relay on and off as needed.

Is the heater powered by AC or DC?

An AC powered heater could be controlled by a relay (mechnical or solid state) like Paul says. A mechanical relay will need a driver or use a relay module with built in driver.

You can control a DC powered heater with a logic level MOSFET connected to a digital or PWM pin or a relay.

I am going to use a fan too cool the system

A fan is going to have very-little effect on a fish tank!

I am going to use a fan too cool the system but I still haven't figured out what to use to heat the system.

If you don't know what you're doing, buy an aquarium heater (or an aquarium heater element). It's not hard to make a heater with resistors or with Nichrome "heater wire", but you have to make some calculations* and it's dangerous mixing water and electricity.

Have you noticed how the heater in your house works? When the temperature falls below-target the heater turns on. When it goes above-target, it goes off. The temperature can't change instantly, so the heater simply cycles on & off.**

A "regular old" thermostat doesn't even have a "brain" so you don't need a microcontroller or software... You need a microcontroller if you want to make it programmable (different temperatures for different times of the day) and a microcontroller is one way to make a digital display.

  • Before you do any calculations you'll need to make an estimation of how much power (wattage) you need. That's a question for an aquarium expert.

** Heating & cooling systems usually have hysteresis. That means if the temperature is set to 70F, the heat comes-on below 70 (maybe 69), then it stays on 'till you are above 70 (maybe 71). Then it doesn't come-on again 'till the temperature falls to 69 again. That prevents the heater from cycling on & off several times per second.