I'm new to Raspberry Pis. I'm not new to programming, but I know very little about electronics. For a first project I would love to make an outlet switch thing that is connect to an rpi that's connect to a thermometer, with the goal of regulating the temperature in a room with a cheap space heater. Where I'm stuck is the outlet switch (or whatever it's proper name is). The DIY smart outlet tutorials I'm finding are all using these wireless remote controlled outlets, which would require more work to set up then what I'm envisioning. I'm wondering if there's a simple device I could use to just stop/let through electricity at a wall outlet level, that I could easily control (via direct connection) with an rpi, Thanks!

  • 2
    Ah, let met see. Perhaps you can consider a US$60 space heater with an infrared remote controller. Example: homedepot.com/p/…. Nowadays even cheap space heaters has the following features: (1) Temperature Control, (2) Timer, (3) Digital Display, (4) Manual infrared remote controller (5) Auto power cut off when heater tripped over, (6) PTC heating element, ... In case you want Rpi control, you can use LIRC (Linux Infra Red Control) software (google or search "LIRC" in this forum.
    – tlfong01
    Sep 20 '19 at 2:27

One can find many more wirelessly controlled sockets in the market, nevertheless, there are also some based on control via Ethernet. Here is one example.

Typically they are more pricy than Wifi-controlled sockets. Depending on the modell they offer different interfaces for control (Windows application, web interface, ...). The one linked above for example host a webserver, which would allow you to control it with a Raspberry Pi or any other device inside your LAN.


What you're looking for is commonly called a solid-state relay (SSR.)

SSRs combine solid-state switching of AC power (via a triac) with optical isolation (between the control signal side, vs. the load side), so they're pretty safe if (and only if) you get one rated well above the voltage and current you plan to control. I'd suggest keeping to models with screw terminals for a beginner. For example, see http://powerswitchtail.com, though their products probably can't handle the current you'd need for a heater.

Suggest you learn wire up an LED+resistor to one of your RasPi's GPIO pins before attempting to control house current. And if you don't have a DMM, get yourself at least a basic/cheap one.


  • Heaters typically draw lots of current. (Mine draws 12.5 Amps on high setting.)
  • Many SSRs can't handle large, inductive loads.
  • Unattended operation of a heater is a potential safety issue.

There are relay modules which can be controlled by the Pi, BUT building your own, requires expertise and a knowledge of electricity wiring techniques and safety rules.

I strongly advise against this approach, although you will find many examples.

The cheapest, easiest and safest approach is to use one of the wireless remote controlled outlets. Again, there are examples of this, but probably more for Arduino than Pi.

An Arduino would be more suitable for such a project.

  • Is there any approach that's possible without a soldering iron?
    – Mason
    Sep 20 '19 at 2:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.