This is the newest addition to our LivingRoom. It’s a normal LED Ceilinglamp with some extras:
This Project is fully open source and publicly released on github under the MIT License. Any further contribution to this project is highly appreciated
- The Spots are Grouped into 2 seperately switchable Groups (1 spots aims at the couch as reading / working light and the other 2 are there to brighten up the rest of the room)
- On top of the lamp there is a RGB LED strip to get an indirect illumination for the room
- RF Controllable (433MHz)
- WiFi Controllable (WebSocket API)
- build-in RF Transmitter to control other 433 MHz outlets in the room
- build-in Webserver to host a Hybrid App for iOS to control all features of the lamp
I started planning this Project right when I began to write my bachelors thesis. It took quite some self-control to not dive right into it, but it kept me motivated to finish the thesis ASAP so I can begin the project without any guilty conscience.
Right after I’ve sent the thesis out for printing, I startet breadboarding the circuit. At this point I already had a very clear Idea about what features I wanted to implement. Also, I already had most of the parts needed (one part took 7 weeks from China to Germany).
What I’ve done in this project (only what has gone into the end product)
- All the woodworking
- design and layout of the controller pcb
- milling and drilling of the pcb
- drop-in replacement for a 7805 with a buck converter
- custom firmware for the ESP8266
- custom firmware for the Arduino micro
- implemented a WebSocket Server for the ESP8266
- a HSL color picker in JS with HTML canvas
- a html 5 based hybrid app with ionic.js
The Fails / Lessons learned
Sometimes projects get a little tricky if things don’t work the way you expected them. This project was no different. In this section I want to tell you some of the problems I encountered while building the lamp.
- cheap breadboards from China seem not to handle > 1.5A @ 12V without smoking and burning (what a suprise).
- heavy wood: I wanted to use beech wood for the lamp as it is a nice looking wood you can work with really well. Unfortunateley our ceiling is only filled with straw and if you’re not lucky enough to find a beam you’re going to have a bad time hanging anything > 2kg on the ceiling. The solution to this Problem was a wood I’ve never heard of before. It’s called “Paulownia”. It’s very light (maybe 10% the weight of beech) and still quite OK to work with. Also it still looks kind of like beech.
- 7805s get pretty hot even though I’ve only drawn ~1A and split the load on 2 (one for the relays and one for all the other stuff) and attached some small heatsinks. Still there was a Voltage drop of $12V - 5V = 7V$ and $7V * 500mA = 3.5W$ heat generated. The solution was an old 12V mobile charger that used a Buck Converter I could salvage. I modified the Converter as a drop-in replacement for the old 7805 (see images).
- The ESP8266 AT-Command Set Firmware is crap. The first Version of the Hardware was designed for hosting the Website using AT Commands to control the ESP8266 and a SD-Card to store the data. After a lot of trial and error coding an Arduino Sketch to do the job of the middle man, I realized that modern browsers do not quite behave like me in my telnet session I tested the code with. They do not simply send a request for the requested document and wait until it is there, but try things like sending the next request while the arduino still reads the document from the SD Card or request a favicon.ico before sending the request for the document itself. That wouldn’t be a Problem, if the ESP8266 woudn’t freeze if you try to open another TCP Connection while in data mode. After this realization I removed the SD Card holder and bit the bullet. I installed a VM with the ESP8266 Toolchain to host the website directly on the module. Much hassle…
- HTTP has a lot of overhead and you have to parse quite a lot until you get the data you want. This was a Problem for the color picker where I planned to send the data over HTTP put every 100 ms or so. Even with this delay and the quite quick esphttpd the controller crashed immediateley. this was the reason I’ve gone through all that hassle to get a working ws implementation.
- 433 MHz receivers don’t like me. I had a lot of trouble getting the 433 MHz receiver to work. The transmitter was no problem and worked almost instantly. the receiver on the other side didn’t want to receive anything that was sent >2ft away. I also tried to attach a 1/2m long cable without any success.
- never assume that there must be a library for $this out there, especially if it is for a quite new controller like the ESP8266. But even for HTML5 where I thought that already everything you may ever need already was done, I had Problems finding the right element. For that reason I implemented 2 seperate libraries for this project some others might find useful
and last but not least:
- ionic.js is really cool. this was the only thing i never encountered any problems with.