Working with Arduino
I started working on projects that use Arduino last year. The very first project was for a Heritage Gallery which showcases local education history and development since its establishment until present time. Following are my experience working on them.
Seamless projection shows using WatchOut and Arduino.
These 2 shows are similar in implementation with the only difference is on their number of projector used. The first one uses a single projector while the second uses 4. The video contents of the show are delivered using WatchOut, a software that output seamless projection out of multiple projectors. This software also controls the lighting in the projection room through it's DMX feature and in turn, the operation of the software is controlled using motion sensor and physical buttons. When motion sensor detects movement, lightings are turned on and the shows would transition to the introduction screen. It will stay until all visitors occupy the room. A gallery guide will then press one of the buttons to start the main part of the show. Another button which is designed to function as emergency will be used to stop the show. Near the ending of the show, a media player housed in an antique radio is triggered through a relay. All these things work in tandem to make the show appears harmonious.
To accomplish this, a number of things are put to work together: the storyline, animation and effect which make up most of the show, the DMX device that dims and brightens the lighting, the media player, the Arduino, Ethernet Shield and some related components. Arduino works as a proxy and manages the communication between these things. It receives input from motion sensor and buttons, transmits the corresponding message to WatchOut systems and through a relay, it triggers the playback of the media player. I was responsible for the implementation of the Arduino: wiring and programming. As this was my first time working with it, I had to learn basic electronics, soldering and stuff.
When everything was completed, we put them to test. At this time, an unknown error caused the show to jump to the start and end of timeline. The error manifested randomly, at one time, it caused a jump thorough the show and at other times, it didn't at all. I couldn't conclude anything from observing the continual occurrence of the error, it appeared purely random, without any pattern. In the end, this specific error took me almost 3 evenings to trace. As it turned out, the cables that that link the buttons to Arduino were to blame.
In the grand scheme of things, the cables were the least suspecting thing to me when I traced. I assumed they either work or didn't because they were just intermediary that carry the signal from the buttons and contain no moving parts. Earlier, I tested the cables using multimeter but found no defect. As the cables were quite long spanning from atop of the ceiling to outlets on the wall and was provided by an external vendor, I felt unenthusiastic to replace them if they worked fine. So hypothetically, I thought the cause of the error might lay elsewhere, perhaps in the wiring or in my code or even on the Arduino board.
The problem only became clear when I devised some test cases and started narrowing down the error. First I ran the WatchOut systems standalone and made sure they were operating as expected. Then I dismantled everything that was connected to Arduino and hooked them up step by step with a new set I built. The new set including some shorter cables just for testing were built because the previous debugging of old set didn't produce result. On each of these steps, I made the show run from start to end and log every message that was sent between Arduino and WatchOut to a text file using a serial logging utility called Gobetwino. The log enabled me to see what Arduino and the counterparts were doing and their states. After executing almost every test case, it became evident that the culprit was the cables. The new cables were running without hiccups for the first and subsequent times. And to replicate the error, I hooked back the old cables to Arduino. I showed this to the vendor and they replaced the cables next day. My boss's assumption was that from time to time, the cables somehow built up power and released it when reaching certain threshold.
Scrolling text using Matrix LED and Arduino.
The layout of this exhibit follows the model of a train map. It's installed vertically on the wall with 27 LED buttons fastened to it and covered by a thick glass. Each of these button corresponds to a message of the year during which an education policy is proposed or implemented. The message will be displayed on the Matrix LED when the button is pressed and stay scrolling until the message repeats for the second time.
This installation uses 27 buttons with LEDs so it requires 54 pins in total. Half of these pins are used for the press button input and another half for lighting up the LEDs on the button. To keep things simple, I used an Arduino Mega because of its larger quantity of pins. So that each pin can be mapped to either one button or it's LED. In fact, smaller Arduino boards can be used in conjunction with shift registers to produce more pins but this would make the whole thing more complex. For the wiring, I decided to use breadboard as is, instead of stripboard because hooking up 54 cables and resistors can be difficult and prone to short circuitry.
Luckily when the whole board was fully assembled, it looked neat. To make them easier to work with and also to prevent error, I put labels on each pair of them.
