How to connect arduino and relay to single mains source?

I am using an Arduino to control a mains powered fan using a temperature probe but I have one power supply for my Arduino and one for the 240v relay.

I have a small box to hold the components and would like a single power source from the mains going in, then within the box I will need something to convert the 240v mains voltage to power the Arduino.

I have tried searching online but don't really know what I'm looking for.

5V power supply?

connersz:
I am using an Arduino to control a mains powered fan using a temperature probe but I have one power supply for my Arduino and one for the 240v relay.

I have a small box to hold the components and would like a single power source from the mains going in, then within the box I will need something to convert the 240v mains voltage to power the Arduino.

I have tried searching online but don't really know what I'm looking for.

First of all, let me warn you to PLEASE be careful working with 240 volts. It can kill you quite dead, and people who make a mistake are rarely granted a second chance.

With that said, I would suggest these parts:

  • Solid state relay rated for at least 5x the max current the fan draws, 240 volt rated and with a DC control input.
  • A 240 volt to 9 volt DC wall wart (black plastic box power pack) to power the Arduino. Use a transformer type, not a switching type.

The solid state relay is reliable, silent and provides very good isolation between the 240 volt mains and the Arduino.

The wall wart provides power for the Arduino as well as good isolation from the mains.

Using a solid state relay with a DC input connected directly to an Arduino output pin will do what you need.

How it runs is, of course, up to you and the code you write.

Again, be careful with that 240!

Hi,
DISCLAIMER: Mentioning stuff from my own shop as examples!

Examples of:

Solid State Relay:

9V Power supply:

Again, Again be careful with that 240!

terryking228:
Hi,
DISCLAIMER: Mentioning stuff from my own shop as examples!

Examples of:

Solid State Relay:

9V Power supply:

Again, Again be careful with that 240!

Both of those parts are exactly what the OP needs. Myself personally though, I would prefer a transformer based wall wart to a switcher.

Hi,

Myself personally though, I would prefer a transformer based wall wart to a switcher.

These little switch-mode power supplies do have a transformer; it is running at 200 Khz or so, and is physically small. It IS the isolation between the internal line-operated primary DC supply and the low-voltage DC output. Just what the breakdown voltage between input and output is, and wether it is better or worse than the older Wall Wart transformers, I don't know.

The UL/CSA/CE test markings imply that testing was done.

Anyone have a pointer to information on this issue??

terryking228:
Hi,

Myself personally though, I would prefer a transformer based wall wart to a switcher.

These little switch-mode power supplies do have a transformer; it is running at 200 Khz or so, and is physically small. It IS the isolation between the internal line-operated primary DC supply and the low-voltage DC output. Just what the breakdown voltage between input and output is, and wether it is better or worse than the older Wall Wart transformers, I don't know.

The UL/CSA/CE test markings imply that testing was done.

Anyone have a pointer to information on this issue??

You are right... they do have a transformer which provides isolation (as well as an opto-isolator to provide isolated feedback signals to the regulator).

I still "feel" better with a good transformer... especially one with separate windings. (that is, windings not laid on top of each other, but on each side of the bobbin).

In reality, both types are probably equally as safe. Especially if they have a UL/CSA/CE certification.

Krupski:
Especially if they have a UL/CSA/CE certification.

A real one.