controlling ac devices with arduino.

Discussion in 'Embedded Systems and Microcontrollers' started by gerases, Feb 7, 2013.

  1. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    I would like to control AC devices with a microcontroller. I found this nice tutorial on how to build a relay based controller. It would work great, but I was wondering, can I replace the relay with something non-mechanical such as a transistor or maybe a solid state relay?

    Can a transistor be used in such an application and if so, what is the model number of one that could handle 120V and the current of, say, a 60W incandescent bulb, a hair dryer, etc?
     
    hossamzayed likes this.
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    use a mechanical relay or solid state.
    There are numerous "relay shields" for the arduino that a simple digital pin drives an optocoupler which drives the relay.
    mdfly 4 channel relay shield is one I've used before. It works perfect.

    That sparkfun single relay board is just fine too. It uses a transistor to drive the relay.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
  4. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Problem is I might want to switch rapidly. Need something fast.
     
    hossamzayed likes this.
  5. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    You will need to have a better definition of "fast". Are you talking micorseconds, milliseconds or seconds.
     
    hossamzayed likes this.
  6. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Let's say light bulbs switched on/off to music.
     
  7. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    In the datasheet for this one, pin 1 is Load A and pin 2 is Load B. How does it all work exactly? I switch it on through pin 3 and 4 with the microcontroller, but how do I connect the GFCI in the tutorial using pins 1 and 2?

    So I would connect a
     
  8. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Thats not fast :D in the electronic world.
     
  9. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    point taken :)
     
  10. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    Use Google and look up "Color Light Organ" to see a lot of possibilities.

    My advice would be to be sure to use an isolation transformer on your incoming power.

    Near the bottom of this page, you may see something you could use......

    http://www.loneoceans.com/labs/arduinolights/

    Google found it!
     
    Last edited: Feb 7, 2013
  11. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    I know about color organs, but I want to do something simple with wall AC. Switch a lamp on/off, a hair dryer, etc.
     
  12. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    :confused:So you are going to play music through your hair dryer???
     
  13. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Sweet! Thanks!
     
  14. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    If you get a SSR, it should do anything you want. BTY, where did the music come in?
     
  15. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348

    Pins 1 and 2 would act like the two contacts on a normally open switch. With no signal on 3 and 4, it would be an open. Put the proper signal on 3 and 4 and 1 and 2 would conduct AC current. What tutorial???
     
  16. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    What do you mean?
     
  17. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    There.....
     
  18. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Here's the tutorial (it's in my original post): http://www.sparkfun.com/tutorials/119

    As you can see in it, the black wire is switched. But how do you switch both AC wires? I know it's basic. Just have fun with it :)
     
  19. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    I was just saying that I'm not quite sure what I'm going to do with it. I just want to have an outlet controlled by an arduino. For any home appliance basically. Light bulbs included :)
     
  20. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    Since you don't post where in the world you live, I can't really give any further advice. If you live in the US, only the HOT wire would be switched and the neutral would stay connected to the input of the GFI. You will be switching the HOT section of the GFI ON/Off instead of switching a light ON/OFF.

    Don't get hung up on the Solid State Relay vs a regualr coil/contact relay. Even though the insides are different, to the outside world, they are the same.
     
Loading...