Saturday, March 19, 2011

Nanode - A Net Applications Node



Nanode - a £20 Network Applications Node for remote sensing projects.

Having worked with Arduinos for a couple of years, I was keen to extend the functionality and scope of the basic Arduino to include the ability to be networked with other Arduinos or devices via the internet or a local serial network - as the communication to the Arduino is fundamentally serial.
The opportunity came with the low cost NuElectronics Ethernet Shield, which provided an ENC28J60 ethernet controller and a Magjack for about £12, however by the time you had added an Arduino (and 20% VAT), the cost was approaching £40. The simplicity of the hardware was such that I reckonned that there must be a much cheaper way of getting internet connectivity - and thus the Nanode was conceived.

Combining an Arduino microcontroller and ethernet controller onto a single small board for developing networked sensor applications at minimal cost seemed an attractive proposition reducing the cost of net connectivity for microcontrollers by a factor of 2 - to an affordable £20!
The Nanode takes the standard ATmega328 microcontroller - as used in all the standard Arduinos, and combines it on a single board with an ENC28J60 ethernet controller and Magjack.

This was not the first time this had been done, Tuxgraphics produced the first one about 5 years ago as detailed in this article, and there was a very capable design on Instructables a couple of years ago. Indeed, almost all of the firmware for the ENC28J60/ATmega combination is derived from the original Tuxgraphics code.

So Nanode is not new, it owes its heritage to at least two previous designs, but it does introduce some new features which I hope will bring it more into the Arduino playground. Unlike previous designs it presents its I/O in a form which is compatible with Arduino shields, but also enhances the I/O capability with additional connectors - making the I/O more accessible when a shield is fitted and allows the device to be plugged directly into a breadboard and still access all of the power and I/O.

So after the initial idea was hatched, I had to make a prototype. I'd had a bit of prior experience breadboarding ethernet, so last August I combined the Microchip ENC28J60 ethernet controller and the ATmega328 and 74HC125 tristate buffer on a breadboard to prove the design. The combination of the 3 ICs and the Magjack on its breadboard friendly breakout board (from Cool Components) was a neat fit on the standard size breadboard. Cool Components source most of the key components, allowing the design to be built on a breadboard for about £12. A later post will describe the breadboard construction in detail - for those brave enough to follow this route.

So the Nanode, provides ethernet connectivity to what is essentially a standard Arduino and allows access to most of the original I/O lines for the control and sensor applications. To summarise you have 6 analogue inputs, 8 digital I/O lines and a serial port remaining after driving the ethernet controller. With this you can sense analogue variables such as temperature, pressure or energy consumption such as electricity or gas, and have the ability to control relays, displays or actuators using the digital I/O. The Nanode takes the serial interconnection one stage further and using some of the spare 74HC125 buffers implements a "multidrop" serial network - allowing Nanodes to be connected together on a local serial network, which provides communications and power.

Having built the first one up on breadboard, as a minimalist proof of concept, I got it working to the point where I could send messages or control packets to another network connected Arduino and NuElectronics Ethernet shield, using Pachube to transfer data between the nodes. Then I got distracted by other things and the "Etherduino" - the early construct name for the Nanode, got put to one side for 6 months.
It was on hearing that Pachube are hosting an Internet of Things Hackathon in London on April 8th/9th which encouraged me to revisit the design with the aim of having it ready for the Hackathon. The breadboard ethernet Arduino is now Nanode - a Network Applications Node. (Or Networked Arduino Node - for those in the Arduino camp).

Timing of the Hackathon was perfect, allowing me 2 weeks to finish my design and get some boards made. I also had wanted for some months, a general purpose DIY Arduino compatible board, which could be made more cheaply than commercial units. With the features of more friendlier I/O connections and had the means to be networked to other nodes on a serial bus, the Nanode seemed the ideal entry point into Net Connectivity for under £20.

Above: First Prototype Nanode Runs Pachube Client Code. Blue LED shows Ethernet data activty.

This new board was the opportunity to address some of the points on my wish list. There were several design points which I wanted to take into consideration and resolve:

1. Must be easy to build by anyone who can solder - so 2 layer PCB design (EagleCAD) using conventional and readily available through hole components. Board is 72.4mm 58.4mm (2.85" x 2.3") - marginally bigger than Arduino, to account for additional I/O connectors.

2. Low Cost - hence the use of the Microchip ENC28J60 ethernet controller.

3. Compatible with standard Arduino shields - matching connector pitch - warts and all!

4. More flexible I/O arrangement. I have fitted additional connectors on 0.1" pitch which allow compatibility with breadboards and stripboard. All of the standard I/O pins and power from the ATmega328 are available along one edge of the pcb, which simplifies plugging this board into breadboard or 0.1" stripboard. They also allow the I/O headers to be accessed even with a shield fitted. An extra connector in the top left corner brings up the analogue inputs and 5V power - so all of the ATmega I/O and power can be accessed from a single edge of the board with a SIL header pins - handy for one sided connection of everything to a breadboard.

5. Spare tristate buffers in the 74HCT125 allows several Nanodes to be interconnected on a serial bus, controlled by a master unit which is connected to the internet. This feature was developed last August and found that we could get 9600baud serial data down 300m of cable. Simple 4 way telephone cable can be used to string these nodes together.

6. With the ENC28J60 and Magjack omitted, the device becomes a simple serial node - at £5 lower cost.

7. Extra I/O connector allows direct plug-in of R/C servo or Moderndevices LCD display on 3 wire bus.

8. Serial accessed via FTDI cable or similar USB to Serial adaptor.

9. Tall headers will be used to increase the clearance between the shield and the Magjack connector - which is 3mm taller than the USB socket usually found on the Arduino.

10. Programmed through the Arduino IDE (or AVTdude) with access to the standard AVRISP 6 pin header.



BOM (Most specialist items from Cool Components in South London)






  • ATMega328P-PU - DIP version Cool Components £2.81

  • Microchip ENC28J60-I/SP - DIP version Cool Components £1.99

  • 74AHC125D tristate quad buffer

  • 3mm LED

  • 1N4004 Diode

  • 7805 Regulator

  • 78L33 Regulator

  • 16 MHz HC49-4H Crystal

  • 25 MHz HC49-4H Crystal

  • 51R 0.25W 1% resistor x 4

  • 270R 0.25W 5% resistor x 5

  • 2K 0.25W 1% resistor x 1

  • 330R 0.25W 1% resistor x 1

  • 10K 0.25W 5% resistor x 3

  • Ferrite inductor

  • 18pF ceramic cap x 4

  • 100nF ceramic cap x 4

  • 10uF 16V electrolytic cap x 3

  • 28 pin 0.3" DIL socket x 2

  • RJ45 MagJack £1.99 CoolComponents recommended

  • 36 pin 0.1" SIL header x2

  • Small Tact switch Cool Components £0.28

  • ATmega Nanode PCB - that's me!
I have sent off to have batch of 10 boards made up in time for the Hackathon. If anyone would like the EagleCAD files, or purchase a pcb - please drop me a comment.

21 comments:

Andy said...

Hi Ken,

Wow, you have been busy. This looks rather compact and interesting. let me know if you need beta testers as I think I know a little about Arduino/AVR talking to ENC28J60 ethernet chips.

Cheers

Andy

Ken Boak said...

Hi Andy,

Yes you would be most welcome to a board for beta testing, - in fact I was thinking of you and John Crouchley - as part of the beta team.

I should have the boards by the weekend, and hopefully if my new found EagleCAD skills - no serious errors.

Are you going to take part in the Pachube IOT Hackathon - even remotely?

Unknown said...

Hi Ken,

I'm from Poland and I'm very fond of your project. If you could send me files EagleCAD it would be much appreciated. I am also intrested in buying 2 or 3 PCB.

Cheers

Wojciech

Ken Boak said...

Wojciech,

Thankyou for your interest in the Nanode project.

I have sent off for only a small batch of boards just to make sure the design is working.

Please email me at ken dot boak at gmail dot com for the EagleCAD files.


Ken

Ian Chilton said...

Hi Ken,

How much will you be selling the PCB's for?

Thanks,

Ian

Ken Boak said...

Ian,

Once I have proven the board layout is good and made any improvements, I intend to manufacture a batch of 100 or so. This will either be from my UK supplier, or from a Chinese supplied (Seeedstudio offer low cost pcb service on a fixed size board - but there are others springing up).

This will bring the bare board selling price to about £5. The rest of the unit can be built up from about £12 of components. The Nanode is intended to be a sub-£20 ethernet connected Arduino.

I have to prove the boards first, but I do know that the prototype worked as expected on breadboard, so I'm reasonably confident.


Ken

Steampunk Prof said...

This looks brilliant. Are you going to sell them as a kit/pre-built at some time in the future. A much better idea than an Arduino/Ethernet shield which is overkill for anything other than development.

Ken Boak said...

Steampunk Prof,

The idea arose from never having enough Arduinos around when you need them, so I wanted something that was low cost and cheap to replicate. Plus a reorganisation of the I/O to make it more breadboard friendly.

I have sold kits in the past, and it is a lot of work for not much return.

I think I will probably just sell it as a bare pcb and let others build them up as required.

The EagleCAD files will be open source - so anyone can have a go at making them.

This first version is just to seed the market and let others take it on.


Ken

Jon said...

Hi Ken,

Well done on getting this finished. I thought this had died away from the LH wiki!
I'd be interested in getting one or maybe a couple of these off you when you get them off the supplier. :)

Jon

John Crouchley said...

Hi Ken,
This looks great - wonderful idea.
I have been speaking recently with Miles here in Nottingham - he asked to be remembered to you.
I would certainly be interested in testing a board - I love the idea of the Serial net.
If work pressure permits I will be a remote participant with the Pachube hackathon, hopefully I can convince NottingHack to join me.

All the best
John.

Ken Boak said...

John,

Please pass on my regards to Miles. In fact it was some of his ideas which led me to the idea of a load of nodes communicating via simple commands on a serial bus. Wireless is OK, but you still need to get power to the nodes, and nothing is much cheaper than a length of 4 way telephone cable.

It would be good to get a couple of boards up to you. I've already spotted one mistake - that's the problem wih rushing, but easily fixed with a couple of wire links.

I'll let you know next week how I get on. There will be an updated version to the board once it's been debugged. I plan to get a batch of 100 boards made, and then can sell them for £5 or so. The customer can then source the various other bits as required.

Perhaps I can get Mike at Earthshine Electronics to handle the distribution and kitting.


Ken


Ken

Ken Boak said...

Jon,

Day job distractions prevented me from finishing the original LHS wiki design until last weekend.

I plan to make the design open source and possibly get Earthshine, Cool Components etc to keep a stock of the boards.



Ken

Ed Davies said...

This looks like an excellent combination. Arduinos are fun but restricting connections to USB range or using a bit of a kludgey Ethernet shield has never been a good choice. A few power obsessed questions:

1. Are these 5V or 3.3V devices?

2. Can you feed them power over the Ethernet cable? (e.g., by soldering on a couple of extra wires, perhaps?)

3. What is their power consumption?

Cheers,

Ed
(Eccentric Anomaly on the Navitron forum)

Ken Boak said...

Ed,

The ATmega328 needs 5V if you want it to run at 16MHz. (12MHz maximum at 3V3) The ENC28J60 is a 3.3V part with 5V tolerant inputs.

I had considered Power Over Ethernet (POE) but was disappointed by lack of support from router manufacturers and that POE mag-jacks are not standardised yet - and a bit more expensive.

You could use a POE injection board or just run DC along some of the unused lines and use a bridge rectifier to extract the power for powering the Nanode. If this becomes popular - I will update the pcb to include POE option.

Regarding power supply - only about 100mA is needed on the 3V3 rail.

I hope to have the first version of the Nanode available by early April and then take stock of any improvements and upgrades - for example

SPI serial RAM for data buffer/web page storage

SDcard interface and Real Time Clock - so it can be equivalent to SparkFun microlog

74HC595 as a SPI port extender - 8 more output lines.

Surface mount version - about the size of an Arduino Nano - handy for when you don't need shield compatibility.



Ken

Miles said...

Ken,

I can help on the POE side if it helps, I designed it into our IP gateway. I've got an injector for testing purposes also.

Miles

Ken Boak said...

Miles,

Any help with POE would be appreciated. Specifying a standard POE Magjack would be useful for future layouts.

I have omitted it this time just so I could get the pcbs out earlier.


Ken

miles said...

Mailed you directly, just noticed navitrino and meter reading, this stuff is really close to my heart as is on demand leccy and my lister CS. Ever in nottigham for a beer?

Anonymous said...

I noticed you have space for 2.1mm jack and regulator but not populated in your pics - I've used similar to these POE splitters before now... seem ok. http://shop.ebay.co.uk/egift4all/m.html?_nkw=poe&_sacat=0&_odkw=&_osacat=0&_trksid=p3911.c0.m270.l1313
And of course you control the volts you stick in at the far end.

Banibrata Dutta said...

Nanode is a very interesting and useful development. Congratulations. Just wondering if this has the same 1K, single response packet limitation ?

Since you mention that you proto'd this on Beardboard, I am guessing, it can be done on veroboard/protoboard with point-to-point wiring ? Ugly but functional ? Any chance you could share the schematic ?

Ken Boak said...

I have decided to put all the current design files (SCH, BRD and any code examples) on Thingiverse.

http://www.thingiverse.com/thing:7497

Nanode is now at version 3 which has better connectors, provision for virtual USB and a number of other improvements.

Please keep checking regularly for current version.

Nanode is an open source project so you can build your own. I have done a special Hackspace version which can be built for under £20 or US$30.

In the UK we are gearing up to small batch production.

All feedback appreciated.



Ken

Marcus Kirsch said...

Wow, nice piece of ech. I just ordered myself an Arduino to do some prototypes here at Leo Burnett, but it looks like I should get one of those. When are they ready for sale?