Thursday, 11 May 2017

Wireless things sensors after 1 year

The full graph of all sensors.

The external sensors voltages decreased, but appear to have levelled off. This is probably temperature related.
Conclusion: Wireless things temperature sensors are/were great value and the battery life is greater than 1 year from a CR2032.

Saturday, 20 August 2016

Wireless things temperature sensors CR2032 battery voltages 2 months on.

Update post to house of the future

This is an update on the temperature sensors we are using to replace ESP8266s:

The temperature sensors are reporting in well and the voltages appear to be stable. We suffer from intermittent inteference outside, possibly due to neighbours using 868MHz weather stations. When this happens, the temperature sensor is brought indoors and can be seen to connect. It is then returned outside.

Temperatures after 2 months using the Wireless things sensors

 Reported battery voltages after 2 months

Saturday, 9 July 2016

Wireless things temperature sensors, LLAP and the house of the future.

ESP8266 Woes

I have spent a large amount of time trying to get the ESP8266s to sleep. I have this problem:

I've tried to ground the pins as discussed in that thread. Given that the batteries last two to three weeks, the debugging is frustratingly long. I wanted to look at other alternatives.

The Alternative

I looked again at Ciseco's / Wireless Things range again. They are powered by a CR2032, and cost £10 - slightly more expensive than an ESP8266, but are boxed, reliable and portable:
This is attached to a Pi and is used to convert the 868MHz LLAP output to HTTP requests.

Django then places these into redis entries for use by the thermostat. These work really well, are very easy to setup and very simple to integrate.

Here are the output voltages for just over two weeks:

Here are the temperatures over this time. There are 6 Wireless things sensors: Attic, Barabbas, Damocles, Icarus (inside) and Eden, Heimdall (outside). Forno is a TMP102 sensor attached to a Raspberry Pi inside a metal cased CCTV camera and so gets artificially hot.

I will post further results after a few months.

Monday, 15 February 2016

Splitting mbox into individual mails

Splitting an mbox format mailbox into individual mails:

formail -ds sh -c 'cat > msg.${FILENO}' < incoming_mbox_fle

Tuesday, 3 November 2015

Update to the Central Heating System (using ESP8266 as remote sensors) and removing Google calendar.

Main processes interaction in the PiThermostat code.
We have recently updated the Raspberry Pi based Thermostat as discussed in previous posts and shown in a YouTube video. The idea is to move away from using multiple Raspberry Pis as networked temperature sensors, but use one central Raspberry Pi and serveral  ESP8266s instead. This can bring the price down to £6 if buying generic ESP8266s. The ESP8266 connects via WiFi to Django running on a central Raspberry Pi performing an HTTP request with the temperature and it's MAC address. The MAC is translated into a named temperature sensor reflecting the room location (e.g Attic/Living Room/Cellar) and given a weighting based on how important the room is deemed to be (cellar would be 1, a living room would be 5).
Django interface for adding ESP8266s. Multiplier is the weighting for the weighted mean calculation, Location is inside or outside and changes only the appropriate weighted mean and the ExpiryTime is how long a temperature reading will last in the weighted mean calculation without an update. If the battery were to go flat on Goliath, then 1 hour after the last reading Goliath would be dropped from both the weighted mean calculation and the front end display.  

Raspberry Pi with TMP102 mounted (4 wires going to the right angled header at the back of the board). The generic 433MHz sender board is the red unit with the vertical yellow 15cm aerial .
The code is available from Raspberry Pi itself has been moved to a generic 433MHz transmitter as Noisepower are no longer producing boards. Code for the 433MHz transmitter is available from Github. Google Calendar is no longer used as the calendaring mechanism - Django happenings is used instead.
django-happenings based calendar. Each time period during a 24 hour window is assigned a Temperature. If there is no user override, then the Required Temperature will be taken from this calendar.

Interface running on an iPad.
Interface running on a Wall Mounted Android device. Note that the screen auto-refreshes every 60 seconds for this particular interface.
The layout has been considerably revised, to make it simpler and more logical (buttons are always Red or Yellow), internal information is blue, external information (garden temperatures are green). It has been verified as working on both Android phones and tablets, iPads and on the Raspberry Pi official display.
ESP8266 running from LiPo battery (18650). Note the ESP is in Deep sleep as the LED is dimly lit. This photograph shows the Adafruit Huzzah ESP8266 development board, but there is no reason that NodeMCU boards could not be used (£5). In addition, we are investigating moving to cheaper temperature sensors (DS18B20) which are available for 50 pence each
The associated image shows the ESP8266 running from an LiPo battery: The code is programmed for the ESP8266 to sleep for 15 minutes (indicated by the GPIO0 LED being very dimly lit as seen in the attached photograph), wake up, request and IP address and send an HTTP request to a hardcoded Web server - - [03/Nov/2015:09:13:47 +0000] "GET /checkin/18:fe:34:fd:8b:24/temperature/17.1875/ HTTP/1.1" 200 636 "-" "-"
The code can be found in Github - The battery life is estimated to be 6 months, but I will verify this accurately and publish the results here.

 By bringing the price to monitor a room down to a reasonable value, multiple rooms will be able to be monitored cheaply. The front and back end code has been updated to allow sensors to appear and disappear randomly. For example the Internal/External weighted mean values are generated based on the total number of sensors found in that particular iteration.

During the simple setup, each sensor has to be assigned a weighting and this is easily performed via Django. As a sensor reports into Django/Redis, the weighted mean is adjusted (via and the interface displays the calculated value. Should a sensor not exist, then redis will expire that sensor value after one hour (configurable in the Django setup as shown) and the now historic values will not be used for the weighted mean. This means that an individual sensor is entirely expendable. Once the battery is flat and then gets recharged it then performs it's first HTTP request and will automatically get re-added into the weighted mean.

ESP8266 in a Wireless Things case. Battery is inside. TMP102 is mounted on the outside of the case.

Tuesday, 7 October 2014

Guest post: Designing a house of the future past

Today's post written by HB Cranky, who has spent 18 months designing a house of the future with some software input from Lunarlite.

Heating in Winter

As shown by Nest and Hive, it is a common desire to have more control over home heating. In conversation with a friend in 2013 about the potential of nest (this was pre British Gas announcing hive) it was speculated on the potential of doing a low cost version. Both of our houses already utilised a wireless thermostat and so it was a question of whether we could (cheaply) replace them with something that would give us greater flexibility.
The first question was whether we could decode the signal being sent from the therm to the receiver:

Drayton (Old Thermostat) for boiler control. We sniffed this using a £0.99 433 receiver, two resistors and Audacity.
British Gas rebadged Drayton set. We also sniffed these.
We initially used audacity with a line in and a couple of resistor and listened to the broadcasts: , subsequently we discovered that a dvb tuner would do the same job.
It was discovered that the boiler control was relatively simple, namely either on or off sent to it every 5 minutes - the receiver would alarm otherwise. The signal itself was also simple, and we quickly progressed to constructing a new transmitter that would give us greater control.
Main requirements:
To gain any benefit over the existing thermostat the replacement would have to be more flexible. For it to be of use the following was required:
Remote control of temperature - via a web page / app
'Holiday' mode
Intelligent heating - based on external and internal temperatures.
The Central heating ideal temperature is stored in a Google calendar to allow the house temperature to be dictated.
The LCARS web interface is accessible from outside the house using port forwarding.
433 in-situ Transmitter board attached to Raspberry Pi

New Thermostat in situ
New Thermostat - Pygame based interface, based on Galilean Thermometer. The Right hand control sphere controls the temperature.

Bob Dobbs appears when the heating is on.
Thermostat LCARS (web) interface. Written in Django. The left two columns display temperature readouts (Attic, Barab and Cellar are inside, Eden and Forno are in the garden).

We use redis to record all the temperatures, queue up the boiler commands and work out how often we need to talk to the boiler. A Django front end provides an interface into the important redis values.

Cooling in Summer

Once the heating had been covered, we had the opposite problem in Summer. How to cool the house automatically. Given that when Velux windows are installed, a remote for each window is provided, there are 3 remotes for only two adults. We asked ourself what we could do with them. Velux use the io-homecontrol which is a proprietary two-way encrypted protocol. When attacked, techies always route around the damage. We decided to solder a load of relays to the remote.

We called this product velpi.

VelPi. Pi powered velux remote control.
Velpi during construction
with all boards exposed. Raspberry Pi in bottom right, 433 sender board to the left with Ciseco Slice of I/O on top. Sainsmart relay board above (blue), soldered PCB for cable sanity and finally bare VELUX remote. Individual buttons can be seen soldered.

Velpi: Much neater when the top perspex plate goes on

Switching on/off Garden features using 433 sender board

So what happened to the original plan of using the 433 sender board to power on/off the garden features? . The same 433 transmitter is being used (with a set of queueing commands in redis) to either send commands to the boiler or to switch on the monolith or the deck lighting. At Christmas time, extra plugs are used to switch on/off lights.
Energenie 433 receiver which switches on / off individual sockets.

More information and source code

Monday, 31 March 2014

Boldport's tiny engineer superhero kit

I have followed Saar Drimer and his company Boldport on since I got my Wuther from Wuthering Bytes last year:
Boldport's Wuther

It's an ATTiny85 on a beautifully designed PCB made for the event. Boldport are doing really exciting things with PCB design, building a free software stack called PCBmodE to design electronic circuit boards. Currently PCBs are designed using proprietary/free as in beer (but not speech) or platform limited software. I'm not sure that's particularly healthy for the maker community to thrive.

To help support Boldport and their vision, the easiest thing to do is to buy their wonderful design/art/engineering.

Here is my soldering up of the tiny engineer superhero emergency kit

Great little case for the kit.

Easy to follow instructions.

Tools for the job. I ended up not needing the vice, since I bent each leg before soldering and laid it on the floor.

Includes a sponge. I didn't use mine, since I wanted to keep it dry for an emergency.

PCB, Two resistors, LED, MOSFET and a capacitor. The only component missing from the kit is the line of solder to make the circuit board complete which is not included.

Circuit board before line of solder added. Note you have to solder a line of solder into place. This is not easy with a great big soldering iron. Much better to use a fine tipped iron.

Tweezers were required. Note the line of solder at the top of the PCB.

It's alive.

This is a great little kit, for that special Engineer in your life. Thanks Saar for your inspirational work.