Relay Shield Modification

I plan on taking the existing relay shield and converting it to have 16 relays instead of 4.

The relays use 16-20 ma each from what I read. If I use a 1.5 amp 5v power supply, this should be sufficient to power all the relays correct?

Thanks for any input!

The 20mA per pin max. are considered for single pins. If you intend to run all pins high at the same time the current per pin can (will) drop to 8mA per pin :confused:
You will have to use transistors to switch the relays.

See this thread

1 Like

The power supply isn’t the limiting factor, as much as the on-board regulator is. It can provide 500mA, of which 300mA can be used by the Core during heavy wifi activity. This leaves you with 200mA, and that’s pushing it already. 16*16=256mA, which is more than the remaining 200mA in the best case scenario.
With @ScruffR’s addition, you’d have to look for relay that require less current, or figure out a way to boost your current externally (transistor?).

1 Like

@Carsten4207, were you expecting to use all GPIO pins on the Core to drive the relays or us an I/O expander? As both @Moors7 and @ScruffR pointed out, you will need to consider driving the relays via transistors and I am assuming you will use flyback diodes accross the relay coils. Also, good power-supply decoupling will be vital. :wink:

Have you considered a pre-built unit like this one:

What is good on this board is the opto-isolation, the onboard regulator and high-current drivers.

1 Like

I plan on using an MCP23017 for the relays. And yes use a transistor. Basically like the Particle Relay Shield.

I actually purchased that relay sheild from Amazon but I want one board with everything on it. Personal preference.

@Carsten4207 sounds cool! The TI ULN2803A is an octal darlingon driver with a built-in clamp diode for inductive loads :smile:

If I power the relays via external power supply and use a transistor I should be fine right? Obviously adding a diode for the relay.

I am not at home, but once I get back I will post the schematics of what I was thinking.


So here is what I was planning on doing (basically a copy of the relay shield):

Basically the +5v is supplied by an external power supply and it will also feed into the VIN of the Core/Photon. Before the R4 resistor is where the IO goes to the Core/Photon.

So since I am using a transistor to switch the relays, I shouldn’t run into any power issues as far as hitting the 8 ma per pin correct?

I appreciate all the help guys. I am still in the early phases of learning electronics.


@Carsten4207, looks good to me!

1 Like

Are you going to sell these once you have them designed?

I can build you one if you need. But more than likely I will open source.


The part you suggested is listed as a 5V Relay module…I thought the Photon was 3V3 (or is it Ok because most pins are 5V tolerant pins?). I am totally new to electronics so please excuse my ignorance :slight_smile:

I am planning on getting one of these 5V modules with 8 channels to be able to control 8 x 250V/10A fans on a silo.

@hdemeillon, the relay module I had suggested AND the one you are proposing use opto-isolators to separate the power requirements between the relay board and the driving processor. The relays DO require 5V to drive their coils and so you will need to supply that separately to the board with enough current to drive all the relays. However, each channel’s opto-isolator means your are driving an LED via a GPIO pin on processor (Photon), reducing the current requirements and isolating the relay coil driving voltage/current requirements from those of the LED/Login input from the Photon.

The board you linked to only requires 5ma drive on the opto-isolator to activate the relay. Make sure the 5V supply to provide to the DC+ of the relay board can handle the all-relays-on total current. I suggest using a 1A supply. Also, if you power the Photon from the same supply via Vin, make sure you add decoupling capacitors between the Vin and GND rails of the Photon to reduce power supply noise when the relays switch. I suggest a 100uF electrolytic and a 0.1uF ceramic as a good start. Make sure to keep your wiring between the Photon and the relay board short and I HIGHLY recommend using a breaker panel for your power management. Even better, get a qualified electrician for the AC parts!


1 Like

@peekay123 thanks so much for your help. I will do some more research and ask here if I have further questions.