The PiDioder

Finally the long awaited tutorial to turn your Ikea Dioder and your Raspberry Pi into an awesomely sexy computer controlled LED component!
Apart from many other Tutorials you can find in the internets (sic!) this does not need any deep electrical knowledge or similar.

The Materials you need:
- Voltmeter
- Some cables
- Soldering Gun (and accessories)

if you know how to use it, you should always try to measure the voltage between the mass/ground and the source you’re working on, i will add the voltages that are expected in this tutorial.

the hardware part

step 1

2013-12-08 12.40.53

open the box with a screwdriver, you can damage it, but i would strongly suggest you be careful – cause you might want to use it later on

2013-12-08 12.41.26

this is what the box looks like if you opened it without damaging it. you can easily pull out the circuit board now.

step 2

now you should mount it on a stand or somewhere similar to have a solid working base that doesn’t move while you’re working. this is how the UNCHANGED circuit board looks like.

2013-12-08 18.20.01

now you need to disconnect the existing connections between the mosfets and the potentiometer wheel-thingy (help me out, what is this thing called?) (thanks to /u/CastleSeven for giving me the right name).

step2

click on the image to view it in full size. on this i already cut the connections between the mosfets and the potentiometer. i’d recommend you to scratch off the first layer first to make the copper-connections visible and then disconnect them at the exact positions i marked on the image. otherwise you’ll have problems soldering your new wires on it.

Step 3

2013-12-08 18.23.46

now you need four wires (one for each channel and one for the mass), try to keep them the same length. it will help you in the end.

Step 4

voltages between the mass (blue cable on the bottom) and the connections before the mosfets (the three big black blocks) should be 0V right now. if it’s not zero, you need to scratch a bit more.

step3

the mass wire! you need to solder one of your four wires to the blue wire on the bottom of the image (the one that has the description “-” on the circuit board). hint: paint the other end of the wire in some color so you know it’s the mass wire, it will come in handy.

you need to skin the ends of the new wires, whirl them up and solder them to the three points i marked with the numbers “1″, “2″ and “3″ – beware! the wires for point 2 and 3 should not touch each other!
the three numbers represent a color in the RGB color space, i’m not sure which mosfet is in charge of which color. if you figured it out (mine is already finished and i can’t access the board anymore) please let me know.

2013-12-08 20.20.42

this is what your board could/should look like after you’ve soldered all the wires and probably did some fixation of the wires.

step 5

2013-12-11 02.00.54

i used a 26 pin socket connector to connect the wires to the corresponding pins of the gpio outs. take a look at the pinout scheme for the pi on this page: http://modes.io/raspberry-pi-serial-communication-for-fomophobia/
for software reasons we need the following pins:

  • Ground (Mass), which should be connected to the mass wire
  • GPIO 4
  • GPIO 17
  • GPIO 18

i will explain what this is about in the software part of this tutorial.

2013-12-11 02.01.33

i used a Ferm CTM1010 to cut a hole in the case i got for the pi for the wires. simulatinously i widened the hole for the power cord on the original case of the circuit board. then i closed the whole thing with some bandage tape

step 6

actually you should be done with the hardware part right now. to the software part!

the software part

we are going to make use of sarfatas pi-blaster library – which enables PWM (pulse wide modulation) on some GPIO pins. now you know why we used some specific pins. all credits belong to his awesome work!

step 1

as i’m not going to tell you how to install an operating system on your pi we start by following the how to from the pi-blaster github page

step 2

check if everything is working correctly by typing echo "0=1" > /dev/pi-blaster into a terminal. mark the color you see and then undo it by typing echo "0=0" > /dev/pi-blaster you will need the numbers of all three colors, so do the same with 1=1 and 2=1

step 3

if every color works and you know the number of the color, clone my small go-pidioder project on github and run it (you need go for it to work). take a look at the main.go file and change the consts to the values you wrote down. start the server by typing go run main.go and wait for it to start. it simply starts a small webserver on port 1337. if you can open the website and click one of the buttons, you’re done! have fun!

to-dos

  • use tcp instead of http because it’s faster

in action

this is just a small thing i hacked together to show some “random disco mode”.

credits

big thanks to nemo for figuring out the technical stuff

feel free to contact me for any further information or if you think something is missing in the tutorial.