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 is a comparison of the ATmega328P used in the Nanode and the ATmega1284P used in OSWIN:

Feature

ATmega328P

ATmega1284P

RAM

2KB

16KB

Flash

32KB

128KB

EEPROM

1KB

4KB

UART

1

2

IO Pins

23

32

Pins with PWM

5

8

Interrupts

2

3

Analogue Inputs

6

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.

With WIZ820io ethernet, XRF low power radio in Xbee socket and RFM12B on board.

With RN-XV Wi-Fi module in Xbee socket and RFM12B on board.

With RN-XV Wi-Fi module in Xbee socket and RFM12B on a breakout board.

With W5100 ethernet shield and XRF low power radio in Xbee socket.

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.

RFM12B fitted on board (left) and on breakout (right)

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.

Libraries

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.

Case

Issues

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.

11 thoughts on “Introducing OSWIN, the Open Source Wireless IoT Node”

fantastic project. I would very much like to try it. So i built up a minimum 16Mhz Atmega1284p-pu board. I installed your optiboot_atmega1284p_16MHz.hex boot loader software via AVRISP on a Duemilanove board. Then i tried to upload a simple blink application to the Atmega 1284p board using OSWin ATMega1284p 16MHz using Optiboot as the default board. For the serial transfer to the board i use a Sparkfun FTDI board which is connected to RESET, TXD, RXD and GND of the test board. Oops nothing happened and Avrdude comes with this error:

System wide configuration file is “/Applications/Arduino105.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf”
User configuration file is “/Users/yoali/.avrduderc”
User configuration file does not exist or is not a regular file, skipping

So i installed the Orignal Mighty 1284p 16MHz on my board and tried again to upload the blink prog. This works. To be honest sometimes it works not always. Is the AtMega 1284p such a difficult chip or am i thinking in the wrong direction. I have installed a 10K Resistor to VCC as pull-up and the Reset is connected via 0.1uF.

I installed some of the software from Nick Gammon (ATmega Board Detector) to see the fuses and the memory on board. It looks good. Everything seems to be in the right place. If only these issues in the uploading wouldn’t be.

If you are running at 3.3v then it is slightly out of spec at 16MHz so that could cause it to be a bit flaky I suppose, I haven’t had any issues like that at 12MHz & 3.3V.

That Maniacbugs bootloader is working sporadically where as mine isn’t working at all is puzzling although I have to say I haven’t tried the 16MHz one, it came straight from the MAX1284 files and my original experiments at 5V and 16MHz were with Maniacbugs version. There are a couple of problems with his bobuino pin layout that are corrected in my variants/bobuino/pins_arduino.h file though so you might want to copy that over. If I get chance I’ll check the 16MHz version out again.

thanks for sharing your detailed project.
This is my first project, and I started building the oswin and some tinytx3 nodes. All goes well, using an arduino UNO as a ISP to burn the bootloader into the oswin and the tinytx.

Uploading of the OSwin sketch results in a error.

Do you recognize this error, and do you have any idea how to fix this?

Hi,
I’m irinakim and I’m work in the Wiznet.
Thank you for using our product.
Can you receive my email message?
If no, Will you do me a favor?
We are collecting so much data using our product.
And I will post the OSWIN project on our Web site.(http://wiznetmuseum.com)
Can I post your product on our Web site?