Need some help expanding my Mote


#1

Hi guys,

Last month I ordered and installed a Zero with a Mote pHat and 4 strips of led’s under my stairs, this is the result.

Now I would like to expand the amount of led strip to 8. I suppose I can connect a Mote Host via the usb port and add 4 extra LED strips. The question is, what do I need to add or change in the code to get it all to work?

Is it as easy as adding an extra library and extend the range of channels from 4 to 8?
I found some info by searching the forums but it was not entirely clear to me.

Thanks in advance


#3

That’s some fantastic work!

To add a second Mote pHAT you’ll have to get a little bit creative with both the hardware and software side of things.

First up, you’ll need to write the Mote pHAT manually onto the Pi header- make sure to make all the power/ground connections, plus BCM 10 (Data) and BCM 11 (Clock) as normal. Then you need to find 4 free pins to wire up the Mote pHAT’s Channel 1, 2, 3 and 4 connections.

You can use jumper jerky or soldered-on wire to jump those pins (BCM 8, BCM 7, BCM 25 and BCM 24) across to 4 other suitable pins on the Pi- maybe BCM 5, 6, 12 and 16 or any of your choice.

Next you’ll need to manually modify the library starting with this bit: https://github.com/pimoroni/mote-phat/blob/master/library/motephat/init.py#L18

This is the list of pins that Mote pHAT uses to switch each channel. Add your 4 extra pins here.

Then change NUM_CHANNELS = 4 to NUM_CHANNELS = 8

Finally change this awful bit of code:

pixels = [
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL
]

To reflect your 8 channels:

pixels = [
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL,
    [[0, 0, 0, DEFAULT_BRIGHTNESS]] * NUM_PIXELS_PER_CHANNEL
]

Aaannnd… I think that’s it. You should be able to install your modified Mote library sudo setup.py install and use it just like the old Mote pHAT library but with the addition of 4 extra channels.

Just knowing it’s possible should get you half way toward getting it up and running ;) If you get stuck, give me a shout.


#4

Ok thanks! :D Great info!

So you think it’s better I use an extra pHat instead of combining it with a Host module? Or is that combination not possible hardware-wise or maybe codewise?


#5

You could certainly use Mote Host, and you can use both libraries side-by-side, but you’d have to use a USB hub or adaptor to hook it up to a Zero. It could well be the easier choice if you don’t want to do any creative wiring and library modification.


#6

Oke thanks, I think ill try to figure out how to connect a second pHat, that way it’s more fun and a challenge, plus I want to keep the amount of cables to a minimum :)