This little project was born out of a wish to control a DAB tuner from other rooms of the house and a couple of hours on a Sunday afternoon made it reality. A Nanode (an original Nanode 5 in this case) is plugged into my ethernet network and an infrared emitter is connected to digital pin 3, on visiting the ip address of the Nanode using a web browser you will see a series of buttons (shown on my phone in the screenshot on the right, click to see it full size) and selecting the various options makes the Nanode transmit the relevant infrared code to operate the DAB tuner.
The hard work here is done by the IR Remote library by Ken Shirriff available here. This infrared library has direct support for several common IR protocols (NEC, Sony SIRC and Philips RC5 and RC6) but not the one that my DAB tuner uses, fortunately this isn’t a problem as the library also makes it easy to read and transmit using the raw infrared codes (mark and space intervals) from any remote control. NB. If you are using Arduino IDE 1.0 note the comment on the library page about changing WProgram.h for Arduino.h – that’s the only change required for 1.0
I’ve been struggling for thinking and tinkering time this week due to a bad cold that has totally wiped me out but I did have some more thoughts on further reducing the power usage of the TempTX V2. The first one is quite simple and will only have a minor effect but only needs a minor code change – it turns out that it is possible to reduce the time the DS18B20 temperature sensor takes to get a reading by reducing its resolution as shown in the table below. It is currently using a 12 bit resolution but even reducing it to the lowest setting of 9 bit, an effective resolution of 0.5°C at a time would be acceptable for most applications I think.
Resolution
9 bit
10 bit
11 bit
12 bit
Conversion Time (ms)
93.75
187.5
375
750
LSB (°C)
0.5
0.25
0.125
0.0625
Milliseconds might only seem like a small difference but that is as much as an 8 fold difference and as I said in the last post, every little counts.
Secondly, a completely unrelated discussion on Twitter at the weekend lead to a likely explanation for the total drop out when the battery voltage reaches 2.7V, namely that the default BOD (Brown Out Detection) fuse setting for the ATmega328 when using the default Arduino bootloader is 2.7V (sound familiar?), when the voltage drops below this level the mcu is put into a reset loop until it rises again. That explains the sudden cut off at 2.7V. With some fiddling and reflashing of the bootloader this BOD setting can be changed to 1.8V or even disabled completely and some brief research shows that the ATmega328 can run from as little as 1.8V (although it would be out of spec running at 16MHz at that low of a voltage) and that the RFM12B module should run OK down to 2.2V so there is plenty of room there. Surprisingly the DS18B20 temperature sensor is not so tolerant, the datasheet says it needs a minimum of 3.0V, however, I’ve already proved that it runs ok at 2.7V (at current average temperatures anyway) and a little research found some reports that it works down to around 2.6V before it starts to give errors and the addition of an electrolytic capacitor should be sufficient for it to get a reliable reading at even lower voltages, especially at the lower resolutions where it needs to be powered for a shorter amount of time. I might try some more voltage tests with the BOD disabled to see how low I can get the whole thing will go before it starts to become unreliable. Another, maybe more sensible option might be to look at some different temperature sensors that are rated to work at lower voltages, there are several cheaper analogue alternatives to the DS18B20 that might make more sense, they would need to be calibrated though and it would mean only one sensor per input (not really a factor with the way I’ve been using these boards so far) but would have a secondary advantage in that the 1-wire and Dallas Temperature libraries wouldn’t be required which might mean that the code can be reduced to fit into one of the smaller ATmega microcontrollers thus reducing cost again.
Please feel free to post in the comments if you can think of any other suggestions or improvements.
I just wanted to share this fantastic Pink Floyd-esque (with a hint of Ozric Tentacles in places) reworking of the Doctor Who theme tune from Traffic Experiment as it doesn’t seem to have been getting the love it so obviously deserves. You can also download this track for free as an MP3 or FLAC at the Traffic Experiment website.
I hope you enjoyed this interval, normal service will be resumed shortly.
The original wireless temperature sensor module that I built at the end of October is still happily working away proving that the concept of a very minimal wireless node works and that it is quite happy running from two AA batteries.
There were a couple of factors that influenced the previous boards design that meant is was less than ideal, firstly the need to remove the RFM12B when programming using a 5V FTDI cable complicated things and due to Royal Mail dragging their feet and my impatience to get the thing built I only had a piece of stripboard 18 rows high which necessitated placing the RFM12B alongside the ATmega instead of in line with it .
Now, armed with new supplies of stripboard and some new ideas I’ve made a new improved and smaller (40x65mm) board. To resolve the voltage issue I decided to make a small adapter board which contains a voltage regulator and smoothing caps (I didn’t want to put these on the main board in order to keep it as minimal as possible) and I’ve also moved the capacitor and pull up resistor for the reset on to this board meaning the TempTX (as I’ve been calling it) now requires two less components and a little less space. Of course only one adapter is required for as many of the TempTX nodes that are used so in the long run the saving of components required and time to build will make more sense. This adapter also allowed me to re-order the programming pins on the main board which further reduced the number of links required and therefore the space required. Other than using a resonator instead of the crystal and load capacitors I think this is as minimal as this board is going to get. I suppose you could omit the programming header and program the ATmega in another board but that’s probably taking minimalism a bit too far.
I’ve recently put together another wireless GLCD display, this time using a WiNode together with a ST7565 GLCD with RGB backlight and a Nintendo DS touchscreen. The WiNode is fitted with a 433MHz RFB12B transceiver and the MCP79410 Real Time Clock (RTC) option as well as a DS18B20 temperature sensor for the room temperature reading.
This is quite an improvement on the first display I made, the feature list is now:
Touch control using Nintendo DS touchscreen
3 Different display views selectable via touchscreen
Backlight colour changes depending on power reading
Supports MCP79410 RTC for time & date display
The WiNode makes a great base on which to build a display like this and being 3.3V it pairs well with the 3.3V ST7565 displays. This particular display is the Adafruit one with the RGB backlight (available from Proto-PIC) that I covered here and I’ve connected it up along with the touchscreen and temperature sensor as follows:
I’ve been playing with some more GLCDs (Graphical Liquid Crystal Displays) recently, along with a Nintendo DS touchscreen. The parallel KS0108 display I used for my emonGLCD used an awful lot of pins, 16 including the power, which doesn’t leave a lot left over for anything else, so I thought I would try some of the serial displays that are available, one from SparkFun and a nice one from Adafruit that has a RGB backlight, you can see a montage of pictures of this display on the right.
Interfacing with and coding for each of these displays is subtly different as there isn’t a single unified Arduino library but none of them are complicated, it’s basically commands to move to a particular pixel of the display, select a font and print it, or for boxes, lines etc. you need to provide coordinates for the start and end points.
In combination with these screens I’ve also been experimenting with the Nintendo DS Touchscreen which is available on its own from a number of suppliers and makes for a cost effective method of adding touch control to screens of this size. When you only want to detect relatively large areas of the screen, such as for a menu, they are very easy to use.
The original Nanode has proved to be a great success with a growing community of people building many interesting networked devices and this month, Ken Boak, the creator of the Nanode has launched several new additions to the line. The new Nanode RF is essentially an upgrade to the original Nanode 5 with an on board RFM12B wireless transceiver and options for several extras such as a real time clock (RTC), 32KB SRAM and a Micro SD socket.
The second new member of the Nanode family is the WiNode, a low cost wireless node that is available in several different configurations, all using the same PCB with just the installed components differentiating between them. As with the Nanode and Nanode RF, the WiNode can be fitted with the standard Arduino headers for compatibility with Arduino shields as well as the RTC (SOIC or DIP), 32KB SRAM and Micro SD options as with the Nanode RF. The WiNode also features four 16V tolerant analogue inputs and when fitted with a dual H-bridge driver chip it can provide 2A digital outputs for driving relays or motors (although you can’t use the SRAM/SD if the H-bridge is used). Due to a nifty bit of design the WiNode can also be built for use as a shield for the original Nanode to add RFM12B wireless capability and more. Prices are very good, with WiNode kits starting at £17.50 (or £15 if you buy a pair) for the basic stand alone wireless node or only £10 if you want to use one to expand an existing Nanode 5. The Nanode RF kits start at £30 and for the first time a fully assembled unit with all the options is available for £40.
Pictured above is my first WiNode build, decked out with the SRAM and SOIC RTC options. I’ve fitted all the optional bits on this one, headers, screw terminals and even the socket for the H-bridge driver as I will keep this one aside for experimentation and prototyping, subsequent builds will just include whatever is required for the particular use. That’s the Nanode RF on the left.
As with the original Nanode, both the Nanode RF and WiNode are supplied as a kit for you to build yourself and anyone with basic soldering skills should find it very straightforward. Ian Chilton has already created a very comprehensive guide to building the Nanode RF which is available here and I suspect a WiNode version won’t be far behind (update: WiNode build guide is now almost complete).
Ken says he will have an online shop available shortly but for now you can order by sending a Paypal payment, for further details and prices of the various options see this blog post.
Hard to believe that another one of the computers that had such an impact on my life is now thirty years old, I don’t feel old enough for anything I remember so well to be 30 years ago. After the Sinclair ZX81 and the Spectrum that followed it our next family computer was the BBC Micro Model B, it was an amazing computer for its time and remained in use for many years, I still have the same one today (that’s it on the right).
Made by Acorn Computers for the BBC as part of the BBC Computer Literacy Project it won out over the competition, including Sinclair, to build a computer for the BBC to use as part of its series to educate people about computers. The story behind the battle to win the contract was dramatised in the very enjoyable Micro Men programme that was shown as part of the Electric Revolution season on BBC Four in 2009. If you didn’t see it at the time it is well worth a watch.
Affectionately known as the Beeb, the BBC Micro was a 6502 based 8-bit micro with 16k or 32k RAM depending on the model, it ran at a relatively fast (for the time) 2MHz and it had a proper, robust keyboard, a plethora of connectivity options and a key factor in its success was the comparitively sophisticated BBC BASIC. Unlike most computers that followed it the Beeb also came with a proper manual, a thick ring bound affair that was actually a proper guide to BASIC programming. The Advanced User Guide available separately covered things in more detail including 6502 machine code and even contained a full circuit diagram.
Along with the accompanying television programmes and thanks to most schools choosing the BBC Micro it went on to become the corner stone of computing education throughout the 80s, together with the time then given to computing in the school curriculum it gave kids of my generation a grounding in computers that hasn’t really been seen since.
I spent many happy hours with the Beeb and learnt a lot both in and out of school. These were the days when you were taught how to program a computer at school rather than just operate one as sadly seems to be the case in these days of ICT classes that just teach kids how to use programs such as Word and Powerpoint.
The BBC Micro also gave me my first experience of networked computers, something that would become so important in later life. After one summer holiday we were excited to return to school to find we now had a dedicated computer room full of BBC Micros all networked with econet, much fun ensued and a little good natured mischief (netmess anyone?). A year or so later myself and several friends ran a teletext type information system (using the little known Mikefax software) that was used at open nights and sports days and eventually had a dedicated screen in the school entrance hall. My first experience of publishing information electronically.
The BBC Micro also brought my first exposure to computer communications, first using a 1200/75 baud modem and later a Watford LeModem to connect to local bulletin board systems and services such as Micronet800, Telecom Gold and Prestel (often using dodgy logins aquired from a BBS) and look where that ended up.
As with many of my generation I owe a lot to the BBC Micro and what it taught me and as many others have commented recently, this sort of thing is missing from the lives of most kids these days. Projects such as Coding For Kids, Raspberry Pi and the recently launched Goto Foundation can hopefully do something to help turn this around.
A few weeks ago I needed an Arduino compatible Micro SD adapter but didn’t want to wait for one to arrive in the post so inspired by the breadboard ghetto Micro SD socket I knocked up a mini shield using a bit of left over stripboard and a SD to Micro SD adapter.
Interfacing with an SD or Micro SD using an Arduino is very simple as it can be controlled directly over SPI so it’s just a case of connecting to the Arduino’s SPI pins (11-13) and a pin for select. I used the hardware SS pin (10) for select as keeping all the pins together made for a small shield, you can use a different pin if 10 is already used but note that pin 10 must still be set as an output regardless or the library won’t function. Some resistors are required to drop the Arduino’s 5V to 3.3V for the SD card but other than the Micro SD adapter, some headers, a bit of stripboard, and a few pieces of wire that’s it.
The Arduino SD library is very easy to use with easy to follow examples and it supports FAT16 and FAT32 file systems but note that it only supports one open file at a time and can only use short 8.3 file names.
Here is the stripboard layout, to mount the SD adapter I’ve just soldered a right angle header to the contacts on it. There is also a badly drawn schematic here.
As I mentioned in my last post I wanted to get the GLCD display that I built for my OpenEnergyMonitor system to transmit the reading from its internal temperature sensor so that the Nanode could upload it to the emoncms web interface. Once that was working it gave me the idea of building wireless temperature sensor modules for other areas of the house, the first of these is now complete and is sensing the outside temperature which is being displayed on the GLCD as well as being uploaded to emoncms by the Nanode. This has now allowed me to retire the old one wire temperature sensor system that I had connected to my MisterHouse server.
The board for the wireless temperature sensor module is basically the same as my minimal Arduino build with an RFM12B transceiver and a DS18B20 temperature sensor added. As it’s running directly from 2 x AA batteries no voltage regulation was added.
As I only have a 5V FTDI cable for programming and the RFM12B isn’t 5V tolerant I soldered it to a small carrier board so that it can be removed during programming, this also has the benefit of making the footprint for the main board smaller while still keeping things neat as the space under the RFM12B can be used for some of the links. The idea of soldering the RFM12B in this manner came from a picture that Andrew Lindsay posted on Twitter showing how he uses them with breadboard, simple but very effective.
Expanding my bread machine horizons with the aid of this great book I was given. Have got chilli bread on the go. http://t.co/rJNDg0qWabout 16 hours ago
Most Popular