|
A project I’ve been hacking on for a while is a self-contained 1-wire to IPv6 bridge based on an Atmel AVR ATmega644 and the ENC28J60 Ethernet controller from Microchip. 1-wire: is a serial bus from Dallas Semiconductor/Maxim that only requires 1 data line, there are a number of cheap sensors and other devices for this bus. The strength of this bus is not its speed but that it supports large ranges (up to 300 meters). IPv6: Insanely large address space. It’s common to use a 64-bit netmask for site networks so that EUI-64 based addresses can be used for auto configuration. This leaves 64-bit for the node address – do you see where this is going now… :) Yes..I’ve built a device that assigned each 1-wire device it’s connected to its own IPv6 address. Why? you ask, mostly because I can.
HardwareAs mentioned above, the device is based on an AVR ATmega644. It has 64KB of flash memory for program code and 4KB of RAM. It’s running on its built-in oscillator at 8MHz. The ENC28J60 Ethernet chip is connected to the AVR using SPI. The rest of the hardware is mostly for power distribution and management. The PCB was manufactured by BatchPCB, cheap service but a bit slow turn-around time. Unfortunately I screwed up the SPI connection but I managed to fix that with some green wires (or black wires in this case). You’ll note them in the picture above. As for the 1-wire devices I had implemented a bus master in software that generated the require waveforms. It worked great up to about 10-15 meters. Any cable length greater than that refused to work. This required an add-on board and because I didn’t want to wait for a new PCB I used a 2.54mm prototype board. With the DS2480 only available in SOIC8 packages it required some “creative” soldering :). The add-on board is extremely ugly. But hey, it works. Future improvements for the next revision
I’ll publish the PCB CAD files when the next revision is complete. SoftwareThe only small IPv6 stack I know of is the uIPv6 stack in the Contiki operating system created by Adam Dunkel et al. This is unfortunately only available together with Contiki and not as a stand alone package as the originally uIP (IPv4) stack. Contiki is a great operating system, but when you only have 4KB of RAM it becomes a bit heavy weight. So I broke out the uIPv6 stack from Contiki and made it run stand alone and ported in to AVR. I also ported the web server application from Contiki and made it run on AVR. As I wanted to use multiple IPv6 addresses I also had to add support for IP aliases to the uIPv6 stack. Since the uIPv6 was integrated with Contiki it used the Contiki process model which it self is based on “proto-threads” (another thing invented by Adam Dunkel). I felt that this didn’t fit so I turned all processes into a polling mode instead. So one has to call a set of polling functions from the main application loop or from timers. The other major parts of the code are drivers for ENC28J60, DS2480 and DS1820. Software
Currently, with 5 1-wire devices connected it uses about 3KB of RAM. In-actionI only have temperature sensors connected at the moment. If you happen to have an IPv6 capable connection you can access the sensors through a web browser. 2001:16d8:ffe5:002:2894:eaf6:100:0c7 (If you don’t have IPv6 you should get it, or you can view graphs based on the sensor values at lindberg.tl instead).
21 Responses to “1-wire meets IPv6”
|




Entries (RSS)
I am very interested in building a few of these. I see in your last comment you were in the process of re-designing the circuit to be more effecient. I was woncering if you had a schematic and/or a bill of materials you could post. Also, I was looking to connect up to 16 DS18S20’s to a single unit. Seeing 5 sensors plus the base system use 3 out of 4KB of RAM, would an ATmega1284P be a suitable upgrade?
Interesting! Does it mean that all the ethernet’s TX- TX+ RX- RX+ are multiplexed into one wire somehow? If we had a pair of this device with an infrared circuit, can two PCs working like peer-to-peer wirelessly?
teh sensors are offfliiiiiiiineeeee
Doyou know of any ‘low Cost” design for a IP V4 Standard Etherenet (One Ethernet address) to one wire interface controller.
Should have a web server/data logger for sensor data… incl..
Thanks
Ken
P.S. I absolutely love your design….
Hi Frederik,
I’ve just taken a look at your code and can see that you have disabled IRQ mode.
I suppose, like me, you had problems in this mode. Are you able to use this mode now ?
If yes, I should be happy to know your trick :)
Frederic
PS : Nice project. I do similar things at owbox.com, especialy internet of things
@Quirinius
I’m not sure about the RAM in the tuxgraphics hardware.
The stack it self should run with 2K RAM, but for any (half) serious application you
probably want 4K.
Wow, that’s cool!
And BTW: your temperatures are also very low. ;-)
Can the uIPv6 run on the tuxgraphics hardware?
James:
You could use a laser(or anything else). But 1-wire bus have 2 advantages:
-very low cost(for bus wire and devices).
-parasite power. You can hang thermometers(ex) on the 1-wire bus and they can “steal” power from the bus.
For a wireless approach maybe you should look for ZigBee.
Great! Great! Great!
About your problems with 1-wire bus lengths over 15m, did you account for the bus capacitance? Were you using a simple open-drain uC output with a pull-up resistor?
For such long buses you will need higher currents to pull the bus up! There are several Dallas semiconductors AN covering that.
You can decrease the pull-up resistor value(up to half the current drain capability of the uC when in drain mode, otherwise you will be getting problems for push-down phase).
You can switch to a push-pull output.
You can add an active driver with a BJT/FET.
Last option can achieve very long distances.
Instead of the single wire could you transmit via a modulated laser beam?
This is very cool! Could you look at my website (and specifically http://www.klein.com/thermd/ and http://www.klein.com/thermd/thermd.cgi) and let me know if you think we could work together? I’d be very interested in getting a copy of your system and seeing how easily it could be expanded to read other DalSemi sensors. What would you say the cost of a unit would be (ignoring your development costs – what could I buy a “kit” for?
@nave.notnilc:
Probably too much to justify what it’s doing. It was mostly just for fun and sort of a proof-of-concept project.
someguy at hackaday said ethersex has implmented OpenVPN as well as ipv6.
What would you say the net cost was for this project?
You win the internets. I’m looking at hooking an AVR up to the network for SNTP requests, and I’ve got an allergy to IPv4-only systems. w00t.
I’ve never used Teredo tunneling.
If you can reach http://ipv6.google.com then you should be able to reach the sensors too.
From ipv4 lan with Teredo Tunneling I will see the sensors ?
@jimy
No they are working fine. Verified ping6 from a remote looking glass site, 0% packet loss.
But you don’t seem to be IPv6 enabled, your comment was posted from an IPv4 address but this site is IPv6 capable. If you were IPv6 capable your post should have originated from an IPv6 address.
Hi,
Is there know issue with temperature sensors because I can not see the link from Opera browser?
Thank you in advance.
Cool! You make a great work man.
I am started with IPV6 today so please help me.
1)Please let me know if you have a small test project to test ping for example. Also can you send me your full project IPv6+ENC28J60 Web server ?
I work with Keil compiler and have now issues with some missing files so I want your full project no only SVN code. Also please include in your SVN code main() function file.
2)Can I test ipv6 in any network or should I have a Ipv6 server/IPv6 gateway?
3) If I can ping6 ipv6.google.com so I can ping a ipv6 device?
4) Can I test only PC and ipv6 device with a cross cable ?
Thanks.
This is really cool! I really want to collect temperature / rainfall / water tank stats using IPv6.
[ I'm the IPv6 evangelist at work. ]
I was hoping to use real Contiki + uIPv6.
Did you ever compile Contiki + uIPv6 + your ENC28J60 code?
How big was it?
AVR Ravens looked good, but they need a PC for 6lowpan wireless wired IPv6 gateway.
I was hoping to build something using Arduino-like hardware and ENC28J60 daughter board.
http://moderndevice.com/index.shtml or http://www.seeedstudio.com/depot/seeeduino-v328-fully-assembled-p-439.html
http://www.futurlec.com.au/Mini_Ethernet.jsp
Or port IPv6 bits back to ATmega328 + ENC28J60 Web server
http://www.tuxgraphics.org/electronics/200905/embedded-tcp-ip-stack.shtml
http://www.tuxgraphics.org/electronics/200906/home-climate-control.shtml
http://shop.tuxgraphics.org/electronic/detail_avrwebserver_smd4.html
But if you have already done it that’s teriffic. I’m interested in (un-)assembled boards, kits, whatever.
Moore’s law will make AVRs big enough for IPv6 … unless ARM chips running Linux get cheap enough first!