Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Switching mains voltage from Netduino


  • Please log in to reply
2 replies to this topic

#1 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 11 September 2010 - 08:50 AM

I've just started a little home-automation project and part of it will be switching mains lighting from TTL circuitry. I thought it might be worth a general discussion over how best to do this. I'll start with what I'm doing and what I've found and I'd be happy for people to jump in if I'm doing it wrong. I'm starting my project pretty small. Phase 1 is to use a 4011 NAND gate to provide a simple RS latch (one button for on, one button for off). The Netduino and more logic/functionality will replace that but I'm mainly interested in getting the basics of switching lights in place first. I decided to make sure I can switch some lights on and off before I let myself play with fun stuff like network-enabling it and using RFID tags for security. The output of the 4011 (and in phase 2 the Netduino) need to switch mains lighting (240V here in the UK). I decided on a 12V relay to do the switching. I'm using fluorescent lighting, so thought that'd be the best way to completely isolate it. Is there a better way than using a relay? I know I need a power transistor to drive the relay coil. I found a good example circuit somewhere suing a NE555 timer to provide the power switching. I know it's primarily a timer, but apparently it's a capable power driver too and seems to do the job OK. Is it fine to directly the drive the NE555 from the Netduino? My plan is just to keep the mains voltage stuff down one end of the board. I considered using optical isolation between the ND and the rest but this seemed like overkill. I was planning to have the relay and driver circuitry running on 12V and use a 7809 voltage regulator to ensure the ND had nice clean 9V. I appreciate this is all fairly basic electronics, but advice is appreciated. A link to a basic tutorial and "read that idiot" is fine too! I'm surprised I couldn't find anything. Things I've found so far: Save yourself hassle and use a switched mode PSU. I started with a crappy 12V wall wart that was lying around. The CMOS circuitry worked fine until I added the relay. Driving the relay coil screwed with the power rail and it became unstable. A reasonably cheap switched mode PSU was all I needed.

#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 12 September 2010 - 08:11 AM

The output of the 4011 (and in phase 2 the Netduino) need to switch mains lighting (240V here in the UK). I decided on a 12V relay to do the switching. I'm using fluorescent lighting, so thought that'd be the best way to completely isolate it. Is there a better way than using a relay?

Have a look at How to drive relays with the Arduino (pdf), you can use it directly with Netduino. Notice D1 flyback diode, which protects the transistor from voltage spikes when switching inductive loads (like relay coil). In addition to relay, you can use (e.g.) power MOSFET or IGBT transistor, Solid State Relay, or a triac (used in AC light dimmers). I strongly recommend to isolate the mains voltage.

#3 muyinteresting

muyinteresting

    Member

  • Members
  • PipPip
  • 19 posts

Posted 12 September 2010 - 10:40 PM

Also, take a look at this.

http://www.glacialwa...byrobotics/?p=9

I purchased these relays, they are heftier than the ones in the article.

http://ca.mouser.com...%2bkHcsol6EpYY=

Different mounting type though. However, I just got them from Mouser today, they look suspiciously small, but after rereading that article, it looks like they are just fine.


HOWEVER. I am going to do >9000 more hours of research before I actually attach this to my lights.

If these are legit and completely safe, I'll be posting the thread "Home Automation: Relays and Environment Data for The Canadian Household" to document my lovely crazy project.

It will go from a prototyped hack solder-job to hopefully a fully PCB mounted, enclosed, wireless solution that can be dropped into any existing home. All for under $500! The most expensive part of this project will be the PCB's and the microcontrollers. The Netduino will be the proud "master controller" and heart/brain of the system!

Therefore, I will be releasing my control code in it's production worthy form to the community for use.

Anyways, take a look at that site. If you don't mind, share your experience (in detail) with me, I'm really curious to know. I'm a networking guy, not an electrician. :P




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.