PDA

View Full Version : 120v control



james
- 16th October 2007, 02:58
I'd like to build a circuit where I can control 120v AC, basic on/off switch. I would also like to be able to control 12v DC with the same PIC chip. I an fairly new with programming but feel I can acomplish the programming necessary for this task. The hardware part I am very unfamiliar with, besides the basic voltage circuit, for pic. . along with connecting led's and basic push switches.

I found this relay that seems like I could connect it straight to the pic chip and attach terminal strips to the other side of the coil.

https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=175214

I would greatly appreciate if anyone could give me some advice with the hardware side of this project. If anything, the relays and how to go about connecting them to the pic. Thanks for any feedback.

James

james
- 25th October 2007, 12:31
thanks, the info you've provided is greatly appreciated.

Does this look like the hardware necessary for connecting an IC to a relay? or is there potentional for failure here?

ronsimpson
- 25th October 2007, 17:51
Try this.
12 V relay coil?

owali
- 1st March 2008, 02:16
I want to try and automate my new home for fun. I would also like to learn how to control 120v appliances with a PIC. I would like connect some sort of sensor (maybe pressure) to the PIC to help control the appliance automatically.

Besides the sensor, PBP, PIC chip, what special hardware would I need for this? Does anyone have some sample code about this sort of thing?

Thanks

Charles Linquis
- 1st March 2008, 04:56
Use a solid-state relay. OMRON and others make them and they can be driven directly from a PIC pin.

b1arrk5
- 1st March 2008, 23:37
I've used the X-10 example in the PicBasic Pro manual along with a TW-253 interface to control lights, and turn the Christmas tree on and off. The modules are inexpensive, I got mine from Radio Shack. For driving relays I usually use the ULN2803, a darlington driver chip that will drive up to eight relays, (but not all eight at once,) I also like the Omron relays.

Jerry.

malc-c
- 2nd March 2008, 10:48
Use a solid-state relay. OMRON and others make them and they can be driven directly from a PIC pin.

I agree - simple to interface, and quiet in operation - I used 8 in a "disco light controller" to switch 240 vac spot lamps. They can be expensive, but if you're lucky, e-bay can result in a cheap purchase

EDIT:

Just searched e-bay - 240v 4 amp SSR - pack of 4 for a buy now price of £5.99 plus £2.50 PPH
http://cgi.ebay.co.uk/solid-state-relays-3-32v-4a-240v-contacts_W0QQitemZ270215390433QQihZ017QQcategoryZ3 6328QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

CocaColaKid
- 5th March 2008, 14:36
The only problem with SSR is you need an appropriately sized heatsink whereas a standard relay does not. However you can't drive a power relay directly from a PIC. Either way has it's advantages and disadvantages. Also you can get SSR zero-cross switching built into them. This is really nice for switching inductive loads like motors.

ruijc
- 5th March 2008, 16:04
Dont want to steal the thead, but,

i have one 5v relay ( EDR201A0500 ) and it can switch up to 250VDC.

My question is, with this relay can i connect the pic directly to the relay ( no transistor required ) ?


Edit:
http://www.ece.com.tw/product/relay/edr/edr.htm

It does say "The high sensitivity allows direct driving by TTL", so it means i do not need the transistor. And this is a cheap relay (2.5 euros )
.

CocaColaKid
- 5th March 2008, 16:12
I personally switch all relays with a transistor. Even the little zero-cross SSR we use require 20mA to work properly.

Archangel
- 5th March 2008, 16:44
Hi ruijc,
I=E/R so I=5volts /500 ohm coil so I=.01amp or 10 ma. Unless my calculator lied it should work, make sure to install a diode to protect the port from back EMF.

krohtech
- 5th March 2008, 18:40
For driving relays I use an NPN darlington array DIP. Drive 8 relays for $.72 and has the diode built in to protect the pic from inductive spikes. If you are going to do home automation you will probable need many channels and these work very well.

see: ULN2803APG
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=ULN2803APG-ND

OOPS I see Jerry already recommended a darlington driver, let me change my answer to "I agree with Jerry on the driver chip"