Stokerbot S3S

Atmega1284P ENC28J60 datalogger

Similar projects worth following
My 3rd and currently latest iteration on a network datalogger.
Recently updated to use switcing regulators.

The board has room for
9 DS18B20 sensors driven by the mega directly (3 busses).
Besides the 3 onewire busses, 4 analog and 4 digital pins also reside in the screw terminals.

There are 2 expansions headers with the spare IO pins, a "LCD" connector with a serial output, a ISP header for programming the board and finally an 6pin FTDI pin header.

My firmware uses a ethernet based bootloader, so it can be updated remotely.

Code is based off the tuxgraphics example, so one packet at a time max, with the decent memory size on 1284 that means we can send around 1.5kbyte of data at a time.
However the hardware wirings works with the 1284P arduino code, so one could use UIPethernet lib instead...

I havent been able to get the board running stable using Arduino UIP code yet, when it gets stressed it starts to drop old connections.

But basic webserver is working so ... :)

  • 1 × 74HC125D Logic ICs / Buffers, Drivers, Transceivers
  • 1 × ENC28J60 Development Kits, Boards and Systems / Adapters, Adapter Boards and Sockets
  • 1 × MAGJACK RJ45 plug with magnetics
  • 1 × Atmega1284P Microprocessors, Microcontrollers, DSPs / Microcontrollers (MCUs)
  • 1 × DS2401 Memory ICs / Other Memory ICs - System ID

View all 8 components

  • DHCP and CoAP

    MORA01/20/2015 at 17:14 0 comments

    The source code has been updated to latest stack from tuxgraphics, which adds the ability to use DHCP.

    Also added some CoAP support, for now its just spamming coap packages when theres a change over UDP to the same server as the webclient, but in time a full CoAP enabled server should be possible.

    Using UDP allows us to send updates much more frequent than with TCP, since we dont have to bother with handshakes and all, however the RFC does state that if the code dont use confirmations (and it does not) and it cant estimate a RTT it should limit itself to 1 packet every 3 seconds.
    Currently the code is more towards 1-n packages per second depending on how often sensor data changes, one problem is the analog inputs, which if unconnected will change constantly, while it makes for a easy debug of the system, its a waste of network bandwidth to send information that noone cares about.

    So ideally I should be able to detect if a ADC port is in use or not, maybe by activating internal pullup and seeing if it returns 1023, but that could damage any less than 5v sensors, unlikely but still...

    Currently all analog data is sent in one package, and all digital data is sent in one package, the DS18B20 data is sent in 1 packet per sensor change, less than ideal, so room for improvements to send all changes up to the max packet length in one.

    Still plenty of space for expansion (The data usage is mostly high due to not much code optimizations done, due to being spoiled with the sram size)
    Program Memory Usage : 51952 bytes 39,6 % Full
    Data Memory Usage : 11030 bytes 67,3 % Full

    In other news the W5500 from wiznet is now so cheap that its a much more potent competitor to ENC28J60, the price difference is about 0.5-1$ and the W5500 is 5V tolerant, so since the ENc is currently the only 3V3 device on the board the logic converter could be scrapped.
    The W5500 requires a bit more support passives though, so in total maybe 2-3$ more expensive.

    The big selling point of the wiznet chips is hardware network stack, it should be more robust than the software one used with ENC, and maybe it will play nicer on bad networks (ENC usually wont work if its conncted to bad equipment that duplicates packages, or wont accept 10mbit half duplex).
    So if the ENC is replaced with W5500 the atmega 1284 could be replaced with a lesser version since the 16KB SRAM isnt needed as much without the network buffer, and the code fits nicely in half the flash.

    Sadly theres not many Atmegas below 1284 with 4kbyte SRAM and 64kbyte flash, so downgrade options are limited.

    You can however get a SAMD21 Atmel Arm Cortex-M0+ for 2.5$, about 3$ below the 1284P with same flash/ram and 48MHz instead of 20MHz.
    But if you do that route, adding a few bucks more gets you onboard ethernet (ATSAM4E 8.5-11.5$ vs 5.5$ for D21+w5500).

    So many options ...

View project log

Enjoy this project?



MORA wrote 06/09/2015 at 06:57 point


The difference in price for W5500 solution is because it needs more support components than ENC28J60, in small volume that adds about 1-2$.

I have requested a W7500, so we will see :)

I already have a W5500 version of my board, but have not completed testing it yet, so not sure if first design will actually work yet.

With Particle Photon around the corner, I think most small scale projects will go that way, but some customers prefer wired solution still.

  Are you sure? yes | no

midnightcow wrote 06/10/2015 at 01:31 point


I'm glad that you have already requested W7500 and already W5500 version board.

Can you explain to me more detail what addtional part is need than ENC28J60?

And can you post about W5500 version borad?

Anyway, I hope you enjoy WIZwiki-W7500 platform and share the result.

Thank you.

  Are you sure? yes | no

MORA wrote 06/10/2015 at 19:32 point


My Enc28j60 sch is here :

My wiznet sch is here :

When looking at it, its not as bad as I remembered, the wiz uses about 5 more passives, but it being 5V tolerant means I may be able to skip the logic converter currently used in my S3S board.

I will post more about it when I have built the first board, my first designs usually dont work, hehe.

Not even sure if the magjack will work with the W5500, but will find out, one way or another :)

  Are you sure? yes | no

midnightcow wrote 06/11/2015 at 00:22 point


I can't show your link - error 404. I wonder what's 5 additional parts.

Anyway, I hope Your first design will be worked well, and I  will cheer you up.

Please, continuous interest in W5500 and WIZnet product.

And I will expect  good relationship with you.

Thank you.

  Are you sure? yes | no

midnightcow wrote 06/09/2015 at 00:11 point

Dear MORA!!!

I'm a WIZnet engineer. I'm interested in your project. Your post is very good for comparing  W5500 vs ENC28J60. 

But I don't understand the price of difference. As I know, 1 unit price is almost same. (Mouse site : ENC28J60 $3.4, W5500 : $3..24) .

As you already known, W5500 consists of Ethernet PHY, MAC and TCP/IP stack fully hardwired and is available Robust TCP/IP stack and   small code & data memory. In addition, W5500 protect your system from unknown packet attack without your MCU overhead.

Unattackable Articles refer to

If you want to make StokerBotS3S with W5500 or D21+W5500 based CortexM0, I will sent W5500 or WIZwiki-W7500 to you free charge.

WIZwiki-W7500 is new WIZnet product - new SOC chip W7500 (CortexM0+TCP/IP core)   Platform - is available free sample on

If you are interested in WIZnet product as W5500, WizFi250, W7500 and etc, Feel free contact to me (

Thank you so much. 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates