X10 and Home Easy with Node-RED

Some X10 and Home Easy modules
Some X10 and Home Easy modules

This is part of a series of posts I am doing describing some of the things I have been doing as part of the revamp of my home automation system.

When I started on the home automation road in 2002 I began with a kit of 3 X10 modules and a CM12U PC interface which I controlled via the command line X10 application Heyu and some DIY scripts, shortly afterwards I switched to the Perl based MisterHouse package which I heavily customised over the years and continued to use until recently.

Many more X10 modules were added over time giving me control of most lights in the house as well as several appliances. X10 has always had a few issues though, the modules are fairly costly although the clones available these days have improved that somewhat but the biggest issue has always been that it is susceptible to noise or interference on the mains line causing things to not turn on/off when asked or to turn on/off erroneously. As more and more electrical devices have been added around the house and with nearly every wall socket having a 4, 6, 8 or more gang adapter plugged into it these problems have only got worse.

With this in mind I’ve been gradually adding more and more Home Easy modules to replace the X10 modules that were causing problems and have now switched almost exclusively to Home Easy. Unlike X10 these modules work via RF so don’t have the same communication problems and they are very cheap, 3 appliance modules can be had for around £20 with a remote control, less if you pick them up second hand on eBay and being controlled via 433MHz OOK signals they can easily be controlled using an Arduino etc.

Continue reading

TinyTX & Tiny328 Sensors with Node-RED


Node-RED is currently taking the IoT world by storm, described as “A visual tool for wiring the Internet of Things” it is built on top of Node.js and is an open source project developed by IBM employees. It makes it easy to link various inputs and outputs adding simple or not so simple processing in between, just drop your various parts into a workspace and link them up. It also makes a great way to map MQTT topics to each other.

It comes with a whole host of input and output nodes, MQTT, http, websockets, serial, tcp/udp and it can read logs, write to files, call external programs, connect to databases etc. which make it possible to connect with just about anything you can think of. There is also built in support for services like email, Twitter, irc, Pushbullet and Twillio SMS.

To bring the data from my sensors into Node-RED I am using one of my Tiny328 boards running the Jeelib RF12demo sketch which is connected to a cheap FTDI adapter plugged directly into my server but this could just as easily be done with a JeeLink, a TinyTX or any Arduino compatible with an RFM12B radio. If using a Raspberry Pi then the RFM12Pi could also be used.

Continue reading

Wireless Sensor Battery Life 2 Years On

2 Years and still going strong
2 Years and still going strong

Back in November 2011 when I made my first ATmega328 based wireless temperature sensor node I did a rough calculation estimating that it would last 2 years or more on a couple of AA batteries. That first node was decommissioned after a few months but the second version, also based on an ATmega328 is still running and on the original set of batteries since 29 December 2011, exactly 2 years ago today.

That’s with an ATmega328P running at 16MHz with a RFM12B radio and DS18B20 temperature sensor powered from 2 x Energizer alkaline AA batteries (essentially the same as the new SMD Tiny328 nodes but built on stripboard) and is transmitting once a minute. The battery voltage is now down to 2.71V which is well out if spec for a 328 running at 16MHz but the datasheet specs seem to be very conservative and it is still ticking along fine. Previous tests showed that it should be good down to around 2.6V with the DS18B20, below that the sensor’s readings start to become erratic. Again, that’s a good margin less than the minimum of 3V stated in the data sheet.

Two plus years is inline with my original predictions but it is good to see it actually happen in the real world, particularly as this node started out on code that wasn’t quite as optimised for low power use and since I enabled ACKs at the end of August 2012 it makes quite a few retries (it is the furthest from the base station) so in reality it often sends more than once a minute.

Continue reading

Wicked Device WildFire Arduino Compatible with ATMega1284P and WiFi

Wicked Device WildFire
Wicked Device WildFire

Vic at Wicked Device kindly sent me one of their new WildFire Arduino compatible boards to try out. The WildFire uses the ATMega1284P microprocessor clocked at 16MHz and has an onboard Texas Instruments CC3000 WiFi module and a MicroSD card slot all on a board the same size as a standard Arduino Uno or Duemilanove.

Followers of this blog will know I’m a big fan of the ATMega1284P and it was what I used in my own OSWIN Arduino compatible board although that was with the huge 40 pin DIP version, the WildFire uses the 44 pin TQFP package making a much smaller board possible.

The ATMega1284P has quite a few advantages over the ATMega328 used in the Uno and Duemilanove, more RAM (16KB v 2KB), more Flash (128KB v 32KB) and more EEPROM (4KB v 1KB), things which really make a difference when doing web server type applications. There is also more I/O, on top of the usual array of pins found on the Uno/Duemilanove etc. the WildFire has 2 more analogue pins squeezed in next to the usual 6 and an extra 6 pin header provides 4 more digital pins as well as duplicates of the I2C pins and there is also a JTAG programming/debug header.  You also gain a second UART on D2 and D3 and an extra interrupt that means two are still available for use (INT0 on D2 and INT1 on D3) even though INT2 on D8 is in use for the CC3000 IRQ. All the available pins on the WildFire are at a 5V logic level with a couple of buffer chips handling the high/low conversions to the 3V3 parts (CC3000 and uSD slot).

Some of the pins are used for communication with the built in peripherals, namely D4 for the uSD slot CS, D7 for the MAC chip data, D8, D9, D10 for the CC3000 and of course D11,D12,D13 are the SPI pins used for the uSD slot and CC3000. The WildFire library allows you to easily create an object to make sure these pins are initialised in a safe state.

Continue reading

Ikea Oleby Motion Activated Light Hacking with the TinyTX

Reassembled Oleby
Reassembled Oleby

Nick was kind enough to send me one of these little Ikea cupboard lights that he had the great idea of adding one of my TinyTX sensors to. These motion controlled LED lights are only £5 for two and are available in a range of colours, they are only 7.5 x 6.5 x 1.8 cm with 4 LEDs, a PIR detector and run from 3 x AAA batteries.

This is an excellent find and the size is spot on for the TinyTX, by removing the four LEDs (or just three of them) the TinyTX 2 or 3 will fit in nicely (with the ATtiny84 soldered directly to the board for a reduced profile) and the PIR control board will happily run on only two AAA batteries so we can bridge the third one leaving space for the antenna and maybe a sensor or two. It makes for a much neater and more compact occupancy sensor or room node than the Airwick iMotion Freshmatic that is commonly hacked for this purpose.

Continue reading

Tiny328 PCB Give Away

tiny328_zaraZara from Germany has been in contact to say he has had some of my Tiny328 wireless Arduino boards made and has some spare PCBs that he would like to give away so if you could find a use for a small wireless Arduino compatible or two and can handle a bit of SMD soldering then this is your chance.

These boards have been nicely panelised with two per board as pictured, to complete them you will need to separate them yourself and you will need the following parts along with the ability to solder the SMD components. This can be done using the reflow method or with a fine tipped soldering iron as Élio has done with his.

Additional components you will need:
1 x ATMEGA328P-AU Microcontoller
1 x SMT ceramic resonator 16.0MHz
1 x Microchip MCP1700T-3302E/TT 3.3V SOT23 LDO Regulator
5 x 0603 0.1uF ceramic capacitors
1 x 0603 1uF ceramic capacitor
1 x 0603 10uF ceramic capacitor
1 x 0603 10K resistor
2.54mm male or female headers as required

And if you want to add the optional wireless transceiver:
1 x Hope RF RFM12B/Alpha TRX433S or a Ciseco SRF
Wire for the antenna, eg. 0.6mm solid core (165mm for 433MHz, 82mm for 868MHz)

Zara says he is willing to post some of these to up to five people anywhere in the world free of charge so if this sounds like something you would use please post a comment to that effect below and I will send him details of the first five (don’t post your address, I will email you for that so make sure the email address you use to comment is valid).

Huge thanks to Zara for this very kind offer.


Adding a wireless PC Link to the Vichy VC99 Multimeter

Vichy VC99 with wireless serial link
Vichy VC99 with wireless serial link

The Vichy VC99 is an inexpensive 6000 count multimeter with pretty decent performance compared to some others in the same price bracket, one really nice thing about it is that it is very easy to add an RS232 output as described here, just a case of soldering a wire to an unused pin on the processor. Of course it makes sense to isolate the meter from your PC, usually this is done with an opto coupler as in that link and I’ve also seen people using infrared LEDs but I thought I’d go one step further and make it a radio link using a Ciseco SRF in the meter and a SRF-Stick at the receive end so I can still record data without being physically near the PC.

It’s all very simple to set up thanks to the SRF transparent serial mode. First you need to temporarily connect the SRF to a PC via a serial adapter of some sort and use the command mode to set it to 2400 baud then it is just a case of soldering a wire from the serial output on the VC99s processor to the DIN pin on the SRF and connecting power. The PCB in my meter is slightly different to the one in the article above and VCC wasn’t available in the same place so I used the upper connection to the buzzer which is VCC only when the meter is on, for the ground I just connected where the battery connection goes in. I used one of my RFM12B breakout boards to make soldering to the SRF a little bit easier but it’s certainly not necessary.

Continue reading

Tiny328 – A mini wireless Arduino clone

The first Tiny328 successfully reflow soldered

So here is the reason for the last couple of blog posts.

This is my first venture into designing an SMT board and apart from the practice run I did with some breakout boards it is the first time I’ve attempted to solder anything as small as a TQFP package or the tiny 0603 passives (1.6 x 0.8mm) used here. It’s something I’ve been wanting to try for a while and I’m happy to report that it all went well and yes, you can definitely solder these things at home with a minimal outlay.

ATmega328 + RFM12B * TinyTX = Tiny328

The original TinyTX wireless sensors were named as such due to the use of the ATtiny microcontroller rather than because they were tiny, this one uses the ATmega328P but the Tiny name still seems to fit as at only 23 x 36 mm its actually slightly smaller than both the previous TinyTX PCBs. So Tiny328 it is.

The idea behind the Tiny328 (apart from the intro to SMT) was to make something that is as small as the TinyTX but with a lot more I/O and full Arduino compatibility without any messing around with different cores or USI implementations of SPI/I2C. I went through several design iterations with this board, originally starting with a square board with the I/O pins around all four edges but eventually decided on something more like the Arduino mini, Teensy or Moteino designs with the I/O pins down the long edges spaced so that it is breadboard and stripboard friendly which makes it a lot more universal. Other than a (to me) more sensible pinout than the mini the other main differences are the use of an external FTDI adapter instead of an on board FTDi chip (keeps it simple and low cost) and on the bottom side of the board is a footprint for an optional RFM12B/Alpha TRX433S or Ciseco SRF transceiver. With those decisions made the final size sort of dictated itself and it couldn’t really be any smaller than it is without making compromises somewhere.

Apart from the requirement for a separate FTDI programmer the Tiny328 can pretty much do everything that an Arduino Duemilanove or Uno can do as all the pins are broken out to the standard 0.1″ spaced headers and by using the standard Uno bootloader it is fully compatible with the an unmodified Arduino IDE.

Continue reading

DIY Vacuum Pick Up Tool for SMT Components

DIY Vacuum Pick Up Tool
DIY Vacuum Pick Up Tool

To make fast placement of small SMT components easier I wanted a vacuum pick up tool. I bought one of these basic manual ones for £1.72 and it works OK for the money but as it doesn’t have a continuous vacuum it can unexpectedly drop the component if you aren’t careful. Something better was required.

I’d seen that other people had constructed their own using aquarium pumps, nebulisers etc. so I dug out a cheap and nasty aquarium pump that I already had but its design made it too hard to reverse the operation, the part where the valves are is all moulded so it wasn’t possible to reverse them and getting to the inlet port wasn’t possible without destroying the whole thing as it was heavily glued. I attempted to seal the case the case and add an inlet to that but it was leaking like a sieve.

So the really basic ones are best avoided but the second attempt with a Hidom HD-603 was much more successful and still not expensive at only £9.75 on eBay. This one is of a much higher quality and the valve assembly can easily be removed and turned round so that the inlet and outlet ports are reversed. It even has a dial to control the pump rate which may or may not come in handy. It’s also a lot quieter than the other one which is a bonus.

Continue reading

Reflow soldering with a domestic hot plate

Breakout boards to practice on
Some breakout boards to practice on

I’ve been working on some all SMD PCB designs that include TQFP chips recently and although I’ve hand soldered a few SMD capacitors and resistors before I’ve never soldered any SMT ICs so I thought I should get some practice in. I know people say you can solder even TQFP chips by hand but I don’t have the dexterity, eyesight or patience for that so some sort of reflow method was required. The common hobbysist method you see for reflow soldering is using a toaster oven but an alternative method is to use a hot plate, in fact a lot of people prefer the hotplate method to the toaster oven citing better control of the end result as you can see when the reflow occurs and it avoids problems where plastic connectors are involved where the all round indirect heat of an oven can start to melt the plastic before the solder flows properly. There are actually hot plates purpose designed for this but I saw that lots of people had used ordinary domestic hotplates and you can even do this on your ordinary electric hob if you have one, mine is gas though so I ordered one of these cheap single plate electric hobs along with an IR temperature gun to keep an eye on the temperature, total cost under £22, not bad at all. To practice on I ordered 8 pin and 16 pin SOIC chips and a 44 pin TQFP ATmega32U4 along with some breakout boards.

The first thing you need to do is apply some solder paste to the pads for the components. In the case of resistors, capacitors etc you just need to dab a bit on each pad and I found a toothpick was a good application tool. For ICs you probably won’t be able to apply paste for each individual pin but it is OK to apply it across them all together as when the the solder reflows the capillary action will draw it towards each pin so hopefully you won’t be left with any solder bridges. If you do get some solder bridges they are easily dealt with later using some desoldering braid.

Continue reading