Hacking the Macetech RGB Shades


When [Robert] is presented with a challenge, he doesn’t back down. His friend dreamed of reusing some old LED panels by mounting them to the ceiling of the friend’s night club. Each panel consists of a grid of five by five red, green, and blue LEDs for a total of 75 LEDs per panel. It sounded like a relatively simple task but there were a few caveats. First, the controller box that came with the panels could only handle 16 panels and the friend wanted to control 24 of them. Second, the only input device for the controller was an infrared remote. The friend wanted an easy way for DJ’s to control the color of the panels and the infrared remote was not going to cut it. Oh yea, he also gave [Robert] just three weeks to make this happen.
[Robert] started out by building a circuit that could be duplicated to control each panel. The brain of this circuit is an ATtiny2313. For communication between panels, [Robert] chose to go with the DMX protocol. This was a good choice considering DMX is commonly used to control stage lighting effects. The SN75176 IC was chosen to handle this communication. In his haste to get this PCB manufactured [Robert] failed to realize that the LED panels were designed common cathode, as opposed to his 25 shiny new PCB’s which were designed to work with a common anode design. To remedy this, he switched out all of the n-channel MOSFET with p-channel MOSFET. He also spent a couple of hours manually cutting through traces and rewiring the board. After all of this, he discovered yet another problem. The LED’s were being powered from the same 5V source as the microcontroller. This lead to power supply issues resulting in the ATtiny constantly resetting. The solution was to add some capacitors.
Click past the break for more on [Robert's] LED panels.
As for software, [Robert] completely filled the ATtiny’s memory. He used three channels to control red, green, and blue. He added a fourth channel to control pre-designed animation effects such as fading, strobe, and random color. The DIP switches are normally used to set the address of the panel, but there is a second option to put the panel into standalone mode. In this mode, the switches are used to program the panel to perform specific effects with no DMX controller required.
Now that the panels were all designed and functioning, [Robert] still needed a way to control them. He used the laser cutter at Shackspace hackerspace to design the actual panel face and then mounted a bunch of buttons, switches, and potentiometers to it. All of those things were connected to a Teensy3 using perfboard and a hand wired circuit. Another SN75176 IC was used for the DMX communication from the control panel. The control panel allows the DJ to change between different pre-built animation effects, color effects, and also change the speed of the animations to match the speed of the music.
The Color Machine (La macchina dei colori, in Italian language) is a tool to teach children about the use and the operation of RGB color coding, which is used in all digital devices (TVs, smartphones, computers, etc.). It was created with Arduino Mega by an italian duo composed by Fabio Ghidini and Stefano Guerrini:
Using 3 knobs you can increase the percentages of red, green and blue separately, and the LED strip at the top of the machine lights up consistently with the color mix choosen.
The Color Machine has 4 different operating modes: “let’s create colors”, “guess the color”, “the names of the colors” and “demo”. Under the guidance of a teacher, children can play and learn at the same time to recreate colors with additive synthesis. This device is currently used in the educational workshops of Musil – Museum of Industry and Labour of Rodengo Saiano (Italy).
This is the first propotype:
The astute reader of this blog may notice that there was no “eighth day of freshman design seminar” post. I was sick last Wednesday and unable to attend class, so I had the group tutor (a senior in bioengineering) take the class and have them discuss possible projects to take on. I asked them to turn in proposals yesterday, but forgot to collect them—I’ll collect them tomorrow. We’re about halfway through the course, so it is time for students to start on their projects.
I returned two homeworks yesterday: the colorimeter design and the RGB LED resistor sizing.
The colorimeter designs were not very good, lacking necessary details, but were somewhat better than previous spectrometer attempts. I think I’ll try reversing the order of those assignments in future, as the colorimeter is a simpler device. The biggest problem with the designs is that most of them were pieced together from web pages, with no citations. Two of them were blatantly copied from Science Buddies, which has a decent design, but the students did not cite the source. I yelled “Cite your sources!” at the class, and explained that I could have flunked several of them out for plagiarism, and that in an upper-division course I would have. I hope they get the message, so that they don’t fail out later on. I decided not to prosecute academic integrity cases in this 2-unit, optional course, though I am making the science-buddy copyists redo the assignment.
I then explained to students the mistake I had made in the photodiode explanations (see Lying to my students) and corrected the understanding of the “open-circuit voltage” spec from the photodiode datasheets. I think that the students are a little more comfortable about finding things on datasheets now—I hope that lasts for them.
We then went over one of the RGB LED datasheets and did the resistor sizing for it. About a third of the class had done a decent job on that assignment, and I cleared up the common mistakes:
I think I managed to get these points across—I relied fairly heavily on asking the students to do each step, so I’m pretty sure that at least half the class can now size a resistor for an LED.
Finally we could get to some new material. I wanted to show them how to program an Arduino, so we built up the standard blinking-LED first example for an Arduino. To make it a little more interesting, I started with a true statement—I did not know whether the LED on pin 13 was hooked up with the anode or the cathode connected to pin 13. We looked at the two possible circuits and how they would behave differently when the pin was high and when it was low. I then explained “void setup()”, “void loop()”, and “pinMode(13,OUTPUT);”. I had the students come up with the body of loop, feeding them the important constructs (digitalWrite and delay) only once they had expressed the action they wanted. We ended up with a loop that help pin 13 high for a second and low for ¼ second. After I typed in the program we had written, I showed them how to select the appropriate board type and download it to the Arduino. The light blinked, and the students were able to figure out from the pattern of on and off that the LED was connected between pin 13 and GND (with a series resistor), with the anode towards pin 13.
I ran out of time and material at about the same time (a first for this quarter), and assigned the students to read about Arduino programming from the Arduino reference website, with particular attention to “if”, “while”, “pinMode”, “digitalWrite”, “digitalRead”, “analogRead”, and the timer functions. I expect to go over some analogRead stuff in class tomorrow, and assign a small programming assignment over the weekend, probably using “Serial”.
The astute reader of this blog may notice that there was no “eighth day of freshman design seminar” post. I was sick last Wednesday and unable to attend class, so I had the group tutor (a senior in bioengineering) take the class and have them discuss possible projects to take on. I asked them to turn in proposals yesterday, but forgot to collect them—I’ll collect them tomorrow. We’re about halfway through the course, so it is time for students to start on their projects.
I returned two homeworks yesterday: the colorimeter design and the RGB LED resistor sizing.
The colorimeter designs were not very good, lacking necessary details, but were somewhat better than previous spectrometer attempts. I think I’ll try reversing the order of those assignments in future, as the colorimeter is a simpler device. The biggest problem with the designs is that most of them were pieced together from web pages, with no citations. Two of them were blatantly copied from Science Buddies, which has a decent design, but the students did not cite the source. I yelled “Cite your sources!” at the class, and explained that I could have flunked several of them out for plagiarism, and that in an upper-division course I would have. I hope they get the message, so that they don’t fail out later on. I decided not to prosecute academic integrity cases in this 2-unit, optional course, though I am making the science-buddy copyists redo the assignment.
I then explained to students the mistake I had made in the photodiode explanations (see Lying to my students) and corrected the understanding of the “open-circuit voltage” spec from the photodiode datasheets. I think that the students are a little more comfortable about finding things on datasheets now—I hope that lasts for them.
We then went over one of the RGB LED datasheets and did the resistor sizing for it. About a third of the class had done a decent job on that assignment, and I cleared up the common mistakes:
I think I managed to get these points across—I relied fairly heavily on asking the students to do each step, so I’m pretty sure that at least half the class can now size a resistor for an LED.
Finally we could get to some new material. I wanted to show them how to program an Arduino, so we built up the standard blinking-LED first example for an Arduino. To make it a little more interesting, I started with a true statement—I did not know whether the LED on pin 13 was hooked up with the anode or the cathode connected to pin 13. We looked at the two possible circuits and how they would behave differently when the pin was high and when it was low. I then explained “void setup()”, “void loop()”, and “pinMode(13,OUTPUT);”. I had the students come up with the body of loop, feeding them the important constructs (digitalWrite and delay) only once they had expressed the action they wanted. We ended up with a loop that help pin 13 high for a second and low for ¼ second. After I typed in the program we had written, I showed them how to select the appropriate board type and download it to the Arduino. The light blinked, and the students were able to figure out from the pattern of on and off that the LED was connected between pin 13 and GND (with a series resistor), with the anode towards pin 13.
I ran out of time and material at about the same time (a first for this quarter), and assigned the students to read about Arduino programming from the Arduino reference website, with particular attention to “if”, “while”, “pinMode”, “digitalWrite”, “digitalRead”, “analogRead”, and the timer functions. I expect to go over some analogRead stuff in class tomorrow, and assign a small programming assignment over the weekend, probably using “Serial”.
1 | /*Simple PIR sketch: Written by ScottC, 19th Dec 2013 |
104 (Right) – Min
When you move the 104 labelled potentiometer all the way to the right (min position), the LED will remain on for 1 second after movement is detected. When the LED turns off, it will remain off for 3 seconds before the sensor will trigger again from any further movement. |
105 (Left) – Max
The 105 labelled potentiometer controls the sensitivity of the PIR sensor. When in the left position, the PIR sensor is most sensitive and small amounts of movement will trigger the sensor. It detected my movement (ie a single step to the left of right) from over 10 steps away from the sensor. I was very impressed. |
105 (Right) – Min
When the 105 labelled potentiometer is twisted to the right, the PIR sensor becomes a lot less sensitive. I needed to take much bigger steps to the left or right to trigger the sensor (about 3 times the size compared to the left position). It also had a lot more trouble detecting movement occurring further away. It only really started to detect my movement when I was about 4 steps away from it. |