Using Relay with Photon for controlling Lamp

Hi,

I need to control a standard lamp using Photon.
I have the code, I dont know much about H/W so I’m following this tutorial to wire up the Relay:

I’m using this Relay.

However, the tutorial is for Arduino Uno.
How do I give the 5V to Relay’s VCC? Do I use Photon’s VIN?
Should I use Shield Shield? How should I use Shield Shield?

There are some threads about relays on this forum already dealing with your questions.
Have a search for relay 5V, you’ll be surprised :wink:

@dushyantbangal, you CAN power the relays with Photon’s VIN and GND pins assuming you have a good quality USB power supply (1 Amp ideally). Since the relay board uses opto-isolators, you can connect the IN1/IN2 lines directly to Photon Dx pins. :smile:

1 Like

Just so it’s been said: mains can and will kill you, please be careful. If you’re uncertain about something, don’t take the risk, it’s not worth it. If in doubt, contact a professional electrician.

2 Likes

Ohh I do plan to stay faar away when i switch it on :smiley:

here’s a simple and relatively safe way:

@dushyantbangal, here is an even SAFER way to do it:

http://www.powerswitchtail.com/Pages/default.aspx

:wink:

It works! My main doubt was about the VIN => VCC of 5V, which was solved

Btw, I used an adapter with output of 5V and 2.0A
Thank you everyone :smile:

:frowning: this link no longer works

The main page is often a good idea: http://www.powerswitchtail.com

2 Likes