Running Photon using Mains power through a relay

Hi, I am creating an internet switch for a light bulb (for a wall light) and I am running a mains power cable to a relay then through the photon to power the bulb. However, I need the photon to run without its USB connection.
How can I wire this in to my mains power cable? Can I power it through the VIN pin?
I am using a Particle Photon and a SRD-05VDC-SL-C relay.
Thank you!

You switch an independent circuit for your lamp with the Relay.
The photon is connected to the side with the 5V.
I recommend the photos from this project for guidance and more in detail in this project.

You need 5v for VIN (and i’m assuming powering the relay board you are using. You need a power suply that will turn 120v AC to 5v DC, or you could make something yourself something like a transformer to step down the AC voltage, then a bridge rectifier to convert from AC to DC then a linear power regulartor to step down to 5v dc (there are other components in the circuit obviously) this is a bad idea if you don’t know what you are doing.
If you want to power your photon you will need a power supply something like this maybe https://www.jameco.com/z/IRM-05-5-MEAN-WELL-AC-to-DC-Power-Supply-Encapsulated-Type-5-Volts-1-Amps-5-Watts_2193133.html.

Hi, I am creating an internet switch for a light bulb (for a wall light) and I am running a mains power cable to a relay then through the photon to power the bulb. However, I need the photon to run without its USB connection.
How can I wire this in to my mains power cable? Can I power it through the VIN pin?
I am using a Particle Photon and a SRD-05VDC-SL-C relay.
Thank you!

You need something like this to convert the AC mains to 5V DC that will go into Vin.

https://www.mouser.sg/ProductDetail/RECOM-Power/RAC05-05SK/?qs=sGAEpiMZZMuWiaalG5TUgGqTPUILE6OSkXGkAo4SmaW3R9LaMWKv4g%3D%3D

NOTE: This is high voltage AC that can kill. Do find someone competent to carry out the wiring.

@alexhillary please also refrain from double posting. Thanks!

1 Like