Lamp Fading And Remote Control For The Lazy

[Dmitry Grinberg] has to walk all the way across his bedroom to switch the lamp on and off. The drudgery of this finally became too much, so he built a remote control and added dimming for good measure. Above you can see the circuitry for the remote and the receiver, as well as the finished remote housed in what he calls a ‘Chinese Altoids tin’.

After the break you’ll find [Dmitry’s] demo video. The remote control is quite responsive, and the dimming has great resolution. That’s thanks to a power N-channel MOSFET which switches the AC with the help of a full wave rectifier. The PIC 12F617 that controls the MOSFET is powered separately, and [Dmitry] mentions that you must use a transformer and not a switch-mode power supply to avoid a fire. We’d like to know more about this, so leave a comment if you are able to explain further.

The remote and receiver communicate via Infrared. The protocol is operating with 38 kHz signals using an easily sourced receiver tuned to that frequency. [Dmitry] shares all the details about the encoding scheme that he uses. Recreating this communications pairing is a great way to test your understanding of this technique. But if you need a refresher, here’s a tutorial to push you in the right direction.

16 thoughts on “Lamp Fading And Remote Control For The Lazy

  1. a properly designed isolated switching power supply will work. the transformer is used to isolate the tin case from the power line so that any inadvertent grounds cannot be accidentally shorted.

  2. Yeah. There really is no reason to say anything like that.

    A simple zener supply would work too. Might even be cheaper than the big FET he used.

    Also, there should be a small inductor in series with the lamp to reduce flickering.

  3. @dmitry – simple test, you can do a simple test of a continuity test with any of the prongs on the live side. most switching wall warts for consumer electronics sold in north america and eu are tested for this. only imitation knockoffs might violate required certifications…

    1. The rules are any supply that has a connection to the mains can do so provided the end user device has no way for a user to come in contact with the output power. So you can use a non isolated supply all you want in the USA as long as the device it powers is fully enclosed in plastic with no metal exposed that conducts the supply currents. Re-purpose one of those adapters though assuming it is isolated because it is in the USA and you can get a surprise.

      Checking with a meter when the supply is unplugged also doesn’t always work because parts like diodes can lead to readings that appear to have no continuity but they actually do. The only real check is with the supply operating. Meter set to AC there should not be any voltage reading between the mains and the output wires.

  4. could easily power the mcu directly from the rectified DC with a large value resistor in series with a diode, connected to the V+ pin. Then, from the V+ to V-, connect a capacitor and a zener diode to set the voltage to the range acceptable for the MCU (usually 3.3v or 5v). Choose resistor value based on current draw of the MCU, and maximum shunt current of the zener. Then you eliminate the external power supply

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

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