Summary of Remote-Control Light Dimmer using pic microcontroller
The article describes a DIY remote-controlled dimmer for a cheap bedroom lamp. The creator was frustrated with having to manually turn the lamp on and off in a dark room and decided to build a remote control with dimming functionality using an IR LED and a simple IR protocol. The IR communication uses a 34kHz carrier frequency with a specific bit timing and a structured packet including preamble, header, device ID, button code, checksum, and trailer. The project enclosure is a repurposed tin can.
Parts used in the Remote-Control Light Dimmer:
- Cheap bedroom lamp
- Infrared (IR) 940nm LED
- Tin can enclosure (recycled)
- Microcontroller or IR transmitter circuit (implied)
- Knob or button for manual control (mentioned as existing on lamp)
The lamp in my bedroom is a very cheap lamp from Wal-Mart. It stands in one corner of my room, opposite of the door. This is where the problem is: If it is dark, I have to walk across the room, not trip on anything, find the small knob to twist to turn on the lamp, walk back towards whatever I need to do in the room. That is a whole lot of unnecessary walking.
As can be imagined, this annoyed me. I decided to make a remote-control for the lamp. And since I was making a remote control, I decided that I might as well make it a dimmer – something I’ve wanted from this lamp for a while. I lacked any enclosures, so I used a tin can from what I can only assume were Chinese Altoids.
The IR protocol is very simple. At the physical layer I stole it from a previous project of mine. IR 940nm LED is used. The carrier frequency is 34KHz. A 1-bit is sent with 0.5 ms of modulated carrier and 1.5 ms of darkness. A 0-bit is sent with 0.5 ms of modulated carrier and 0.5 ms of darkness. The packet begins with a preamble byte of 0xFF. Then comes a header of 0x06. Then comes the device ID – a 32-bit identifier of the device. For this project, I used a device ID of {‘A’ ‘B’, ‘L’, ‘1’}. Then comes the button code.
2 bytes are used, big-endian. This project uses just three button codes: 0 for “power on/off”, 1 for “brightness up,” and 2 for “brightness down.” Then comes a checksum. It is used to make sure that the packet is received successfully and error-free. Then comes the trailer byte of 0xFF. This protocol allows for over 4 billion device types and more than 65 thousand buttons for each.
For more detail: Remote-Control Light Dimmer