Smart Wall Outlet

Description

Using the mbed, a DHT11 Temperature sensor, an ESP-8266 Wi-Fi Module, a 4 channel relay board, an IR motion sensor and a light sensor, the following was accomplished.

  • Control Outlets' ON/OFF functionality via a web interface.
  • Enable thermostat control of a single outlet to enable AC Units, space heaters or fans to be selectively activated depending on room temperature.
  • Enable motion control of a single outlet to enable devices to be turned on after motion is detected. This could save energy by only using devices when someone is in the room.
  • Enable light control of a single outlet to turn on a single outlet based on the lighting in the room.
Group Members: Alex Davidson, Thomas Pettet and Alex Brumfield

Source Code

Import programSmart_Wall_Outlet

Demo code for a Wi-Fi controlled wall outlet that monitors light intensity, temperature, and motion and can control which plugs are supplied with power based off of user preference.

Video of Working Prototype

The two videos were recorded at the same time. The video to the left shows the website that sent data to the bed to control the power outlet. The video to the right shows the working wall outlet responding to the website.

Pin Hookup Guide

ESP-8266 Wi-Fi Module

mbedESP-82663.3V Power Supply330uF Capacitor
GNDGNDGND(-)
VccV+(+)
p26RESET
p28(TX)RX
p27(RX)TX
VoutCH-PD

Note: Vcc connection for ESP-8266 must be powered by an external supply. The mbed's internal 3.3V supply cannot provide the power necessary for Wi-Fi Transmissions. Also a 330uF decoupling capacitor should be connected across the Vcc and GND lines of the Wi-Fi module to prevent sudden voltage drops.

DHT-11 Temperature Sensor

mbedDHT-11
GNDGND(-)
p21Signal
VuVcc(+)

Note: p21 or Signal line must have a 4.7k-5.1k pull-up resistor connected to 5V.

4-Channel Relay Board

mbedRelay Board5V Power Supply
GNDGNDGND
VccV+
p22IN1
p23IN2
p24IN3
p25IN4

Note: Each relay will be also connected to AC Power Cable (HOT) and each Outlet (HOT) terminal. Note: An external 5V power supply is recommended to support the current draw from the relay board although the mbed's Vu(5V) pin may work.

AC/DC Current Sensor

mbedCurrent Sensor
GNDGND (-)
p20Signal
VuVcc (+)

Note: The AC/DC Current Sensor must be connected in series with Relay 1 AC (-) and Outlet 1 (HOT) terminal. This will allow the current sensor to measure how much current is flowing through Outlet 1.

Motion Sensor

mbedMotion Sensor
GndGnd
5vVcc
p30S

Light Sensor

mbedLight Sensor
GndGnd
GndAddress
p27SDA
p28SCL
3.3VGND

Speaker

mbedspeaker2N3904
-C
GNDE
p21B (connected by a 1k resistor)
3.3V+

Images

Below is a bird's eye view of the breadboard and power outlet. /media/uploads/abrumfield6/4180_layout.jpg

Below is a side view of the breadboard to have a better view of the motion sensor and light sensor. /media/uploads/abrumfield6/4180_side_view.jpg


Please log in to post comments.