A look at Nick Andrew's electronics projects
View ProjectsNick Andrew founded Zeta Internet, one of the first Australian Internet providers. As well as electronics design, Nick does cloud computing, Linux system administration and perl programming. Nick runs ausadmin, which administers the USENET newsgroups for Australia. Nick is a strong Linux advocate, as well as a proponent of distributed, fault tolerant computing infrastructure.
This device provides keyless entry through a door using an RFID card, tag or implant. Unlocking is done with an electric strike mounted behind the door. All access attempts are logged through a ZigBee wireless network. The door can also be unlocked remotely through the network. This project was implemented as an RFID shield which plugs into an Arduino. The shield implements an XBee ZigBee transceiver, solid state switching for the strike, and 12 volt battery backup.
This device supports a set of digital temperature sensors connected on a bus, using the Maxim OneWire protocol. It is controlled by the ATTiny85 microcontroller, which I programmed in C. An attached XBee device broadcasts the temperature readings of all devices to a ZigBee wireless network every 30 seconds.
I have open-sourced two libraries from this project:
The only required wires are power (+5V, from, say, a USB port or USB plug pack). There is one onboard temperature sensor and up to 8 additional sensors may be attached to the 2 or 3-wire bus.
The ATTiny85 is indeed a "tiny" device, having only 8 pins including power and ground. The chip can run at 20 MHz with no external components and includes hardware PWM and timers but no UART. Programming down to the bare metal is necessary to get much out of this chip, but it is worth it in the end.
The lack of UART makes communication with other devices tricky. Serial interface libraries I have seen for this chip use tuned loops to get the bit banging timing approximately right, but this is an inferior solution as interrupts must be disabled during the very long (1ms) byte time. So I developed an interrupt-driven device driver for serial which uses the inbuilt timers to provide predictable bit timing while the main code is doing something else. I think this is the first time anybody has done this on such a small chip.
The library has been open sourced here: Serial interface device driver and it supports one or two concurrent serial interfaces. All my ATTiny85 code is written in C.
My home office has a Daikin split system providing heating and cooling (mostly cooling is required due to heat from computers). It was supplied with an Infrared remote control.
To make a controller device, I reverse engineered the Infrared protocol and built a controller based on the ATTiny85 chip. The firmware on the chip sends valid IR packets to control all functions of the air conditioner. The device also includes an Infrared receiver; when I use the remote control the device reads and parses the IR protocol and updates its internal state representing the air conditioner. An XBee transceiver on board provides computerised control from the internet or through an API.
This daemon runs on a computer attached to an XBee master node; it provides TCP/IP access to a ZigBee network for point-to-point packet I/O (internet to device or device to internet) and monitoring of broadcasts (for example, the temperature sensors broadcast their readings every 30 seconds).
The daemon is written in perl and IPv6 is supported out of the box.
The daemon is open source and is at nickandrew/xbee-controller on github
At home there is also a Dunnair ducted air conditioner with a wall panel controller and no remote access. The wall panel is connected to the air conditioner with an TIA-485 bus (similar to RS-232 but uses differential balanced signalling).
I reverse engineered the control and monitoring protocol and implemented a wall-mounted controller using an ATTiny85 (again), an XBee transceiver for communication on the local ZigBee network, and a TIA-485 transceiver device.
The air conditioner transmits current state every 1 second in 14 packets of various lengths (9 to 15 bytes). The wall-mounted controller tracks these state updates and can control every operation of the ducted air conditioner, including installer settings.
The ESP8266 is the latest hot item for embedded devices, home automation and energy management, and budding electronic engineers. Its principle benefit is an on-chip WiFi transceiver so it can trivially communicate on everybody's home WiFi network. It is also dirt cheap and can be programmed in several languages.
I am a collaborator on the NodeMCU firmware project, which provides the event-driven Lua language and device drivers in C. I have written an Infrared receiver driver, which is not yet open source.
My temperature sensor device project has been updated to support the ESP8266.
The functionality is the same - one or more digital temperature sensors are polled every 30 seconds and the readings sent wirelessly - but the network is different; it now connects to your home WiFi and doesn't need a ZigBee network in place. The new PCB is about half as big.
A perl web server receives the temperature updates and logs them in a MongoDB database.
The Daikin IR air conditioner controller has been updated to use the ESP8266 on a PCB which is less than half the size of the original. Power input has also been improved by changing to a USB-B-mini connector.
To reduce development time, the original ATTiny85 processor remains, and the ESP8266 ESP-01 replaces the XBee transceiver only for communications.
The ATTiny85 firmware is updated through the onboard ISP header, whereas the ESP-01 is programmed over-the-wire or through my ESP-01 breakout board.
Inexpensive LED light strips can use about half as much electricity as compact fluorescents, much less than halogen bulbs, and have the advantages of longer lifetime and dimming.
This project brings together diverse technologies into one small device which can be attached to a ceiling and control up to 4 independent LED strips. The LED strips can each be up to 5m in length; one 5m strip is sufficient to adequately light a small room. An onboard Passive Infrared detector enables motion-activated lighting. An Infrared receiver enables a handheld remote control. Finally, the device is controlled by an ESP8266 which provides computer and network control of the lights.
At present, the implemented modes are OFF, ON (with dimming), fast strobe flash and slow pulse.
Extensive research and prototyping was required for this project. I wrote an Infrared receiver device driver, but have not yet open sourced it. Motion detection control and smooth transition between lighting modes required fixes to the NodeMCU firmware for reliability.
Future functionality will include independent control of the 4 LED outputs and energy management.