5V firmware triggered output from Photon and/or Shield Shield

I know the Photon will output 4.8V from the VIN and the Shield Shield has a 5V output, but what I don’t understand is if either of these can be turned on/off with firmware… can they?

I need to trigger a relay (3V min) and need to restrict the current flow direction with a Diode so I am not sure if a 3.3V pin out will do the job due to the voltage loss from the diode, although perhaps there is a diode out there that won’t drop the voltage to less than the 3V threshold.


Hi @Brad

See the schematic at this link for a way to do this with a transistor, diode and resistor.

You can also buy relay boards for Particle or Arduino that will work great.


Thanks @bko. The text says that by pressing the button it “will put pin 2 in HIGH state, meaning 5V on pin 2.” I don’t have any direct experience with Arduino, but the Photons GPIO pins are limited to 3.3V out, aren’t they?

The relay board won’t work for me in this particular case, I’ll spare you the details. :slight_smile:

You can use a digital pin to toggle a transistor, which in turn will connect the Vin to wherever you need it. So by using the 3.3V from the Photon, you can switch 5V from the Vin to toggle your relay.
A ‘HIGH’ state is better understood as the ‘HIGHEST’ state. If you’ve only got a 3.3V board, then that will be the ‘HIGH’ voltage.


HI @Brad

The NPN transistor will “turn on” at a bit 0.7 V on the base, so you have plenty of voltage with a Photon. This is one of many way to accomplish controlling a relay, but this one is the simplest.

Thanks @Moors7 and @bko!

Now I get it, I’ll use a digital pin and a transistor to allow 5V out from the Shield Shield to flow to and activate the relay.

If you’re using the shield shield, then that’s already outputting 5V, according to the docs:https://docs.particle.io/datasheets/photon-shields/#shield-shield-operation

At this point I’m a bit confused as to what you’re actually trying to do. You say that you want to drive relay made for 3V. They should normally ‘just work’ with 3.3V if I’m not mistaken. Why exactly would you need the diode?

Yes, but it is a constant 5V, correct? In other words it’s not able to be turned on/off with firmware, or is it?

That makes two of us. :wink: The existing relay I am trying to drive has a trigger voltage of 3-32VDC (24-320VAC on the other side). It is currently being triggered by a separate 5V switched circuit and I want to run a circuit from the Photon and Shield Shied which will also activate that relay. The diodes were there to keep current from the existing circuit from flowing back to the Photon. Basically I want to have two different circuits driving the same relay.

I am very new to all of this so perhaps their is a better way.

@Brad, any chance you can draw a schematic or give us more information on the relay/device you want to control? The circuit that drives the existing relay may not be protected with a diode like the one you added. Also, NO pin on the shield shield will supply enough current to drive a relay directly and thus the suggestion for a transistor. We need more information! :wink:


@peekay123 is right! We need more information. In particular the quoted “trigger voltage” above is surely for a solid-state relay or SSR which Photon could driver directly from an I/O pin with no other logic.

Here’s is my feeble attempt at a diagram. I may headed in the completely wrong direction with this, so feel free to shoot as many holes in my idea as you can.

The 5V circuit on the left exists today and will remain, although I can make slight modifications to it. For the sake of brevity I won’t go into all the reasons it’s there, so any proposed solutions need to assume it will remain in place. I am simply trying to activate the same relay from the Photon/Shield-Shield.

I realize that the pin on the Photon provide enough current by themselves to close the relay, but I also understand there is a voltage drop with the diode in place which many drop that voltage to less than the threshold. This is the reason I was looking to use the 5V output from he Shield Shield, but only if it could be switched with my code (firmware).

Shoot away!