OSWIN is the only slightly contrived acronym for my new Arduino compatible Open Source Wireless IoT Node based on the ATmega1284P AVR microcontroller.
I blogged about using the ATmega1284P with the WIZ820io ethernet module last year and was subsequently sent two prototypes based on the same combo to evaluate, the MAX1284 and the Air Sensor Hub. For the last 6 months I’ve been running the MAX1284 prototype as a replacement for my Nanode emoncms gateway, uploading data from my TinyTX sensors to my emoncms installation and it has been rock solid. Inspired by this and with another $10 Seeed Studio PCB voucher burning a hole in my pocket I decided what the world needed was yet another open source Arduino compatible.
If nothing else this will now allow me to point people asking what I am currently using on the receiving end of the TinyTX sensors towards something they can duplicate for themselves and as it has all the standard Arduino features and more it can also be used as an “Arduino on steroids”. The extra resources will certainly come in handy in many projects, including use with some of the RAM heavy GLCD displays and it would help with the RAM problems I ran into with my Nanode based IR web remote control. As well as being Arduino shield compatible and having options for the RFM12B transceiver and ethernet module there is also an Xbee compatible socket allowing use of Xbee or Ciseco XRF radios or a wi-fi version can be created by fitting a Roving Networks RN-XV.
Here’s the spec:
- ATmega1284P-PU running at 8, 12 or 16MHz
- 16KB RAM, 128KB Flash, 4KB EEPROM, 2 UARTs, 3 Interrupts
- Up to 32 Digital I/O, 8 with hardware PWM
- Up to 8 Analogue inputs
- RFM12B Transceiver, mounted on the board or via my RFM12B breakout board
- Socket for WIZ820io W5200 ethernet module
- XBee compatible socket for XBee or Ciseco XRF low power radios or Roving Networks RN-XV Wi-Fi module
- Arduino shield compatible
- Programming via FTDI or ICSP
- Power from USB or FTDI/ICSP headers
- RGB status LED
- Running at 3.3V throughout
- Dimensions 95 x 80mm
Here is a comparison of the ATmega328P used in the Nanode and the ATmega1284P used in OSWIN:
|Pins with PWM||5||8|
I’d previously used Maniacbug’s pinout with the ATmega1284P but once I tried to lay an Arduino shield compatible board out with it I realised it wasn’t going to make much sense so instead, after looking at a few alternatives I settled on the Bobuino pin layout and layed it out to match the original Arduino layout with the exception of I2C which are on the additional header in the same place as on the Arduino Mega boards.
The bootloader and Arduino core I am using is the one for the MAX1284 (based on Maniacbug’s Mighty-1284P) with the pins changed for the Bobuino layout. There are options for running at 8, 12 or 16 MHz, running it at 12MHz or less makes sure it is in spec at 3V3 although in my experience Atmel allow a lot of leeway in their designs so 16MHz will probably be ok in most circumstances, it certainly ran ok when I tested it on breadboard last year but it probably varies from chip to chip. 12MHz is plenty though and I’m looking for stability here.
On the front of the board (at the top top in the pictures above) is a single 5mm RGB LED with each colour connected to PWM pins so some subtle patterns can be created to show what OSWIN is up to during normal operation or a more noticeable warning if something is wrong, for the moment I am just using red to indicate error, green for normal and blue for data received. The eagle eyed might notice that the LED on one of the boards in the pictures above has been replaced by 3 individual LEDs, that’s only because I didn’t have as many RGB LEDs in stock as I thought I had!
Round the back of the board are a 5V FTDI programming header, reset button, USB socket (for power only) and the WIZ820io ethernet module, I went with a USB B socket for power as they are easy to find in a through hole style and every drawer I open seems to have another spare USB A to B cable stuffed in it whereas micro and mini USB cables always seem to be in short supply here. The 3.3V ICSP programming header is in the standard Arduino position for maximum compatibility with shields.
For the RFM12B I added the option of using my RFM12B breakout board as well as mounting it directly on the board as I thought it would be handy for experimentation and upgrades, anyone who has ever had to desolder an RFM12B will know what a pain it is. I’m mounting the WIZ820io via headers too so along with the processor being mounted in a socket it means all the expensive parts can be easily removed for use with future upgraded boards. Of course if one was going into long term use and a lower profile was required you could solder everything directly to the board at the expense of easy removal.
It is compatible with the standard JeeLib RFM12B library with just a couple of small changes required to add the pin mapping and allow use of INT2 for the IRQ instead of INT0 (which is on the same pin as RX1 which is assigned to the XBee socket) but don’t worry, this won’t break the library for other boards.
It’s also necessary to comment out the include for pins_arduino.h in SPI.cpp (see this bug) in the Arduino SPI library – This has now been fixed in the bootloader. For the WIZ820io you can use the standard Arduino W5100 ethernet library and swap a couple of files round to add support for the W5200 chip but instead I recommend using the ethernet52 library here which will keeps things tidier and save some headaches later if you are using both types of boards.
I picked this enclosure up on eBay which with a bit of dremel action makes a nice compact case for OSWIN.
There were a couple of issues with the boards, one very minor – a small error on the silkscreen text where it says the RFM12B interrupt is on D10/INT2, it should read D6/INT2 and a more serious one where I had linked the SS line for the RFM12B from the footprint on the board to the header for the breakout but a last minute change to one of the labels in the schematic left it unconnected to the ATmega, oops! Fortunately it was an easy fix with a single short green wire to link it up. Both these errors have been corrected in the files below. It’s also worth noting that although all the holes for the headers use the alternating offset type footprint that should make the headers easier to fit straight but they didn’t lock as expected, I guess this is down to manufacturing tolerances at Seeed Studio and them not being able to drill holes small enough, I should check the spec on that.
Make your own
As usual I got the PCBs made at Seeed Studio, a little more expensive than my previous boards as they come into the 10x10cm max category which is $15 more but it’s still a very good price, especially when you have a $10 coupon from your last order burning a hole in your pocket. The normal price would be $32.70 for 10, or around £2.71 each. If you want to get your own made the files are all available below and are licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) licence as always so you can modify and share as appropriate.
Schematic (PNG format)
Arduino core and bootloader
Example code for multiple TinyTX sensors to emoncms
The hardware design files are also available on SolderPad.
Parts List for example configuration with RFM12B and ethernet:
40 pin DIP socket
WIZ820io ethernet module
MCP1702-33 LDO Voltage regulator
10uF electrolytic capacitor
7 x 0.1µF (100nF) 2.5mm ceramic capacitors
2 x 1µF 2.5mm ceramic capacitors
2 x 22pF 2.5mm ceramic capacitors
Through hole USB B socket
Right angle tactile switch
Common cathode RGB LED
3 x suitable resistors for RGB LED (For the one I used it was 68 Ohm for red and 5.6 Ohm for green and blue)
3 way 2.54mm male pin header and jumper for power selection
2 x 3 way 2.54mm male pin header for ICSP connector
6 way straight or preferably right angle 2.54mm male pin header for FTDI connector
Other 2.54mm female headers for Arduino shields/RFM12B breakout/WIZ820io as required
2 x 10 way 2mm female header for Xbee socket if required
Wire for RFM12B antenna, eg. 0.6mm solid core (165mm for 433MHz, 82mm for 868MHz)
This is Open Source Hardware licenced under a
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) licence.