journal of recreational computer science


Ethernet IDs on the cheap (W5100 & others)

26 Apr 2020

So you got one of those super cheap, previous-generation Arduino Ethernet boards on AliExpress for £3? Those are okay-ish for a lot of things, but what has irritated me was that I had to hard-code a MAC address in the code for each board deployed (say you got 10 boards and it becomes a bit of a PITA when upgrading software).

What you want to do, is get any 1-Wire compliant device. Each such device comes with a unique 64-bit serial number lasered (?) onto the part. 64 bits is what we get, 48 bits is what we need, so we can just take the lower 48 and get a MAC address we can use with the W5100 or ENC28J60.

Say you use a DS18B20 for this purpose - you get a unique ID and a temperature sensor. I did because it was as cheap as other options - although I’m not sure if the parts are genuine (they have unique IDs so they must be - I think?) Other parts to try are AT21CS11 - Single-Wire 1-Kbit (128 x 8) Serial EEPROM with Factory-Programmed 64-Bit Serial Number, or DS2401 - Silicon Serial Number, so really the “right” chip for the job. All of the parts above go for about £0.20 on AliExpress.

comments powered by Disqus