These days, even really cheap microcontroller boards have options that will give you Ethernet or WiFi access. But what if you have a Raspberry Pi Pico board and you really want to MacGyver yourself a network connection? You could do worse than check out this project by [holysnippet] that gives you a bit-banged bidirectional Ethernet port using only scrap passive components and software.
This project is similar to one we shared back in August by [kingyo], but differs in that what [holysnippet] has achieved is a fully-functional (albeit only around 7 Mbps) Ethernet port, rather than a simple UDP transmit device. The Ethernet connection itself is handled by the lwip stack. Connection to the RJ45 socket can be made from any of the Pi Pico pins, provided TX_NEG is followed directly by TX_POS, but the really hacky part is in the hardware.
Rather than developing hardware that would protect the Pico, this design admits that it “shamefully relies on the Pico’s input protection devices” to limit the Ethernet voltages to 3.3 V.
You’ll need an isolation transformer from some old Ethernet-enabled gear (either standalone or as part of a magnetic jack), but then it’s only resistors and capacitors from there. There are warnings not to connect this to PoE networks for obvious reasons, and the component layout needs to keep in mind the ~20 MHz frequencies involved, but to get this working at all feels like quite a feat.
Normally, there’d be no reason to go to these lengths, but it’s always educational to see if it can be done and, with the current component shortages, this is another trick to keep up your sleeve for emergencies!
Putting ports where they shouldn’t belong is not a new idea, of course. Back in the day we even shared an inadvisable ATTINY implementation of bit-banged Ethernet with no protection at all.
Thanks to [biemster] for the tip-off