Difference between revisions of "Project:Ethernet Arduino"

From London Hackspace Wiki
Jump to navigation Jump to search
m (Reverted edits by Ytogohiga (Talk) to last revision by Paul tanner)
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://azysijogen.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
----
 
=[http://azysijogen.co.cc CLICK HERE]=
 
----
 
</div>
 
 
{{ProjectDetails|ProjectTitle=Projects/Ethernet_Arduino|members=[[User:Teabot|Elliot]]|created=12/Aug/2010}}
 
{{ProjectDetails|ProjectTitle=Projects/Ethernet_Arduino|members=[[User:Teabot|Elliot]]|created=12/Aug/2010}}
 
Discussions on the list highlighted great interest and demand for cheap Ethernet enabled Arduino compatible boards. A plan was hatched to produce a number of these boards for members and possibly for sale. Increased volumes would result in lower unit cost.
 
Discussions on the list highlighted great interest and demand for cheap Ethernet enabled Arduino compatible boards. A plan was hatched to produce a number of these boards for members and possibly for sale. Increased volumes would result in lower unit cost.
Line 16: Line 8:
 
Some Background.
 
Some Background.
  
The Arduino has had internet capability for the last couple of years following the release of the [http://www.arduino.cc/en/Main/ArduinoEthernetShield &quot;Official Ethernet Shield&quot; ] in 2008. This was based on the WizNet W5100 ethernet controller chip and will work at both with 10Mb/s and 100Mb/s. It is available in the UK for about £26 [http://www.skpang.co.uk/catalog/product_info.php?products_id=394]
+
The Arduino has had internet capability for the last couple of years following the release of the [http://www.arduino.cc/en/Main/ArduinoEthernetShield "Official Ethernet Shield" ] in 2008. This was based on the WizNet W5100 ethernet controller chip and will work at both with 10Mb/s and 100Mb/s. It is available in the UK for about £26 [http://www.skpang.co.uk/catalog/product_info.php?products_id=394]
  
 
Whilst a very capable and well supported shield, the cost of the Arduino and ethernet shield together is the best part of £40. Other ethernet controller devices are available, and these started to attract the interest of the AVR hacking community, as a means of getting a very low cost ethernet connection for AVR based projects.  These used the Microchip ENC28J60, which is a simpler and cheaper device than the W5100, but still offered acceptable ethernet connection and the means to build cost-effective micro web servers and web clients.
 
Whilst a very capable and well supported shield, the cost of the Arduino and ethernet shield together is the best part of £40. Other ethernet controller devices are available, and these started to attract the interest of the AVR hacking community, as a means of getting a very low cost ethernet connection for AVR based projects.  These used the Microchip ENC28J60, which is a simpler and cheaper device than the W5100, but still offered acceptable ethernet connection and the means to build cost-effective micro web servers and web clients.
Line 34: Line 26:
  
  
Firmware &amp; Libraries
+
Firmware & Libraries
  
 
* The ENC28J60 has been used by [http://www.tuxgraphics.org/electronics/ Tuxgraphics] Guider Socher wrote the original TCP/IP stack code.
 
* The ENC28J60 has been used by [http://www.tuxgraphics.org/electronics/ Tuxgraphics] Guider Socher wrote the original TCP/IP stack code.
Line 40: Line 32:
 
* Almost all of the available code is derived from the Tuxgraphics stack examples.
 
* Almost all of the available code is derived from the Tuxgraphics stack examples.
 
* A good starting place is the [http://tuxgraphics.org/electronics/200905/embedded-tcp-ip-stack.shtml Tuxgraphics Tutorial] where you learn the basics of connnecting the microcontroller to the web using the ENC28J60 and transferring data to and fro. Covers PUT and GET methods.
 
* A good starting place is the [http://tuxgraphics.org/electronics/200905/embedded-tcp-ip-stack.shtml Tuxgraphics Tutorial] where you learn the basics of connnecting the microcontroller to the web using the ENC28J60 and transferring data to and fro. Covers PUT and GET methods.
* NuElectronics also use it on their Ethernet shield [http://www.nuelectronics.com/estore/index.php?main_page=product_info&amp;cPath=1&amp;products_id=4  - and have some code examples here.]
+
* NuElectronics also use it on their Ethernet shield [http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=4  - and have some code examples here.]
 
* Andrew Lindsay has [http://blog.thiseldo.co.uk/?p=344 rewritten the code] to make it easier to understand and use. He has also written a Pachube client with twitter updates. He has also implemented DNS on the Arduino/ENC28J60 combination.
 
* Andrew Lindsay has [http://blog.thiseldo.co.uk/?p=344 rewritten the code] to make it easier to understand and use. He has also written a Pachube client with twitter updates. He has also implemented DNS on the Arduino/ENC28J60 combination.
 
* Simon Monk has produced a [http://srmonk.blogspot.com/2010/03/simplified-ethernet-library-for-28j60.html simplified Server Libray for the ENC28J60 shield]
 
* Simon Monk has produced a [http://srmonk.blogspot.com/2010/03/simplified-ethernet-library-for-28j60.html simplified Server Libray for the ENC28J60 shield]
Line 47: Line 39:
 
* John Crouchley has published a sketch which allows an Arduino with ENC28J60 to retrieve CSV data from Pachube using the GET command [http://john.crouchley.com/blog/archives/706]
 
* John Crouchley has published a sketch which allows an Arduino with ENC28J60 to retrieve CSV data from Pachube using the GET command [http://john.crouchley.com/blog/archives/706]
  
Hardware &amp; Mods
+
Hardware & Mods
  
 
* A similar project on [http://www.instructables.com/id/A-credit-card-sized-Ethernet-Arduino-compatable-co/ Instructables].
 
* A similar project on [http://www.instructables.com/id/A-credit-card-sized-Ethernet-Arduino-compatable-co/ Instructables].
Line 138: Line 130:
 
* 100nF ceramic cap x 4
 
* 100nF ceramic cap x 4
 
* 10uF 16V electrolytic cap x 3
 
* 10uF 16V electrolytic cap x 3
* 28 pin 0.3&quot; DIL socket x 2
+
* 28 pin 0.3" DIL socket x 2
 
* 4 pin dip switch
 
* 4 pin dip switch
 
* RJ45 MagJack  [http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=537 CoolComponents recommended]
 
* RJ45 MagJack  [http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=537 CoolComponents recommended]
* 20 pin 0.1&quot; SIL header x2
+
* 20 pin 0.1" SIL header x2
 
* Small Tact switch
 
* Small Tact switch
 
* ATmega Ethernet PCB
 
* ATmega Ethernet PCB

Revision as of 00:16, 24 November 2010

Ethernet Arduino
Created 12/Aug/2010
Members Elliot
QR code

Discussions on the list highlighted great interest and demand for cheap Ethernet enabled Arduino compatible boards. A plan was hatched to produce a number of these boards for members and possibly for sale. Increased volumes would result in lower unit cost.

Meurig is currently constructing some similar boards using plans from Instructables and is therefore likely to be a good source of information. These boards are being etched at the space and are of 'through hole' type.

Information

Some Background.

The Arduino has had internet capability for the last couple of years following the release of the "Official Ethernet Shield" in 2008. This was based on the WizNet W5100 ethernet controller chip and will work at both with 10Mb/s and 100Mb/s. It is available in the UK for about £26 [1]

Whilst a very capable and well supported shield, the cost of the Arduino and ethernet shield together is the best part of £40. Other ethernet controller devices are available, and these started to attract the interest of the AVR hacking community, as a means of getting a very low cost ethernet connection for AVR based projects. These used the Microchip ENC28J60, which is a simpler and cheaper device than the W5100, but still offered acceptable ethernet connection and the means to build cost-effective micro web servers and web clients.

This project intends to build on some of the existing offerings (see below), to produce a low cost board fitted with ATmega328 and ENC28J60 which will allow simple servers and clients to be developed for about half the cost of an Arduino plus official shield, thus enabling this technology to be opened up to a wider user base.

A few members of the London Hackspace have decided to produce a batch of these ethernet boards, for the benefit of the members, and use them as a hardware platform on which to host fundraising training courses and workshop sessions.

It is possible that two versions of the ethernet board will be ultimately produced so as to meet two specific requirements.

  • Version A. Using conventional through hole components and DIL socketed ICs, with a connector pattern which is highly compatible with the existing Arduino shield range. Easily built by anyone who can do basic soldering.
  • Version B. A small footprint board, roughly compatible with the Arduino Nano, using mainly surface mount parts for a high specification device.


Regarding the ENC28J60 paired to the ATmega328:


Firmware & Libraries

  • The ENC28J60 has been used by Tuxgraphics Guider Socher wrote the original TCP/IP stack code.
  • Pascal Stang wrote the original code to pair the ENC28J60 with the ATmega168/328 in the AVRlib.
  • Almost all of the available code is derived from the Tuxgraphics stack examples.
  • A good starting place is the Tuxgraphics Tutorial where you learn the basics of connnecting the microcontroller to the web using the ENC28J60 and transferring data to and fro. Covers PUT and GET methods.
  • NuElectronics also use it on their Ethernet shield - and have some code examples here.
  • Andrew Lindsay has rewritten the code to make it easier to understand and use. He has also written a Pachube client with twitter updates. He has also implemented DNS on the Arduino/ENC28J60 combination.
  • Simon Monk has produced a simplified Server Libray for the ENC28J60 shield
  • Trystan Lea is using this combination for his Openenergymonitor and has improved the Client library
  • Randomskk found this page describing building arduino code from a makefile rather than the IDE
  • John Crouchley has published a sketch which allows an Arduino with ENC28J60 to retrieve CSV data from Pachube using the GET command [2]

Hardware & Mods

Power Over Ethernet

  • This project would be a good opportunity to implement power over ethernet (PoE). The choice of the magjack is critical to ensure PoE compatibility. Also a dc power supply with a wide input voltage range is needed on the ethernet board. There is a good example of how this is implemented on this Olimex product


Device Datasheets

  • Datasheet for ENC28J60 1.64MB Note small SS and QFN package options avalable
  • Datasheet (Summary) for ATmega328 Note QFN package option

Board specification

  • Surface mount to reduce size
  • PCBs supplied by a 3rd party
  • Arduino compatible
  • atmega328 32pin quad package

Rough plan

  • Agree on specification
  • Breadboard prototype
  • Design board
  • Build a prototype board
  • Use it as a platform on which to base training courses and workshop sessions
  • Build up a lot of local expertise
  • ...
  • Profit!

Bill of materials

SMT Version

  • ENC28J60-I/SO
  • ATmega328
  • Magjack HanRun HR911105A or similar
  • 25MHz crystal HC49-4mm
  • 16MHz crystal HC49-4mm
  • LD1117 -500 5V regulator
  • LD1117 - 330 3V3 regulator
  • 74AHC125D (as per John Crouchley's Mod)
  • 2 x 1N5819S schottky diodes
  • 2 x 18pF 0603 ceramic caps
  • 2 x 22pF 0603 ceramic caps
  • 12 x 100nF 0603 ceramic caps
  • 3 x 10uF 10V tantalum caps
  • 4 x 49.9R 0603 resistor
  • 2 x 270R 0603 resistor
  • 1 x 330R 0603 resistor
  • 4 x 1K 0603 resistor
  • 1 x 2K 0603 resistor
  • 3 x 10K 0603 resistor
  • 1 x reset switch
  • 2 x 0603 Green LEDs (Power, Pin 13 LED)
  • 2 x 0603 Red LEDs (Serial Rx and Tx)
  • 1 x Ferrite bead 0805 (value TBC)
  • 2 x Header 14pin
  • 1 x Header 3x2 (AVRISP Header)
  • 1 x Header 6 pin (FTDI cable connection)
  • 1 x PCB

BOM compiled from NuElectonics Nano and NuElectronics Ethernet Shield parts


  • A version based on the Instructables project using primarily through hole components - ideal for a DIY project
  • Through-hole Version
  • ATMega328P-PU - DIP version
  • Microchip ENC28J60-I/SP - DIP version
  • 74AHC125D - Surface Mount
  • 3mm LED x3
  • 1N4004 Diode
  • 78L05 Regulator
  • 78L33 Regulator
  • 16 MHz HC49-4H Crystal
  • 25 MHz HC49-4H Crystal
  • 49R9 0.25W 1% resistor x 4
  • 270R 0.25W 5% resistor x 5
  • 2K7 0.25W 5% resistor x 2
  • 10K 0.25W 5% resistor x 3
  • 18pF ceramic cap x 4
  • 100nF ceramic cap x 4
  • 10uF 16V electrolytic cap x 3
  • 28 pin 0.3" DIL socket x 2
  • 4 pin dip switch
  • RJ45 MagJack CoolComponents recommended
  • 20 pin 0.1" SIL header x2
  • Small Tact switch
  • ATmega Ethernet PCB


  • Bare Bones Breadboard Version

If you just want to knock something up quickly and cheaply on a breadboard it can be done for about £12 with a stripped down version. It can be programmed and powered using the FTDI serial cable - becoming a standard bit of kit for talking to microcontrollers. Ken has prototyped this and it is successfully sending temperature readings up to Pachube. Pachube Feed Another board is using John Crouchley's GET sketch to retrieve and print this same data from the Pachube feed

  • 1 ATmega328 microcontroller (with Arduino bootloader) - CoolComponents £5.00 (£2.81 without bootloader)
  • 1 ENC28J60 ethernet controller - CoolComponents 1.99
  • 1 Magjack breakout board - CoolComponents £1.99

The remainder of the parts came from Farnell Components:

  • 1 74AHC125 quad buffer 174-9617
  • 1 16MHz crystal 161-1761
  • 1 25MHz crystal 161-1783
  • 4 22pF ceramic capacitors 114-1760
  • 10 100nF ceramic capacitors 121-6444
  • 2 10nF ceramic capacitors 121-6435
  • 2 10uF electrolytic capacitors 945-1056
  • 1 7805 5V regulator 156-4483
  • 1 78L33 3V3 regulator 146-7768
  • 1 2K resistor 934-1480
  • 4 51ohm 1% resistors 934-3342
  • 2 270 ohm resistors 933-9353
  • 3 10K resistors 933-9060
  • 1 tact switch 181-3689

You will also need:

  • 1 breadboard
  • 1 FTDI USB-serial cable - becoming a standard bit of kit for talking to microcontrollers.
  • 1 CAT5 network cable to connect to router

Individual interests

  • Elliot: Has components for prototypes and is willing to: prototype, make boards, write code, assemble, buy 4 of these boards. However, his skill may not be as great as his enthusiasm...
  • t0m Would love to buy 2/3 SMT kits myself to practice SMT soldering. If someone is organising a load of these, would be happy to spend a weekend soldering them up for the practice. (My regular soldering is good, I've never done any real SMT however)
  • tomwj: I too would be interested in making, soldering and general prototyping/production of these boards and buying a couple
  • nigle: I can turn a back of as fag packet sketch into a neat schematic and do the board layout, I do this stuff professionally so it should look pretty good! I might well suggest or even insist on improvements to the design - you have been warned :-)
  • jmccrohan: I would be interested in purchasing 2-3 of these devices and would be willing to help out with the design
  • Ken: I can help with general design, layout, SMT assembly, sourcing parts from China and might even be able to find a Shoreditch local sponsor for this project. Working on BOM - determined to get it sub-£12.
  • User:b3cft: Would probably be after 5+ kits, SMT or through hole, don't really care too much. Happy to help/build if needed/required.
  • Ken: I have now started on an EagleCAD schematic and layout for the through-hole version - see below for first draft of placement.

This draft is purely to show that the parts will fit onto an Arduino sized board Size 52 x 68mm, and that a route is achievable. Improvements will be made to the component placement and there is likely to be some change to the choice of Magjack connector - because of discussions elsewhere about PoE compatability. It uses entirely through hole components so easy to hand assemble, and it is intended to take standard Arduino shields. This, I believe is a good compromise, as it allows anyone to build it, it can be used as a project for training courses or workshops and as a regular Arduino. A 6 way connector allows it to be connected directly to an FTDI cable for programming. Standard AVRISP connector fitted for bootloading. Etherduino 2B.jpg

  • Ken: I have ordered the components for the through-hole version so that it can be prototyped on breadboard.
  • Ken: Here is the working breadboard version Breadboard web server.jpg
  • Ken: I've now managed to get the ether-duino to send six thermistors temperature data up to Pachube (feed 8729) and get another ether-duino to GET this CSV data back from the Pachube feed. So we now have a mechanism by which one arduino can send data to another via the web. More about this on my blog.
  • Ken: Over the Bank Holiday weekend we developed low cost wired network between Arduino slaves and a master device. It uses the 2 spare buffers available on the ethernet Arduino design. I've put a summary of what we discovered on my blog
  • Paul: If you make a batch of boards please count me in.