14 Dec 2013

Hacking a Disco Ball - Part 1

Several months ago, one of my friends bought a cheap disco ball on ebay like this one. When plugged in the wall outlet, the disco ball turns and produce automatic lights pattern. After using it a couple times, he found the built-in pattern to be pretty boring so he asked me if it was possible to hack the electronics inside to create his own patterns.


We then opened the disco ball to see how it worked, the design was pretty simple. Inside the ball, there is 2 printed circuit board and a 120V motor. One of the PCB only contains 3 big LEDs for the red, green and blue color. On the side of the PCB you have a six pin connection that gives access to the 3 cathodes and 3 anodes of the LEDs.



On the other PCB, you have a transformer and 7805 regulator to provide low voltage for the LEDs and a couple chips for animating the hardware of the ball. Like most Chinese stuff I've seen, the controller PCB is very cheaply made and by looking at the quality of the soldering, I wonder how it can work properly.




To hack the disco ball, I suggested to my friend that we get rid of the controller board and make our own so we can control each LEDs and the motor. The content of the PCB is quite simple :

  • 5V input connector
  • 120V input connector
  • Microcontroller (I chose the Propeller from Parallax)
  • 3.3V voltage regulator
  • 3 MOSFET transistors to drive the LEDs
  • Triac to turn ON and OFF the 120V motor
  • Couples of connectors for LEDs, motor and programming
For the software part, I scratched my head a little bit... I wanted to make something simple so we could create several lighting patterns easily, without messing too much with the code. I ended up with designing a simple scripting language to control the LEDs and motors. The language also features looping construct for the animations. Here is what is needed for the software :

  • Specification for the disco scripting language
  • Computer program to send the script to the disco ball
    • Functions to read the script file and translate it to a binary form
    • Functions to send the binary file serially to the microcontroller
  • Microcontroller program to receive and interpret the binary program
  • Software routines for controlling the motor and switching/dimming the LEDs
Even if this project is simple, completing each task took me quite some time and the project is almost finished. At the moment, all the software part is working and I'm waiting for the PCB that I ordered from OSH Park to arrive. Take a look at the preview of the PCB I got :

Front side

Back side


In the next part of this article, I'll give you an overview of the software involved in this project.