Other blogs on this project:
Forget Me Not Design Challenge Week 04: Tektronix TBS1052B-EDU Oscilloscope
Forget Me Not Design Challenge Post 05: EnOcean EOP-350 Universal Programmer Board
Forget Me Not Challenge Design Challenge Post 06: Cadsoft Eagle Schematics
Forget Me Not Challenge Design Challenge Post 07: Door Lock Monitor
Forget Me Not Challenge Design Challenge Post 08: Soldering Iron Monitor
Forget Me Not Challenge Design Challenge Post 09: Soil Moisture Monitor
Forget Me Not Challenge Design Challenge Post 10: Cat Feed Monitor
Forget Me Not Challenge Design Challenge Post 11: Project Summary
We live in a 100+ year old Victorian house in NJ. We made some major improvements and upgrades to our home over the last 20 years in an effort to try make it more comfortable, more functional, and most importantly more energy efficient. These upgrades have included electrical, lighting, plumbing, heating, cooling, and home entertainment systems. All these systems are separate and controlled individually. The Eclipse SmartHome and openHAB design philosophy really resonates with me by allowing me to integrate many different sensor and control systems together on my local network. This approach alleviates the complexities of having to work with different sensors and controls across different cloud networks or having to deal with sensor failures when my WAN goes down.
The Raspberry Pi (RPi) is a wonderful platform to base a home control system on due to its small size, low power consumption, and it runs Linux. It’s a very powerful combination. I’ve been having lots of fun experimenting with a RPi since late March 2014. I would like to learn how to bring the RPi, EnOcean sensors, and the Eclipse SmartHome and openHAB together to better manage the resources and save energy in my home. The Forget Me Not Challenge is a perfect way to get started.
Did I leave the Door Unlocked?
For this part of the challenge, I’ll use a modified magnetic sensor module STM320U and a magnet glued to the lock bolt. The modification involves removing the reed switch from the STM320U and adding wires to connect it so that the reed switch can be inserted into a hole that is drilled into the molding and frame (see Figure 1). This hole will place the reed switch almost in contact with the bolt when the door is locked. When the bolt is in the lock position the magnet will activate the reed switch indicating the door is locked. When the door is unlocked the bolt will be far enough away from the reed switch so that it is not active. The magnet on the bolt must be thin so as not to interfere with the striker plate when the door is not locked. The STM320U in the plastic housing will be mounted on the door frame molding to cover the hole and the wires. Painting the housing the color of the molding would help make the module blend in and make it less noticeable.
Figure 1
Did I leave the iron on?
For this question, I plan on using the STM332U temperature monitors connected to an external thermocouple attached to the analog inputs of the module. As an initial test of this concept, I placed a K-type thermocouple close to the soldering iron stand to get an indication that it is on (see Figure 2). A more precise placement should provide a good measurement that the iron is hot.
Figure 2
The STM332U temperature modules would be mounted on each soldering stand, as shown in Figure 3.
Figure 3
Figure 4 shows the details of how the K-type thermocouple (WTJ-6-12 or WTK-6-12) will be mounted. It will be bolted to the “bottom shelf” of the stand using a ceramic spacer and a metal stand-off. The ceramic spacer should keep the plastic part of the shelf from getting too hot. The metal stand-off acts to conduct heat from the soldering iron to the thermocouple. The thermocouple will be soldered onto the pins of the analog input (ADIO0 pin 9 and GND pin 5). This connection is not a proper thermocouple connections so a temperature error is expected. Since this is just a coarse heat detection it should not be a problem. The proper temperature threshold showing when the iron is off or on will therefore need to be determined and set in software. The thermocouple approach does not require any power from the module and provides only a very small voltage. This output might be too small for the analog input, so I looked for a thermocouple amplifier, and could not find one that ran on 1.8V during my brief search. If this turns out to be the case, then I would do a more detailed search for a thermocouple interface board or replace the thermocouple with a NTC thermistor and a resistor connected as a resistor divider. The resistor divider would be connected between SWPWR (pin 8) and ground (pin 5). The center pin of the divider would be connected to the analog input (ADIO0 pin 9). The thermsitor placement would need to be set so the temperature of the thermistor does not exceed 150C.
Figure 4
Did I feed the Cat?
I think this is the more interesting part of the challenge. According to Catster.com, an eight pound adult cat requires about 240 calories per day (30 calories per pound of cat). This corresponds to two 3 oz (85 g or 0.19 lbs) cans of wet cat food or 4/5 of a cup of dry cat food (~190 g or 0.42 lbs) a day. A STM332U module will be attached to a Force Sensitive Resistor (FSR) to measure the “weight” of the cat food in the bowl (see Figure 5). A standalone capacitance sensor module (AT42QT1070 Adafruit) will also connect to the STM332U module and to a metal food bowl to detect when the cat actually eats. The capacitance around the bowl will change when the cat is near it. The FSR forms a resistor divider that is connected between SWPWR and ground, and the center tap of the divider is connected to the analog input. Initial tests indicate that much testing and calibration is needed to determine the analog voltage thresholds indicating a full bowl. I’m looking forward to learning how to integrate information from both inputs together using the SmartHome software to create an alert that the cat ate something.
The platform, feet, and base will be made from laser cut plastic. I plan on describing how to create the parts using the open access illustration tool Inkscape and the personal factory Ponoko.
Figure 5
Figure 6 shows the initial tests using the FSR with three nuts as feet, the top of a CD jewel case for the platform, a metal cup for the bowl, a DMM, an AT42QT1070 cap module in standalone mode, and an Arduino to supply power to the cap module. For the force measurements, with the metal cup the FSR registers 30.7k, and then 14.1k when 3 oz of water are added to simulate cat food. When the water is removed from the cup and placed back on the test platform, the FSR resistance registers 22.1k, so it did not return to very near its original value. The FSR resistance is very sensitive to the location of the nut so some of this variation may be reduced when the parts are fixed in the assembly shown above. Finding good threshold value set points indicating food and no food condition will require some testing and calibration effort and will be used to set alarms using the SmartHome software.
The capacitance sensor works very well with just a single wire attached to IN0, but it is too sensitive when the wire touches the metal cup as it is intermittently or always on. The datasheet indicates that this sensitivity can be reduced by adjusting the input resistor and the capacitor Cx, and including guard rings round the touch input.
Figure 6
Did I water the plant?
For this question, a STM332U temperature module with a humidity sensor HSM100 would be used. The STM332U and humidity sensor would be connected together and placed in a modified housing or clear plastic box if the housing is not available. A hole would be drilled into the back of the housing and a small plastic tube would be glued into place (see Figure 7). The tubing has holes drilled into it and is placed into the soil. Moisture from the soil travels into the tube through the holes and into the box containing the humidity sensor. Humidity levels and thresholds would need to be determined so that alerts can be sent out indicating that the plant needs water.
Figure 7
The following Bill of Materials (BOM) has been identified to date. Items may be added, deleted, or changed throughout the course of building and learning more about the sensors, components, and operation of the proposed monitors.
Item | QNT | Description |
|
| Did I lock the door? |
1 | 1 | STM320U Magnetic sensor module |
2 | 1 | Wire |
3 | 1 | Reed switch (backup) |
5 |
| Magnet |
|
| Did I leave the Iron on? |
5 | 2 | STM332U temperature sensor module |
6 | 2 | WTK-6-12 or WTJ-6-12 thermocouple |
7 | 1 | Ceramic standoff or washer kit |
8 | 1 | Screws kit |
9 | 1 | Metal standoff (kit) |
|
| Did I feed the cat? |
10 | 1 | STM332U temperature sensor module |
11 | 1 | AT42QT1070 module |
12 | 1 | Force Sense Resistor (FSR) |
14 | 2 | Laser cut plastic sheets (Ponoko) |
|
| Did I water the plant? |
14 | 1 | STM332U temperature sensor module |
15 | 1 | STM 100 Humidity sensor |
16 | 1 | Housing or clear plastic box |
17 | 1 | Plastic tubing |
|
| Raspberry Pi Accessories |
18 | 2 | SanDisk Ultra 32 GB MicroSDHC flash memory card |
19 | 2 | Miniature WiFi (802.11b/g/n) Module |
All the components should talk together as part of an integrated networks, as shown in Figure 8. The four monitors made up of five sensors communicate over a 902 MHz radio link (in the USA) with the EnOcean Pi that also runs the FHEM home automation server software. The FHEM server collects the sensor data and provides a browser interface for configuring, controlling, and monitoring of the sensor network. Any devices with a web browser can communicate with the EnOcean Pi and the FHEM server over a Wi-Fi network.
Figure 8
Lastly, the Tek scope will be used to verify operation and troubleshoot problems with the components during the build as needed. A USB connection between the scope and a laptop allows for control and data capture of signal being measured. The TBS1202B-EDU is the education version of the scope and comes with courseware software that allows a professor to develop a lab that students can load into the scope. This is a very interesting feature and I’m curious to see how it works.
To learn more about me please see my bio on LinkedIn, tweets on Twitter @0brane, my tutorials on YouTube, and my blog on the RPi and Mathematica.