Tuesday, January 22, 2019

BedLed


Final result
Back in 2016 I was at a hotel where they had nice looking light from beyond the bed with LED stips. We already had a board behind our bed that would be a nice location the some LED strips like that. Through some investigation I quickly learned that an easy install solution was not available for the requirements that I had;

  • LED strip with high PWM frequency
  • On/off and dim controllable in the dark while in bed
  • Nice looking
In some public places where they use LED bulbs or strips I notice the flickering when the frequency is too low. Especially when it's the only light source in the room and the lights are dimmed. This is quite annoying and feels like I'm experiencing a low frame rate in real life. So the first requirement for this project was the PWM frequency should be high enough to not notice the blinking.

The light should have a very basic interface where it would be possible for me and my girlfriend to turn on/off the light and control the dim level. Doing some research I found some nice looking buttons online that even had a ring of light to make finding the buttons easier at night.

Lots of LED drivers are available on the market, however I couldn't find one that would allow me to connect two buttons to turn the lights on/off and also control the dim level. So I had decided to build my own driver. Having some experience with ATmega and ATtiny the choice was use work around an ATtiny85.

I don't have an education in electronic engineering, using any information from this blog is at your own risk.

Most LED strips that I could find at the time required 12V power supply. I wanted my design to work with any power source that is suitable for the connected LED strip. Therefore power source is connected directly to the output and controlled with a MOSFET. The ATtiny that I choose as controller requires a maximum of 5V. I have some LM7805's laying around which convert any input voltage of 7-35V to 5V, with a maximum of 1A. This is quite suitable to power the ATtiny85.

Schemas
Choosing the right MOSFET turned out more difficult than expected. I asked some colleagues that also like to do electronics and finally choose the IRFZ44N. The board contains a port for small interactions with an expansion. The current code support a KlikAanKlikUit RF receiver (433MHz).

After designing the circuit I ordered the boards online from Aisler. Living in the Netherlands the order from Germany didn't take long to arrive. You probably can image how exited I was to put everything together and test it out.

The PCBs from Aisler

That went better than expected! The software I had written worked as planned and I could control the LED strip with the switches. Short presses turn the light on or off and keeping the button pressed cycles through 6 dim levels.

Mounting he LED strip behind the bed was done with some simple profiles. To make the light come from behind the bed I made some small pieces of wood that are used to make a 90° angle of the strips to the bed.

Experimenting the pot resistors, I wanted to dim the light rings because they were way to bright at night. Started with 1kΩ, then 10kΩ and finally 50kΩ.

(Never really got to finish this post, but wanted to publish it anyway. If you have questions, feel free to leave ask them below.)