What precautions should be taken to control a AC device from micro controller

Go To Last Post
26 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
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

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

muke12 wrote:

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'.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just Say NO!

Hire someone with the knowledge and experience with AC mains power!!!!!!!!!!

It's not a DYI project! 

 

Jim

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

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

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

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:

jgmdesign wrote:
Then again, how does one learn?

 

But theres a right way and a wrong way.

 

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:
Then again, how does one learn?
Most cities have a university. I'm sure the electronics departments will have professors that are all too eager to teach beginners in the art and specifically about the precautions they should take.

 

(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!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:
Then again, how does one learn?

I got my training from an engineering school!  smiley

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

 

 

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



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.

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

muke12 wrote:

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? 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
So what exactly is your question? 

 

In which in post #3 a request for an overview was also made.

 

Jim

 

P.S.

 

ki0bk wrote:

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.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

muke12 wrote:
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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

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

 

 

 

 

 

 

 

 

Last Edited: Wed. Apr 6, 2022 - 11:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
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

 

 

“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?” - Brian W. Kernighan
“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint-Exupery

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
(*) that includes things like doing a CPR resuscitation course etc.
Here, the portable defibrillator is becoming more prevalent, are effective iff maintained, and are newbie friendly (IIRC); successes are recounted in the newspapers.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVR-IO (Olimex)

...

  • 4 relay outputs with 5A/250VAC contacts with screw terminals

...

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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)

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

... but a bad master. This old wisdom is also applicable to 110/220V AC which, you can not see, but feel. Better not.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:
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.
Some of Experimenters used SCR and opto-isolator.

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


jgmdesign wrote:
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.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

grohote wrote:

...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.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sat. Apr 9, 2022 - 04:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Last Edited: Sat. Apr 9, 2022 - 09:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:

 

 

Then again, knowing this crowd....highly unlikely.

 

 

You know us too well!

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut.