The circuit as it ran for two years

The circuit as it ran for two years

Normally, it would make much more sense to publish a project when it is done. In this case, I was sure that I had done exactly that. It’s just a few days since I realized that I didn’t. Funny, it’s been exactly three days before I replaced the project by something else. However, even if it’s a bit late, I’ll deliver…

In early 2014, we renovated our living room. One wall got a rocky structure, and I thought that was the perfect place for a grazing light from above. This screamed for LED-strips. Fooling around with my daughters, I mentioned a plan of installing a pink light. The plan was to go with warm-white, but they insisted on a pink light… two against one, I was in defense position. :-)

Theoretically, a simple RGB-strip can be made to give white light. Practically, most times that’s a really ugly tone of white. So I installed a warm-white strip next to the RGB one. The controller that was delivered with the RGB-strip wasn’t able to power this combination, so I needed a RGBW controller. I couldn’t find an affordable one, so I had to build it myself.

That's how it works

That’s how it works

If I remember correctly, that was my first Arduino project. And it was surprisingly easy to do. I built a first prototype with an Arduino Uno, and with the great infrared receiver library by Ken Shirriff I was able to control a RGB and a white LED after just two hours. Using my trusty Logitech Harmony, which also controls the rest of my media system.

The second prototype I built using MOSFETs, to test how I would be able to control the LED-strips with an Arduino. They are powered with 12V, after all.

The final build is pictured on the photo above: an Arduino Pro Mini (the one without USB interface), and a simple PCB that is wired for controlling the strips. There’s an infrared receiver wired to the Arduino. Initially, that was a TSOP31238, but I fried it just before finishing the project by wiring it wrong. Wanting to get this done, I gutted an old DVD player. I don’t have the slightest idea what type of receiver this is, but it works. :-D

That means: it did work. Almost exactly for two years. Till today. Now it’s obsolete — as I said. Sources and documentation go by the name of IRlicht, I published today.

Oh, and if that’s of anybodys concern: until today, the lamp was used almost only in the white mode. The colors — and especially the color changing modes — were used only for testing and for showing how it works. It was used rarely enough that I had to look up the used keys in the source code…

H801 Wifi in case

H801 Wifi in case

I don’t remember how I found this, but a while ago I ordered one of these modules from china. It’s called H801Wifi, and it’s sold for nine Euros. There’s also an app that controls the lamps from a phone, but I didn’t even bother to test that.

Two years ago I built a project that runs by the name of IRlicht (I was sure that I published it at that time — seems that I still have to). It does almost the same: it controls the brightness of LED strips. My own projekt does that on four channels: RGBW. Red, green, blue and white. This device controls RGBWW, meaning that it would be possible to attach for example a warm and a cold white strip, in addition to the RGB one.

My DIY-one is controlled via infrared remote control. This module is driven by an ESP8266, so it works in a WiFi network. I’m fooling around with a firmware for small WiFi-devices for a while, that communicates with the MQTT protocol. This module would be a great platform to use it on. It’s just questionable if it’s possible to get my own firmware to this off-the-shelf-device…

Turns out: yes. It’s possible. :-)

Flash-jumper set, connected to serial

Flash-jumper set, connected to serial

I’m not the first one to try that. Andreas Hölldorfer did it, and he wrote about it. I didn’t expect it to be that simple. Almost disappointing… ;-)

On the PCB — and thanks to great photos in most of the offering shops I knew that ahead of the purchase — is a well labeled serial interface. And right next to that is a connector that literally wants a jumper to be set on it. When the jumper is set, it’s possible to flash a new firmware over the serial interface. Right from the Arduino IDE. I just connected my USB-serial-interface between computer and the module (without connecting external power to it, I don’t know if that would have damaged anything), and I configured the module in the IDE like this:

  • Board: “Generic ESP8266 Module”
  • Flash Size: “1M (64k SPIFFS)
  • Upload Speed: “1152200”

After connecting RX and TX in the right way, I was able to upload my firmware.

I mentioned to have an almost fully working firmware for my use, based on the excellent Homie for ESP8266 framework. ‘Almost’, because till now it just does RGB, not RGBWW. But the only thing I had to adapt for using RGB on this device instead of my usual hardware were the IO-Pins. The “Generic ESP8266 Module” header file doesn’t know any readable names for the pins, so I had to use the numbers. Andreas Hölldorfer already found out the mapping, though it seems that he’s got a different revision of the hardware. This worked for me:

Pin Function
15 Output red
13 Output green
12 Output blue
14 Output white 1
4 Output white 2
1 Internal LED green / Signal
5 Internal LED red / Power

I like that, after initial flashing the OTA-Update (Over The Air) works. This way, I could already close the box again. All further updates will be uploaded over the air. :-D