$10 Smart Home

Free and affordable smart home built using affordable off-the-shelf RC switches and hacking 'non-smart' appliances

Similar projects worth following
Smart home should not require replacing all home electronics with a limited choice of proprietary devices.

This project uses ESP32 and Raspberry Pi to bridge non-smart appliances and off-the-shelf RC switches with HomeKit-compatible network, making entire home controllable from a single place.

One of the most complex parts of doing home automation is controlling mains devices such as lights. Specialised modules are expensive, while open source / DIY solutions take a bit of time to assemble and are dangerous to debug.

At the same time 4-way remote controlled light switches are available online for under $10 delivered on Amazon and even cheaper on Aliexpress or eBay.

Remote controls of these switches operate at 12v rather than mains supply, making them perfect candidates for hacking and connecting to fully-featured home automation software.

Adobe Portable Document Format - 421.29 kB - 02/13/2017 at 10:12


Adobe Portable Document Format - 371.09 kB - 02/13/2017 at 10:12


  • Controlling High Voltage / Power With Raspberry Pi

    P. T.02/25/2017 at 23:38 0 comments

    The remote module hacked in this design operates using 12v battery, which is connected to one of the data and Vcc inputs on the PT2262 / AD2262 modulator chip.

    This means, the switch should be switching the high side and a simple switch based on a single n-channel MOSFET wouldn't do. And neither would work a p-channel, as the gate can be brought up only to 3.3v level, whereas source voltage would be 12v. A two-MOSFET switch is the solution.

    12v battery provides power for p-channel Q2, which performs power switching and also brings Q2 gate up to 12v when Q1 is closed (logical "1"/3.3v on the input) via a pull-up resistor R1. Any fairly high value such as 10k would work. When the input changes to logical "0", Q1 will open, shorting Q2 gate to the ground and switching the 12v output off.

    One extra part, important for correct function of the circuit is not shown on the diagram. In a general case Q1 should also have a pull resistor to control gate input voltage in the unknown state. However because input connects to Raspberry Pi, its internal circuitry is expected to drive it low or high explicitly.

    This could potentially cause a floating input problem triggering random switching when 12v battery is connected and Raspberry Pi is switched off, however in this project we will find a way to supply 12v from RPi 5v rail using a DC-DC converter, eliminating need for a battery and eliminating the case when 12v might be present when RPi is turned off.

    A low-current signal MOSFET can be used as Q1 as it is merely switching Q2 pull-up off. Q2 has to supply entire load. Original data sheets do not provide power consumption ratings neither for the chip itself or a circuit. However, suggested power switch diode 1N4148 is a hint. Its top peak current is 2A and maximum continuous current is 300mA. In practical terms maximum theoretically possible current is determined by internal resistance of the 12v supply.

    Generic A23 12v battery data sheet claims that "typical closed circuit voltage no less than 10.4 volts on a load of 800 ohms at 21oC (70oF) for 0.10 to 2.0 seconds." This is roughly equivalent to 120 ohm internal resistance, or 100mA continuous short circuit current. Consistent with the diode ratings suggested in the data sheet. Therefore power switching p-channel MOSFET Q2 should have a similar rating.

    Schematics above can be used to switch any high voltage - high power load (as long as the voltage is safe to switch without isolation) using any logic-level input such as in Raspberry Pi, Arduino, etc.

  • Hacking Remote Control Light Switch PT2262 / AD2262

    P. T.02/13/2017 at 10:26 0 comments

    A typical inexpensive remote controlled switch remote is based on AD2262 chip, a clone of PT2262. Although a data sheet in Chinese can be found for AD2262, description of original PT2262 seem to have much more details about their application. Both data sheets are available in the project files.

    "PT2262 is a remote control encoder paired with PT2272 utilizing CMOS Technology. It encodes data and address pins into a serial coded waveform suitable for RF or IR modulation. PT2262 has a maximum of 12 bits of tri-state address pins providing up to 531,441 (or 3 ) address codes; thereby, drastically reducing any code collision and unauthorised code scanning possibilities. "

    Typical remote circuit thus looks as follows:

    Taking hardwired address bits and data bits set by pressed buttons the PT2262/AD2262 modulates RF transmitter, supposedly designed to work in ISM band. Modulation frequency is set by resistor connected to pins 15 and 16 forming RC-oscillator circuit together with the chip.

    Making switches to operate electronically would permit to use home automation software. to control the remote and, therefore, mains devices wired to the mains module.

View all 2 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates