Ethernet For Hackers: Transformers, MACs And PHYs

We’ve talked about Ethernet basics, and we’ve talked about equipment you will find with Ethernet. However, that’s obviously not all – you also need to know how to add Ethernet to your board and to your microcontroller. Such low-level details are harder to learn casually than the things we talked about previously, but today, we’re going to pick up the slack.

You might also have some very fair questions. What are the black blocks near Ethernet sockets that you generally will see on boards, and why do they look like nothing else you see on circuit boards ever? Why do some boards, like the Raspberry Pi, lack them altogether? What kind of chip do you need if you want to add Ethernet support to a microcontroller, and what might you need if your microcontroller claims to support Ethernet? Let’s talk.

Transformers Make The Data World Turn

One of the Ethernet’s many features is that it’s resilient, and easy to throw around. It’s also galvanically isolated, which means  you don’t need a ground connection for a link either – not until you want a shield due to imposed interference, at which point, it might be that you’re pulling cable inside industrial machinery. There are a few tricks to Ethernet, and one such fundamental Ethernet trick is transformers, known as “magnetics” in Ethernet context.

Each pair has to be put through a transformer for the Ethernet port to work properly, as a rule. That’s the black epoxy-covered block you will inevitably see near an Ethernet port in your device. There are two places on the board as far as Ethernet goes – before the transformer, and after the transformer, and they’re treated differently. After the transformer, Ethernet is significantly more resilient to things like ground potential differences, which is how you can wire up two random computers with Ethernet and not even think about things like common mode bias or ground loops, things we must account for in audio, or digital interfaces that haven’t yet gone optical somehow.

Continue reading “Ethernet For Hackers: Transformers, MACs And PHYs”

Ethernet For Hackers: Equipment Exploration

Last time, we talked about the surface-level details of Ethernet. They are fundamental to know for Ethernet hacking, but they’re also easy to pick up from bits and pieces online, or just from wiring up a few computers in your home network. Now, there’s also a bunch of equipment and standards that you will want to use with Ethernet – easy to find whether used or new, and typically as easy to work with. Let’s give you a few beacons!

Routers And Switches

Whenever you see a box with a few Ethernet ports, it’s either referred to as a router, or a switch, sometimes people will even use the word “hub”! Fortunately, it’s simpler than it may seem. A router is a smart device, typically with an OS, that ties two or more networks together – routing packers from one network to another, and typically taking care of things like handing out local IP addresses via DHCP. A switch merely helps Ethernet devices exchange packets between each other on the same level – it’s typically nowhere near as smart as a router gets. Oftentimes, a home router will contain a switch inside, so that you can plug in multiple of your home devices at once. That’s the main difference – a switch merely transmits packets between Ethernet-connected devices, while a router is a small computer taking care of packet forwarding between networks and possibly including an Ethernet switch on the side.
Continue reading “Ethernet For Hackers: Equipment Exploration”

Designing A LoRa Gateway During A Part Shortage

It’s fair to say that right now is probably the worst possible time you could choose to design a new piece of hardware. Of course the reality is that, even in the middle of a parts shortage that’s driving the cost of many components through the roof (if you can even find them), we can’t just stop building new devices. In practice, that means you’ll need to be a bit more flexible when embarking on a new design — it’s like the Stones said: “You can’t always get what you want / But if you try sometime you’ll find / You get what you need”

For [Ryan Walmsley], that meant basing his new outdoor LoRa gateway on the ubiquitous Raspberry Pi was a non-starter. So what could he use in its place? The software situation for the Nano Pi Duo looked pretty poor, and while the Onion Omega 2+ was initially compelling, a bug in the hardware SPI seemed to take it out of the running. But after more research, he found there was a software implementation that would fit the bill. Continue reading “Designing A LoRa Gateway During A Part Shortage”

Developing A Power Over Ethernet Stack Light

A common sight on factory floors, stack lights are used to indicate the status of machinery to anyone within visual range. But hackers have found out you can pick them up fairly cheap online, so we’ve started to see them used as indicators in slightly more mundane situations than they were originally intended for. [Tyler Ward] recently decided he wanted his build own network controlled stack light, and thought it would double as a great opportunity to dive into the world of Power Over Ethernet (PoE).

Now the easy way to do this would be to take the Raspberry Pi, attach the official PoE Hat to it, and toss it into a nice enclosure. Write some code that toggles the GPIO pins attached to the LEDs in the stack light, and call it a day. Would be done in an afternoon and you could be showing it off on Reddit by dinner time. But that’s not exactly what [Tyler] had in mind.

An early Arduino-based prototype.

He decided to take the scenic route and designed his own custom PCB that combines an Ethernet interface, PoE hardware, and the ESP32 into one compact unit. It’s no great secret that it only takes a few extra components to plug the ESP32 into the network rather than relying on WiFi, but it’s still not something we see done very often by hobbyists. Rarer still is seeing somebody roll their own PoE solution, but thanks to the in-depth documentation [Tyler] has provided for his circuit, that may change in the future.

On the software side [Tyler] has developed a firmware for the ESP32 that supports both Art-Net and RDM protocols, which are subsets of the larger DMX protocol. That means the controller should be compatible with existing software designed for controlling theatrical lighting systems. If you’d rather take a more direct approach, the firmware also sports a web interface and simple HTTP API to provide some additional flexibility.

While it’s exceptionally impressive, not everyone will need such a robust solution. If you just want a quick and easy way to fire up your stack light, a USB controlled relay and some Python can get you where you need to go.

A Cyclopic LCD Case For Your Raspberry Pi Server

If you’ve got a personal website that needs hosting or a few hundred gigabytes of files that could use a centralized storage location, the Raspberry Pi’s small size and extreme energy efficiency make it a compelling server choice compared to that curbside Pentium 4 box you’ve been trying to find a home for. All you need is something to put in.

Of course there’s no shortage of Pi case designs ready to be extruded from your 3D printer, but we recently found ourselves particularly taken with this unique one designed by [Ken Segler]. It’s not only small and sleek with a dash of futuristic flair, but it includes a front-mounted two inch 240 x 320 IPS display that connects to the Pi over SPI. At the minimum that gives you a way to see all those beautiful boot messages on startup, but with a little code, it could provide you with various system statics and status messages at a glance.

While the LCD is clearly the star of the show here, the case also has a few other nice features that make it worthy of your consideration. The magnetically attached fan filter on the the top, for one. The stacked layout that puts the Pi directly above the SSD also makes for a relatively compact final product.

One thing to note though is that [Ken] is using Power-over-Ethernet, meaning there’s no spot for a dedicated power jack on the case. It’s an easy enough feature to add into your own build, but naturally not everyone’s network is suitably equipped. In that case, beyond the normal annoyances of editing STL files, it shouldn’t be too much trouble to add one in without having to literally hack your way through the printed plastic.

A Network Attached VFD Tube Clock

The elegance of Power over Ethernet (PoE) is that you can provide network connectivity and power over a single cable. Unfortunately not nearly enough hardware seems to support this capability, forcing intrepid hackers to take matters into their own hands. The latest in this line of single-cable creations is this beautiful Vacuum Fluorescent Display (VFD) clock from [Glen Akins].

Testing the VFD tube socket

One of the key advantages VFDs have over their Nixie predecessors is greatly reduced energy consumption, and after [Glen] ran the numbers, he saw that a display using six VFD tubes could easily be powered with standard PoE hardware. With this information, he started designing the PCB around the early 1990s era IV-12 tube, which has the advantage of being socketed so he could easily remove them later if necessary.

[Glen] first had to create a schematic and PCB footprint for the IV-12 tube that he could import into Eagle, which he was kind enough to share should anyone else be working with these particular tubes down the line. After a test of the newly designed socket was successful, he moved onto the rest of the electronics.

The clock is powered by a Microchip PIC18F67J60, which connects to the Ethernet network and pulls the current time down from NTP. After seeing so many clocks use an ESP to connect to the Internet over WiFi, there’s something refreshing about seeing a wired version. The tube segments are driven by a HV5812, also Microchip branded. Lastly, [Glen] used a number of DC/DC converters to generate the 1.5 V, 3.3 V, 5 V, and 25 V necessary to drive all the electronics and VFDs.

We absolutely love the simplicity of this clock, from its sleek aluminum enclosure to that single RJ45 jack on the back. But if you’re looking for something with a bit more flash, [Glen] also put together some PoE Christmas lights over the holidays which share a number of design elements with this project.

Continue reading “A Network Attached VFD Tube Clock”

PoE Powers Christmas Lights, But Opens Up So Much More

Addressable LEDs are a staple of homemade Christmas decorations in our community, as is microprocessor control of those LEDs. So at first sight [Glen Akins]’ LED decorated Christmas tree looks pretty enough, but isn’t particularly unusual. But after reading his write-up you’ll discover there’s far more to the project than meets the eye, and learn a lot about the technologies behind it that has relevance far beyond a festive light show.

The decoration is powered exclusively from power-over-Ethernet, with a PIC microcontroller translating Art-Net DMX-over-Ethernet packets into commands for the LED string. The control board is designed from the ground up and includes all the PoE circuitry, and the write-up  gives a very thorough introduction to this power source that takes the reader way beyond regarding PoE as simply another off-the-shelf black box. Along the way we see all his code, as well as learn a few interesting tidbits such as the use of a pre-programmed EEPROM containing a unique MAC address.

So if your house has CAT5 wiring and you want an extra dimension to your festive splendour, you’ve officially got a whole year to build your own version. He’s featured here before, with his buzzer to break the Caps Lock habit.

Continue reading “PoE Powers Christmas Lights, But Opens Up So Much More”