I’m making a smart outlet project for my science class. I’m kind of stuck so if anyone can give me guidance on how to wire everything together it’d be much appreciated!!
@Nathanpro, since you will be working with LIVE AC, I suggest you first get someone qualified to do the high-voltage portion of your wiring. You will absolutely want to get a plastic box for the outlet to prevent risks. Since the relays will switch this high voltage, it will need to be protected as well.
Once you have this setup, all you should have between the high-voltage parts and the Photon are the low voltage control wires for the relay board. Can you provide a link to where you purchased the relay breakout so we can get the pin out?
Essentially, you will be using one or two digital pins on the Photon to control the relay. If I am correct, that relay breakout has opto-isolated inputs so connecting to the Photon will be very simple.
Ok awesome! I have a plastic box for the whole contraption as well. http://www.amazon.com/gp/product/B00E0NTPP4/ref=oh_details_o04_s00_i00?ie=UTF8&psc=1
This is the link for the relay board!
@Nathanpro, that relay board seems to have opto-isolation for each channel. You will need to connect Vin from the Photon to Vcc on the board, assuming you are powering things via USB. Roughly, assuming you are using pins D2 and D3 to control the relays:
Relay Board Photon Vcc Vin GND GND IN1 D2 IN2 D3 ``` Note that the relay logic may be reversed so that writing a HIGH to the digital pin may turn the relay OFF and a LOW will turn it ON. I cannot stress enough the need to have someone who is qualified in electrical wiring look over your work BEFORE you apply an AC power :smile:
Awesome! Thank you so much for your help!!!
@Nathanpro, I hate to say it but you should get someone who is qualified in soldering and connecting things. The soldered wires have too much bare wire exposed and the foam the Photon sits in is conductive and should be removed. You should put the photon in a breadboard and connect the wires that way. At this point, I REALLY hesitate giving you guidance on how to connect incredibly dangerous live AC power with what I see so far.
I am sorry, but I cannot guide you any further and you MUST NOT PROCEED until you get someone qualified to work with you. What you have made could potentially seriously harm you or even kill you.