Galileo is needing a consult from an Arduino/SPI Yoda

OK folks, we are making progress on the LED setup for Galileo's Finger's_Finger. I posted a poor-resolution
image of the evolving schematic at the bottom of the project page.
We're closer to placing the Mouser/Digikey order for ICs, IDCs, and
multi-color flat ribbon cable.

We're thinking to adapt the tutorial
and drive three AD5206 integrated circuits instead of just one. The
AD5206 is a 6 channel digital potentiometer with an SPI communications
interface. The Arduino uses digital I/O to talk SPI with the AD5206
to set each of the six digital pots to a value between 0 and 255 and
change to the brightness of any one individual LED. We're using sets
of six tri-color (Red Green Blue) LEDs so the 1st AD5206 drives the
six Red channels, the 2nd AD5206 drives the six Green channels, and
the 3rd AD5206 drives the six Blue channels. Each tri-color LED will
have separate Red Green Blue inputs and we think we can program some
interesting color, blink, and decay effects based on the inputs from
the three distance sensors (Red Green Blue).

So Galileo is needing a consult from an Arduino/SPI Yoda before we
spend the cash. Can the Arduino drive three AD5206 chips? We see you
need three Arduino digital I/O (for CS, SDI, and CLK) to the 1st
AD5206, but this newbie is not sure if you need six more digital I/O
for the 2nd and 3rd AD5206. Perhaps we need a unique Ardunio digital
I/O for CS to each of three AD5206 but all three AD5206 can share the
same Ardunio digital I/O for SDI and CLK? Do we need 7 or 9 Arduino I/
O to make this work as described?

All advice and inputs are welcome...


Jim, yes all chips will share the same MISO,MOSI,and CLK. you will be
able to select which chip you talk to with the CS pin. Therefore you
should only need 6 I/O for the Arduino. When I had earlier discussed
this with you, I didn't realize there was a CS pin on the Digital pots
(not sure why most SPI does). Also, our conversation of using the
internal hardware SPI should work fine. There would be no need for a
software (bit bang) SPI and driving these chips should be pretty

Another option is the macetech shiftbrights that we used for the window. They are also SPI, but use a single latch enable line for all units rather than individual CS signals.

We have one shiftbright and two megabrites spare at the space, we can take a look at them Tuesday.

There are a couple of different models -

I am pretty sure I have a handful of AD5206 or similar SPI digipots
laying around. You could drive all of them off a single CS line if
you daisychained them and blasted out enough data for all 3 digipots
each time. This is doable.

Hi Guys,

Driving multiple RGB LEDs from a single Arduino is a problem I’m very familiar with.

I have to strongly caution you against using digital potentiometers for this application.
Most digipots are not capable of handling the current required for LEDs.
Also, the exponential V-I relationship will drive you up a wall.

Find a nice dedicated LED driver chip that uses I2C or SPI. I’m particularly fond of the PCA9635(
It has sixteen individually controllable brightness channels with some neat blink functionality built in.

We used them last summer for my motion reactive LED Poi project - I can get you the code if you’re up to soldering the tiny pins in the surface-mount-only part.

Seriously, don’t use digital potentiometers. The AD5206 can only source 20ma peak, definitely not enough for a moderately bright LED. Also, LEDs don’t behave linearly, whereas your potentiometer doesn’t. Setting your pot to 1/2 will probably reduce your brightness by a lot more.

Best of luck, and feel free to email me directly if you need a hand with I2C or SPI.

Nice info! Just so happens the Hive is having a surface mount soldering class on Weds! Perfect timing! :smiley: