# Stepping LEDs using Raspberry

**URL:** <https://forum.core-electronics.com.au/t/stepping-leds-using-raspberry/18060>\
**Category:** Uncategorized\
**Created:** [18 September 2023 00:05 UTC](https://forum.core-electronics.com.au/t/stepping-leds-using-raspberry/18060 "2023-09-18T00:05:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darryl134349](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Darryl134349](https://forum.core-electronics.com.au/u/Darryl134349)\
**Post date:** [18 September 2023 00:05 UTC](https://forum.core-electronics.com.au/t/stepping-leds-using-raspberry/18060/1 "2023-09-18T00:05:02Z")

</div>

[![]( " - YouTube") ](https://www.youtube.com/watch?v=SvB2PW90k6w)

Please see attached link to video.  
Im new to the world of Raspberry, so bear with me.  
I replicate older style railway signalling diagrams like the one that is shown.  
I have already replicated quite a number of them so far and each one is different.

They all have LEDs in them that need to be stepped in a similar mode to what is shown although all would have different programming.

It has been suggested to use a Raspberry Pico for this design. Each Pico would go with the diagram to the owner of each diagram. I would also rather use some kind of battery to run these as a cable to 240 volt wont look good coming out of a picture frame.

In addition, some diagrams need more than the 26 inputs that the Pico is designed for. Therefore, saying if there is 5 minutes worth of stepping programmed and there is 35 inputs, I am looking at inputs 27 to 35 to carry on in the second Pico where the programming in the first Pico ended. Then continue to repeat the whole process over again.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [18 September 2023 01:39 UTC](https://forum.core-electronics.com.au/t/stepping-leds-using-raspberry/18060/2 "2023-09-18T01:39:20Z")

</div>

Hi Darryl, welcome to the forum!

Cool project! I think you’re onto a winner with that idea, but there are a few things I’d mention:

- IO expanders could be used to add GPIO if you only want to write one bit of code, though the challenge of making code that gets flashed to all Picos, and reads pins to determine what sort of device it is could be fun.

> **[I/O Expander - MCP23008](https://core-electronics.com.au/i-o-expander-mcp23008.html)**
>
> Add another eight pins to your microcontroller using a MCP23008 port expander. The MCP23008 uses two I2C pins which can be shared with other I2C devices, and in...

> <https://github.com/CrankshawNZ/Micropython/blob/master/mcp23008.py>

- A battery could be inconvenient, you could always put a really big one in, but it’ll self discharge. Also you’ll have to learn how to put your Pico to sleep in between actions for the best power outlook. Maybe something like a wireless charging setup from the roof space could be an exotic but permanent and non-destructive solution.

Let me know if this sparks any further questions 🙂

---

<div class="post-metadata">

**Author:** ![Jeff105671](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jeff105671/32/3729_2.png) [@Jeff105671](https://forum.core-electronics.com.au/u/Jeff105671)\
**Post date:** [18 September 2023 01:41 UTC](https://forum.core-electronics.com.au/t/stepping-leds-using-raspberry/18060/3 "2023-09-18T01:41:29Z")

</div>

> [@Darryl134349](#):
>
> …some diagrams need more than the 26 inputs that the Pico is designed for.

You can expand the available outputs with this device:

> **[Shift Register Breakout - 74HC595](https://core-electronics.com.au/shift-register-breakout-74hc595.html?gclid=EAIaIQobChMI0a-jiYCzgQMVBquWCh3LhwasEAQYASABEgLO2PD_BwE)**
>
> This is a breakout for the SOIC version of the 74HC595 shift register IC. Clock in data and latch it to free up IO pins on your micro. All pins from the IC are broken out to standard 0.1" spaced headers. The Serial in and out pins are on opposite...

You set up a string of values representing a group of lights, then send the data to the shift breakout. using one clock pin, one data pin and a latch pin. When a light changes you change the corresponding value in the data stream and send the data again. You can mix the module with direct control by individual Pico pins.

Your first module provides 8 outputs at the cost of three Pico pins to control it: additional modules add 8 outputs with no extra usage of Pico pins.
