A whole new world - Capacitors, resisters and MOSFET's.. Need advice for 220v

I'm awaiting arrival of my first order from aliexpress. Spent hours gather information about the projects I want to implement.

Specifically one that will sense motion near the staircase and turn LED's on. My question is two fold

My LED's require 12V

1) Plug the 220V to 12V adapter into the wall, then the 12V into the mosfet IRLB8721. Use the arduino to open/close the circuit.

or

2) Connect the 220V input side of the adapter to the Arduino and so it never has power unless the circuit is closed.

Hopefully I was able to articulate the different. Case 1 is the 12V adapter plugged into the wall and always on but the 12V isn't flowing. Case 2 is the adapter isn't on unless the circuit is closed.

So my question is

1) In case #1 - Is the IRLB8721 the right one to use? I've seen others 2) In case #2, what would I use (a mosfet) if I want to control a 220v direct to mains?

Many thanks.

If you don't know what to use to switch mains 220VAC, then you're not qualified to do it. You could kill yourself, or even worse, someone else. (And definitely don't use a 30V MOSFET, or any other MOSFET, to directly switch 220VAC.) 220VAC is for electricians, 12VDC is for hobbyists.

Connect the 220V input side of the adapter to the Arduino and so it never has power unless the circuit is closed.

If the Arduino is not powered then how is it going to sense the motion ?

MOSFETs (and transistors) are DC devices... Current flows one direction so they don't work with AC.*

The simplest way to switch AC is with a relay. It can be a regular electro-mechanical relay, or a solid-state relay. Relays also provide electrical isolation between the dangerous AC voltage and the low-voltage circuit (the Arduino), and the user. Isolation is a requirement for safety!

  • It's possible to use two MOSFETs (one for each direction), but let's not get into that because not "easy" and it's not the right solution here. Plus, you'd still need some kind of electrical isolation.

There are pre-built systems which will allow your Arduino to switch 220V. They are useful for heaters, coffee pots and other devices which need that voltage. Powerswitchtail is one example that comes up here quite often.

For LEDs I recommend the MOSFET 12V solution.

OldSteve:
If you don’t know what to use to switch mains 220VAC, then you’re not qualified to do it. You could kill yourself, or even worse, someone else. (And definitely don’t use a 30V MOSFET, or any other MOSFET, to directly switch 220VAC.)
220VAC is for electricians, 12VDC is for hobbyists.

Understood and advice accepted. In fact, I was hoping there was a little adapter that I just plug my device in and be done :slight_smile:

Hopefully i'm not breaking forum etiquette by quoting a few in a reply.

UKHeliBob: If the Arduino is not powered then how is it going to sense the motion ?

The Arduino power would be seperate, atleast that's how I thought it would work. Just want to control a 220v device with a switch/relay.

DVDdoug: MOSFETs (and transistors) are DC devices... Current flows one direction so they don't work with AC.*

The simplest way to switch AC is with a relay. It can be a regular electro-mechanical relay, or a solid-state relay. Relays also provide electrical isolation between the dangerous AC voltage and the low-voltage circuit (the Arduino), and the user. Isolation is a requirement for safety!

Thank you Doug. That is indeed helpful.

MorganS: There are pre-built systems which will allow your Arduino to switch 220V. They are useful for heaters, coffee pots and other devices which need that voltage. Powerswitchtail is one example that comes up here quite often.

For LEDs I recommend the MOSFET 12V solution.

Thank you for the suggestion MorganS. Looks like a much better way than me trying to do it.

  • I wish I would have found this forum and these devices years ago. Sooo excited to get involved.

I'm looking for 220v Powertail type options and just wanted to run a few past the experts here. Noting the above advice, I will not be attempting this myself and would like to buy something already create.

Just would like to understand if these are all viable solutions to powering a 220v mains device from an Arduino.

Opti-Relay http://www.opto22.com/site/pr_details.aspx?cid=4&item=480D10-12

Wireless relay (currently looking for Arduino version) https://shop.pimoroni.com/products/pi-mote-control-starter-kit-with-2-sockets

Or something like this 220v http://www.amazon.com/Stanley-31164-Wireless-Control-Transmitter/dp/B0020ML762

I think i may just opt for an IR controlled outlet and an IR shield/module for the Arduino.

Quick and easy (Likely safer) as I couldn't find the PowerTail in a 220v ready made state.

I can get these pretty cheaply. Just considered about quality and leaving it plugged in all the time.

http://www.ebay.com/itm/AC-Power-Energy-Saving-IR-Infrared-Wireless-Remote-Control-Outlet-Switch-Socket-/361305085218?hash=item541f761522:g:jMkAAOSwBahVX~v3

Well. and then I saw this

http://www.amazon.com/gp/customer-reviews/R36GAL95RWOZ0U/ref=cm_cr_pr_viewpnt?ie=UTF8&ASIN=B002FJD1LY#R36GAL95RWOZ0U

Really not sure what to do now.

Are these safer? http://www.aliexpress.com/item/AC220V-1CH-RF-controle-remote-433mhz-RF-learning-code-2transmitter-and-12receiver-315mhz-digital-outlets-and/32376758652.html?spm=2114.01020208.3.173.prRfGv&ws_ab_test=searchweb201556_9,searchweb201644_4_10001_10002_10005_301_10006_10003_10004_62,searchweb201560_6,searchweb1451318400_6149

Well, it seems the goalposts have moved. That's quite OK because you've learned things as you've discovered new capabilities exist.

I couldn't comment on the safety of any of those. Your local electricity authority is best placed to do that. Buy something that has a local approval. It will cost a lot more than the AliExpress stuff but when the alternative is "burning down your house" then it doesn't make sense to shave off a few bucks here.

I think the end goal of supplying power to a 220v appliance is still the same but how has expanded to include multiple options that I wasn’t aware of.

I’d like to use the PowerTail but since I’d have to assemble (solder, etc) it myself, it doesn’t seem safe.

Do you possible have other suggestions. So far I have

Powertail - 220v kit is only available in a DIY
Wireless Options - Only ones I find are inferior products with bad reputations (maybe others but not sure)
SSR - ??
Sparkfun SSR Board -https://www.sparkfun.com/products/11042

Edit: Found a SSR Arduino board. Not sure if this is viable or safe? I will likely not power a washing machine or anything, just a small appliances

eeze: I'd like to use the PowerTail but since I'd have to assemble (solder, etc) it myself, it doesn't seem safe.

OK, I had overlooked that these are sold as kits and only the 120 V one appears to be available pre-assembled.

Perhaps you really need to find someone locally with the experience to assist you in assembly. The fact that once properly assembled, it neatly isolates you from the mains is still the important point.


eeze: Hopefully I'm not breaking forum etiquette by quoting a few in a reply.

On the contrary, that merely demonstrates competence. :grinning:

Have I lost the thread here? If the devices to be controlled are 12 V LED strips, then a continuously powered 12 V switchmode power supply (in a steel case!) with 12 V switching (whether relays or FETs) and a switchmode sub-regulator to drop that to 5 V for the Arduino would be the most practical approach.

eeze: Understood and advice accepted. In fact, I was hoping there was a little adapter that I just plug my device in and be done :)

this is the holy gail. we only need a few mA, and there is this huge source of power at the end of that wire....... alas, to get that, you need a lot of knowledge. as was stated, if you have to ask, you are not qualified to work with mains voltages.

Paul__B: Have I lost the thread here? If the devices to be controlled are 12 V LED strips, then a continuously powered 12 V switchmode power supply (in a steel case!) with 12 V switching (whether relays or FETs) and a switchmode sub-regulator to drop that to 5 V for the Arduino would be the most practical approach.

Hi Paul. Indeed for the LED's I would plug the power supply into the mains and it outputs 12V 40A. I could use a mosfet (I think) to open or close that circuit and allow the LED's to function.

Side note. I did get an email from Powertail and for $3.50 they would assemble the 240 UK style for me :) Very Happy and feeling safer.

http://www.powerswitchtail.com/Pages/PowerSwitchTail240vackit.aspx

However, if I did have a project whereby I wanted to power on/off a lamp or other device. I'm looking at the following 3 options. The powertail is likely the winner but I would like to understand if the SSR is an option?

1) Powertail - 220v kit is only available in a DIY 2) Wireless Options - Only ones I find are inferior products with bad reputations (maybe others but not sure) 3) SSR - ?? Maybe a dedicated or a Arduino? 4) Sparkfun SSR Board -https://www.sparkfun.com/products/11042 Some reviews say the board doesn't protect against arc/spark's and some of the solders are too close

If I may ask the question, without regard to my skills.

What would you use to turn off and on a lamp from your Arduino, given 220v and sub 500 watts?

A relay with a suitable rating.

UKHeliBob: A relay with a suitable rating.

Hi UKHeliBob,

May I ask for an example link as I've read there are many relay types. I'm a little appalled by some of the junk i've found online (fire hazzards and such)

Really at a loss for how to do this and gain some wife acceptance factor :)

I can't give a personal recommendation but this one meets the spec, as do many others. http://www.ebay.co.uk/itm/5V-2-Channel-Relay-Board-Module-for-Arduino-Raspberry-ARM-AVR-DSP-PIC-PLC-TTL-/201457617209?hash=item2ee7cf4939:g:Un4AAOSwv-NWUnsJ

It would need to be properly housed, connected to the Arduino and an output socket and wired safely, possibly with a fuse and indicator LED on the output. If you do not know how to do all of this then as has been suggested then don't do it.