Paid - Relay Expander Control Code for 64 Fake Candles

I am looking for someone to help me program a code. I am using an IO Expander and 4 Relay Expanders on 4 x16 relay boards (this setup: Control 64 Relays).

I am trying to use this to control the individual on/off function of 64 LEDs independently and randomly. I would like the sequence to start with a predefined number of LEDs on, and turn more on/off randomly at random times. As a bonus I would like the LEDs to "flutter" or slightly strobe when they turn on or off. I would like the entire sequence to be random, so it is different every time it is powered on, and not a predefined sequence that is always the same.
This is going to be used for a ghost candle effect on an old church prayer candle stand as part of my Halloween display.

I am open to compensation, but not sure the complexity/going rate for something like this.

Thank you!


What kind of LEDs do you want to control with those relays ? Relays are normally used to control powerful things like motors. Mechanical relays, like yours, are slow at switching on/off, so it will not make a nice candle effect...

There are chips specially designated to drive LEDs, for example the TLC5940 can drive 16 LEDs with individual PWM control so you can make a realistic candle effect with it, and you can use multiple of those chips and chain them together to drive your 64 LEDs or more.

Edit: Look here where they use several PCA9685 chips to control 240 fake candles :

The LEDs I’m using have the flicker effect built in. The relays are just to control the on/off, and not the flame effect of a candle. The drivers you mentioned about might work. I’ll have to look into those. Thank you!

This is for 2022, right?

The flutter / strobe effect can be particularly difficult with mechanical relays, they are not designed to be switched on/off rapidly and doing so repeatedly causes excessive wear on the switching contacts. The relays used in the inexpensive hobby type boards are typically not the best quality either.

Do you have the specs on the candles? Something like the TPIC6B595 shift register is commonly used for driving LEDs, can handle up to 150mA per LED, and are easily chained together.

You are going to have to work very fast as @Paul_KD7HB mentioned. Projects like this generally take several iterations to complete. Make sure that you have spares for each item of hardware on hand for unfortunate accidents.

To be honest, Halloween is year round for me. :joy: This will end up being an everyday piece in my home.

Thanks! I’ll have to go back to the drawing board and look into the shift registers/drivers instead of the relays.

Take a look at MAX7219, it's good for 64 LEDS.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.