RPi Barbie Disco (using 18-Channel 8-bit PWM LED Driver and pHAT DAC)


#1

Dear All

I’m relatively new to all this, but hopefully not completely green!

I’m building a “Barbie Disco” for my 6 year old daughter. My basic component list is as follows:

Raspberry Pi 2 Model B with Wifi USB powered via White USB plug
18-Channel 8-bit PWM LED Driver w/ I2C Interface PIM057 with 18 different LEDs
pHAT DAC
Adafruit Stereo 2.8W Class D Audio Amplifier - TS2012
2 x 3" Speaker 3watt speakers

I wired by the Pi 2 Model B with fresh NOOBS install) with the LED Driver last night and got all that working. So great.

Now onto the pHAT DAC! How do I wire up the pHAT DAC when the LED Driver is also using the I2C Interface?

Also, how do I wire up the pHAT DAC to the Adafruit Amp?

Many thanks in advance!

Andy


#2

The pHAT DAC uses I2S, which is distinct from I2C, despite the incredibly confusingly similar names (computer industry acronyms are a continuous draw for ridicule).

You can see which pins pHAT DAC actually uses here: http://pinout.xyz/pinout/phat_dac

You can install pHAT DAC and then solder onto BCM 2/3 ( I2C SDA/SCL ) and the appropriate power pins to drive the LED driver.

You can wire the Adafruit amp to the holes intended for the RCA header on pHAT DAC. The larger holes are grounded which you should connect to the left and right (L- and R-) inputs on the Amp. The smaller holes are the signal, which you should connect to L+ and R+.

As the description mentions:

“Inputs of the amplifier go through 1.0uF capacitors, so they are fully ‘differential’ - if you don’t have differential outputs, simply tie the R- and L- to ground.”

How’s the LED driver currently connected, by the way?


#3

hi Gadgetoid

Many, many thanks for the reply.

I2S vs I2C: Very true about TLAs - I should have read more carefully!

I’ve got some more time this week so I’ll be able to dedicate some time to using your kind suggestions. Plus I’ve got some 3W 4Ohm speakers now too.

I’ll post some feedback / photos up before I enclose it.

Andy


#4

hi Gadgetoid

So I’ve got the LEDs and Driver working really well :-)

I’ve just got to wire up the sounds now!

So I’ve got the RasPi -> pHAT DAC ->Adafruit Amp

I have followed your wiring instructions - but of course I have to provide some power to the AMP. Is it ok taking this from the RasPi bearing in mind I am using one of the 5V pins for the LEDs? Or is there some way of taking the 5V power from the pHAT DAC?

Thanks in advance!
andy


#5

Generally as long as you use a beefy enough power supply all should be OK.

The best option might be to butcher a USB cable to get the power from the pi over USB, that way it’s all properly protected and everything, but you could also just solder a wire to a 5v and a Ground GPIO pin on the pHAT DAC - see the excellent http://pinout.xyz/ for instructions as to which pins are which.