Arduino-Project-Home-Monitor-Control
Arduino-Project-Home-Monitor-Control
5
Project description
To Cayenne Community: Comments, suggestions to terry@yourduino.com
This project uses a YourDuino RoboRED (or Arduino UNO With Sensor Shield) to monitor the temperatures in a home. This is especially useful for people like me who live in rural Vermont and heat mostly with wood, with a small backup propane furnace. When I travel for several days it's important to be able to remotely monitor temperatures and make sure the furnace works and the house is not freezing!
UPDATE: This has been rewritten for the current MQTT Cayenne system.
OBJECTIVES:
- Quick and Easy to build electrically and mechanically
- Easy creation of good graphical interface online
- No need for opening router ports, manual network configuration
- User defines widgets for online page
- Free for personal use
- Measure temperatures:
- Outdoor
- Indoor / Living Room
- Cellar
- Remote control of furnace to increase temperature before arriving home :-)
- Remote control of two relay-operated 5000W electrical heaters if necessary or furnace fail.
Building the system
It took about 10 hours to build and program the basic system and get it online. Physical build was simplified and will be shown below.
NOTE: The code below used the DS18B20 library function " sensors.getTempFByIndex" So you will have to identify each sensor by touching it to see which one changes.. Later we will show how to use address-identified DS18B20's so sensors are pre-identified.
Internet Of Things:
The secret to the easy online interface is the system created by mydevices.com called Cayenne. The user interface can be a browser online from anywhere, or Apps for Apple IOS or Android for mobile use. We'll walk through the electronics and physical build and the Cayenne interface builder. This assumes you have an internet connection and an ethernet port on a router or switch.
To avoid metalwork and allow quick but secure construction I used a 5 by 8 piece of 1/4 inch plywood as the base. See THIS PAGE for details of this approach. Here's what it looked like starting out:
Parts Used:
- Yourduino RoboRED (Arduino UNO Compatible) with easy-to-wire 3-pin connectors on every I/O pin.
- A 5 by 8 inch piece of 1/4 inch plywood as the base
- #4 by 3/8 Inch small wood screws and Velcro to attach modules
- A W5100 based Ethernet module
- "Rainbow" cable (7 wires used to connect Ethernet Module)
- 3-wire cables that plug into the RoboRED
- A 3-wire cable-to-terminal strip block
- Three waterproof DS18B20 temperature sensors: 1 with 1 Meter cable and 2 with 10 meter cable
- A bright LED module for testing control operation
- A 4-channel opto-isolated relay board to:
- remotely change furnace temperature setting
- remotely turn on 5000 watt electric heater in Kit Build area
- remotely turn on 5000 watt electric heater in Shop area
- Spare Relay Channel
- 40 feet of twisted-pair cable (I used ethernet cat-5) going to remote relay for furnace and heater contactors.
- Ethernet cable reaching to your router or switch
- 9V 1A plug-in power supply for Arduino
- 5V 1A plug-in power supply for opto-isolated relay
Physical Construction:
Here are some construction views:
On the left you can see two marks where my small phillips screwdriver was used to locate the two screws that will hold the terminal module in place.
The plywood was hit with sandpaper on the edges for 60 seconds and 2 holes were drilled to screw it to a wall. Here you see the RoboRED screwed down to the base. The ethernet module is at top right of the photo. Upper left is a bright LED module for testing. Lower right is a terminal strip module used to connect to the DS18B20 temperature sensors. Everything just plugs together except the temperature sensor cables were soldered to be secure.
On the right is the completed system mounted on the end of a bookcase. The Rainbow cable makes it easier to get the ethernet module connections right, and the 3-pin cables plug in the LED and Terminal strip. At the lower right the three temperature sensor cables are held in place with staples (could use a cable clamp). The DS18B20 sensors are just connected in parallel and have a 5K pullup resistor from 5V to the signal pin. The 9V plug-in power supply is connected to the usual Arduino External Power connector. I already had holes going down to the cellar for other cables and a small plastic conduit to the outdoors for the outdoor sensor. The livingroom sensor is looped just at the top of the photo.
The online internet screen looks like this (below)
SEE LIVE ACTION OF SCREEN (READ-ONLY, Sensors Only, no control allowed!) CLICK HERE
Arduino Sketch Code
Cayenne builds most of the Arduino code. Below is the version running now. Cayenne allows you to add widgets to your dashboard to control any Arduino digital I/O pins . The "pushbuttons" can be clicked to turn the Red LED or the Furnace or the 5000W electrical heaters On.
Steps:
NOTE: To be updated!
0. Install the Cayenne Library (http://mydevices.com) from the Arduino Library manager.
1. Install the OneWire library (http://www.pjrc.com/teensy/td_libs_OneWire.html) from the Arduino Library Manager.
2. Install the DallasTemperature library (http://milesburton.com/Main_Page?title=Dallas_Temperature_Control_Library#Code.2FLibrary) from the Arduino Library Manager.
3. In the Cayenne Dashboard add new DS18B20 widgets.
4. Set the widgets to Value Display.
5. Select Virtual Pins and virtual pin numbers.
6. Set VIRTUAL_PINn to the pin numbers you selected.
7. Attach DS18B20s to a digital pin on your Arduino.
Schematic:
[Ground] -- [DS18B20] --[Digital Pin]-- [4.7k resistor] -- [5V]
8. Set the ONE_WIRE_BUS_PIN constant to match the pin used to connect the DS18B20.
9. Set the token variable to match the Arduino token from your own unique Dashboard.
10. Compile and upload this sketch.
11. Once the Arduino connects to the Dashboard it should automatically update the DS18B20 widget with data.
12. Add widgets (generic digital I/O) for Furnace ON, 5000Watt Heater#1, 5000 watt Heater#2, Spare relay
NOTE: A project must be online and running to add/edit widgets
13. Drag/move onscreen widgets as you wish


