As we know that many devices get burnt due to wrong connection, over supply.
What would you recommend if someone wants to control an AC device from a microcontroller?
As we know that many devices get burnt due to wrong connection, over supply.
What would you recommend if someone wants to control an AC device from a microcontroller?
I would recommend that no one who has not been properly schooled(*) in mains level engineering goes anywhere near it!
(*) that includes things like doing a CPR resuscitation course etc.
[one of the best protections against over supply is don't use connectors into which high power sources could be connected!]
I would recommend that no one who has not been properly schooled(*) in mains level engineering goes anywhere near it!
Absolutely!
How about you give us an overview of your project so we can provide some suggestions?
The easiest way to control the ON/OFF of an AC load with a microcontroller is to use a RELAY. Do a search of the General Electronics forum for circuit schematics.
Jim
What would you recommend if someone wants to control an AC device from a microcontroller?
Employ someone who knows what they are doing and who understand the various worldwide safety standards. Someone who understands what 'clearance' and 'creepage' are and how they are affected by 'pollution degrees'.
Just Say NO!
Hire someone with the knowledge and experience with AC mains power!!!!!!!!!!
It's not a DYI project!
Jim
Just Say NO!
Hire someone with the knowledge and experience with AC mains power!!!!!!!!!!
It's not a DYI project!
Jim
Then again, how does one learn?
But I do agree with you and Brian's post that if you have no idea, nor do you feel comfortable working with Mains level power, then by all means do not try to 'figure it out'
Jim
So, Here is what I have been working on the past two weeks This is a whole house lighting dimmer panel. Each one of those black boxes is fed with two 120V/20A breaker feeds. Most of those black boxes are 8 channel dimmer modules, and there are a couple of 4 channel relay modules. All controlled by the little gray box at the very bottom of teh enclosure. The user interface are special keypads throughout the house, an iPHONE, and an iPAD, and I have remote control of teh system from my offices a 2 hour drive each way away.
Customer had a bathroom water pipe above the panel give way which soaked everything. I did not do the initial install, and an emergency call electrician came in and got teh house lights back that night. Then the home owner called me and asked if I could repair the damage. THeres about 16 20A feeds going into that cabinet so do teh math on teh total power. I have been working with these systems for over 25 years so yes, I am qualified to work on those modules. I do not recommend anyone who has no idea how these things work to DIY.
The picture below was a stage 1 of N stages. Theres a lot left to do to get it right
Yeah, I did write:
Then again, how does one learn?
But theres a right way and a wrong way.

Then again, how does one learn?
(having said that, when 17, I went on a 2 day course to London University to experience "beginners electronics" for pre-university students. In a practical session I blew up the front end of one of heir scopes by some kind of grounding issue - it's probably what put me off the electronics side of things for life!)
The easiest way to control the ON/OFF of an AC load with a microcontroller is to use a RELAY.
I can control AC load with microcontroller and I understand connection between relay and AC Main power
Then again, how does one learn?
I got my training from an engineering school! ![]()
but the basics were learned in the two years of HS electronics before that....
On my iPad, I have a free audio book player, one of my fav books is "The story of Electricity by John Munro" in it are all the familiar names, discoveries, and history of the thing...
again it's free, several hours long, and worth the time to listen if you need some entertainment say while waiting or traveling..... enjoy.
Jim
I can control AC load with microcontroller and I understand connection between relay and AC Main power
If you want to plug a cord into the wall & turn on/off your desk lamp, that's prob ok IF:
You fully, tape/insulate ALL points of contact with line voltage...meaning the relay may look like a ball of electrical tape, with your only access to the coil pins.
Stay away from any panel wiring or anything of that sort, you might trip and it would be your last trip anywhere.

jgmdesign wrote:The easiest way to control the ON/OFF of an AC load with a microcontroller is to use a RELAY.
I can control AC load with microcontroller and I understand connection between relay and AC Main power
So what exactly is your question?
So what exactly is your question?
In which in post #3 a request for an overview was also made.
Jim
P.S.
Just Say NO!
Hire someone with the knowledge and experience with AC mains power!!!!!!!!!!
It's not a DYI project!
Jim
This got me thinking about my 'schooling'. I got teh electrical/electronic 'Bug' at age 7 or 8...maybe even younger. Having parents that understood nothing about anything electrical, and who ignored me my entire childhood(which they openly admit), as long as I was quiet, they never bothered me while I tinkered around in teh basement. I became 'knowledgeable' enough to move from 9 volt batteries and such, to line voltage at around 12 years of age. I vividly remember shorting out a set of christmas tree lights and the giant spark scared teh crap out of me! Of course teh breaker tripped, and after my father laughed at me for an hour, he reset the breaker and went back to watching TV. He was pissed off at me more for interrupting his TV show. After that, I was a lot more careful when I was doing my experiments on main line voltages. Sure, I got my fair share of mild shocks when I did something wrong, but pain is a good teacher too.
My 'formal' teaching began in high school electrical shop class and everything moved on from there. The formal stuff filled in the blanks that my self taught could not in spite of my reading every book I could find on electricity in my local libraries.
So, with that written, I certainly understand both sides of teh debate. My stance has not really changed. If you are not comfortable with working on it, then do not, and get someone who is.
What would you recommend if someone wants to control an AC device from a microcontroller?
It is time that you explain: how many AC amps you like 'control', is it just on/off or something more.
Like Jim, I've been shocked a few times...
Darwin Principle at work, but I'm still here and kicking!
Two photos of projects where a micro controlled a relay to control a Main's powered device are shown below.
I'm certainly NOT an expert at this, but it might give you a few ideas as to what is involved.
Both have commercial 120VAC to 5V DC power supply modules incorporated within the project.
Both have an ATTiny running the show.
Both have a fuse on the Mains.
Both are in plastic cases.
In both cases, the micro is well away from the Mains.
JC




In a practical session I blew up the front end of one of heir scopes by some kind of grounding issue - it's probably what put me off the electronics side of things for life!
I think that grounding issue is very well explained here - https://www.youtube.com/watch?v=xaELqAo4kkQ
(*) that includes things like doing a CPR resuscitation course etc.
AVR-IO (Olimex)
...
- 4 relay outputs with 5A/250VAC contacts with screw terminals
...
...
I think that grounding issue is very well explained here - https://www.youtube.com/watch?v=xaELqAo4kkQ
The probe gnd lead can supply gnd to make a circuit suddenly work, of course in a very bad way (nothing like a gnd loop in your measurement).
This can be even worse if your clip makes the ungrounded circuit find gnd through a non-normal path, like an AVR chip, or something that isn't normally gnd at all.
Power supplies can have this issue (the neg terminal might be connected to gnd) Some Laptop power bricks also have the neg terminal connected to gnd (though not all bricks use a 3-pin cord plug)

... but a bad master. This old wisdom is also applicable to 110/220V AC which, you can not see, but feel. Better not.
The easiest way to control the ON/OFF of an AC load with a microcontroller is to use a RELAY. Do a search of the General Electronics forum for circuit schematics.
The easiest way to control the ON/OFF of an AC load with a microcontroller is to use a RELAY.
With all the consequences. Means, such construction does require 24x7 a source of 12V.
I have a night-light which is controlled by 433M on/off remote box. There is one relay clicking inside. Normally, this 12V is obtained by a 220V AC cap plus some components, and the relay is rather tiny, suitable for few Wats of my night-light. For more wats, a transformer is required, but OP is not answering this question.

...but OP is not answering this question.
Maybe I'm being unkind but I sometimes wonder if this sort of question, in particular by this OP, is ending up as source material for a blog or similar.
if this sort of question, in particular by this OP, is ending up as source material for a blog or similar.
Oh boy, the people who would have to read it! maybe you meant slog.. full of hard-hitting, cutting-edge confusion
Ok, folks,
There are now 25 posts to this thread, and the OP has not been heard from since post #9.
How about we stop re-inventing the wheel until we hear back from our fearless thread creator?
Then again, knowing this crowd....highly unlikely.
Jim
EDIT: And if you search the OP, they seem to have a habit of starting threads, and then suddenly disappearing.
Then again, knowing this crowd....highly unlikely.
You know us too well! ![]()