Remote-Control Light Dimmer using pic microcontroller

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.

Remote-Control Light DimmerAs 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.

Remote-Control Light Dimmer2 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


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.