Basics

Every once in a while I play around with an Arduino and some sensors. Its easy to get something simple up and running and usually is a lot of fun. I’m not that good with electronics but there is a lot of helpful information on the net. I stumbled over those tiny OLED displays. They looked quite interesting so I bought some.

The ones I ordered have 128x64 pixels and come with the SSD1306 driver that can easily be connected to an Arduino via the I2C bus. The first view rows of pixels are yellow and the rest is blue. Its not really multicoloured but I like the look of the two different colors. At some point I also ordered an ESP8266 which is smaller than the Arduino UNO that I already had and is able to connect to my WLAN.

I also bought an BME280. That’s a sensor which can measure temperature, barometric pressure and temperature. Then I put all three of them together and basically showed the time, date and the measurements from the sensor on the display. That made a nice watch. The ESP8266 can connect to the WiFi and so I did that to get the time from an NTP server. With that it even shows the correct time.

Connections

A while back I installed some of those Phillips Hue Lights. They are quite expensive but work very well. To run them you need a Hue Bridge which controls all the lights and switches that connect to it. The cool thing about that bridge is that it has a rest interface.

Usually you have that app where you configure all the lights and switches. You can also turn the light on and off and so forth. That is nice for most things but with that rest interface you can integrate it into whatever you want. So I thought why not put a button or something on my little device to switch the light on and off.

I came across those touch sensors and wanted to try them out and that seemed like a good opportunity. They are easy to connect to the ESP8266 and then it was just triggering a HTTP call when the touch sensor fired. I did not want to implement to much on the ESP8266 so I wrote a small server that I am running on one of my Raspberry Pis. This server contains all the logic and does the more complicated request to the Hue Bridge. This way the request that the ESP8266 has to make is much simpler and I had the Raspberry Pi running anyway.

The whole thing works pretty well. I’ve put it next to my bed so I can turn the light on and off from right there. It looks kind of unfinished but I like the raw look so I did not bother to build a case for it. Maybe some day I will but for now it will stay like this.