January will be my last month working at Ibuildings. During my time at Ibuildings I have worked on a lot of interesting challenging projects, made a lot of new friends, learned a lot from my co-workers and hopefully they learned something from me too. But now it is time for me to master a new set of programming languages, move to Amsterdam en meet some new people. Next month I start working at booking.com, which is mainly based on the Perl programming language. But before leaving Ibuildings I am going to build a cool gadget for the new bigger office location in Utrecht, where I have been working. The gadget will be a traffic light system, which displays the status of the latest build of the Continuous Integration server (Atlassion Bamboo).
About the project
I will create four blog posts about the development of this traffic light project. This first post contains the project introduction, scope and architecture. The second post will be about programming the Arduino micro controller board. The Arduino will contain a small web server for interfacing with the lights. Using HTTP GET parameters the lights can be switched to on/off individually or all at once. The third post describes the electronic circuit of the system. Two circuits have been built for the system. We start with a very simple set-up, without the relays and lights in order to program the controller. Next the electronic circuit will be extended with relays in order to switch lights with the required voltage. In the final set-up the system will be placed in a nicely fitting box. The last post will be about integrating the Arduino traffic with a Continuous Integration server. It contains a how to setup the integration for Jenkins (personal usage) as well as Atlassian Bamboo (used at Ibuildings).
The final system consist of several components. The traffic lights will be controlled by an Arduino connected to an Ethernet module. It will contain a small web server which listens for some HTTP request arguments (example: green=on). It should display a small page containing some buttons for switch the lights easily using a browser.
With my colleagues we agreed that the micro controller should only be a very simple device for switching on/off the lights. This way the traffic light device can also be used for other purposes in the future. The interaction with the CI server will happen on a regular computer with PHP5 installed. It possibly can show extra information about the last build such as the name of the project, time, duration, etc. In the case of Ibuildings we cannot set-up a trigger on the CI server, because it is not located within the internal network. Therefore we need a polling mechanism for checking the latest build. The diagram below illustrates how the different components are connected with each other.
The internal network consist of a switch/router, the CI server poller and the network connected traffic light. The CI server poller regularly polls the CI server located on an external network. In case the traffic light and the CI server are on the same network, it is possible to control the traffic light directly from the CI server by installing an extra trigger.
The software used for this project will be released open source. The project source code will exist out of the arduino controller code, CI server poller code and some documentation for setting up the electronic circuits. The code source can be found on GitHub: https://github.com/DirkEngels/ArduinoTrafficLights. In the next few days I will publish the rest of this serie of blog posts explaining how the following elements are created.
- Programming the Arduino Controller
- Putting together the electronics
- Creating the poller for the CI server