New Part Day: An Open Source Ethernet Switch In The Palm Of Your Hand

When you can get a WiFi-enabled microcontroller for $3, it’s little surprise that many of the projects we see these days have ditched Ethernet. But the days of wired networking are far from over, and there’s still plenty of hardware out there that can benefit from being plugged in. But putting an Ethernet network into your project requires a switch, and that means yet another piece of hardware that needs to get crammed into the build.

Seeing the need for a small and lightweight Ethernet switch, BotBlox has developed the SwitchBlox. This 45 mm square board has everything you need to build a five device wired network, and nothing you don’t. Gone are the bulky RJ45 jacks and rows of blinkenlights, they won’t do you any good on the inside of a robot’s chassis. But that’s not to say it’s a bare bones experience, either. The diminutive switch features automatic crossover, support for input voltages from 7 V all the way up to 40 V, and management functions accessible over SPI.

If you want to get up and running as quickly as possible, a fully assembled SwitchBlox is available to purchase directly from BotBlox for £149.00. But if you’re not in any particular rush and interested in saving on cost, you can spin up your own version of the Creative Commons licensed board. The C++ management firmware and Python management GUI isn’t ready for prime time just yet, but you’ll be able to build a “dumb” version of the switch with the provided KiCad design files.

The published schematic in their repo uses a Microchip KSZ8895MQXCA as the Ethernet controller, with a Pulse HX1344NL supplying the magnetics for all the ports in a single surface mount package. Interestingly, the two images that BotBlox shows on their product page include different part numbers like H1102FNL and PT61017PEL for the magnetics, and the Pulse H1164NL for the Ethernet controller.

Make Networks Wired Again

There’s no question that WiFi has dramatically changed the way we connect devices. In fact, there’s an excellent chance you’re currently reading these words from a device that doesn’t even have the capability to connect to a wired network. If you’re looking to connect a device to the Internet quickly, it’s tough to beat.

But WiFi certainly isn’t perfect. For one, you have to contend with issues that are inherent to wireless communications such as high latency and susceptibility to interference. There’s also the logistical issues involved in making that initial connection since you need to specify an Access Point and (hopefully) an encryption key. In comparison, Ethernet will give you consistent performance in more or less any environment, and configuration is usually as simple as plugging in the cable and letting DHCP sort the rest out.

Unfortunately, that whole “plugging in” part can get tricky. Given their size, putting an Ethernet switch into your project to act as an internal bus only works if you’ve got space to burn and weight is of little concern. So as appealing as it might be to build a network into your robot to connect the Raspberry Pi, motor controllers, cameras, etc, it’s rarely been practical.

This little switch could change that, and the fact it’s released under an open source license means hackers and makers will be free to integrate it into their designs. With the addition of an open source management firmware, this device has some truly fascinating potential. When combined with a single board computer or suitably powerful microcontroller, you have the makings of a fully open source home router; something that the privacy and security minded among us have been dreaming of for years.

91 thoughts on “New Part Day: An Open Source Ethernet Switch In The Palm Of Your Hand

  1. “the days of wired networking are far from over”

    Darned right! I avoid wireless whenever I can.

    If an SBC doesn’t have an RJ45 jack, I am on to the next product. I do love my little ESP8266 boards though!

    1. Listen now, I´m an engineer specialized in wireless technologies and based on my education and experiences, you are absolutely right! Avoid using wireless if possible!

      And no, not because of tin hat reasons.

      Wireless networks have way more obstacles to climb over than wired that it’s best to give them the fighting change every time it’s possible. Always prefer wired connections if it’s reasonable to wire it and don’t worry that “it’s overkill for this thing as it uses like no bandwidth”. Just remember that by doing so, you are helping your other devices which have to rely on the wireless connection to work.

      1. Hah! You remind me of me.

        My focus in undergrad was RF and wireless communications. Grad school was information/communication theory and DSP.

        My first job after grad school was heavy on EMI testing.

        Rule 1: If it doesn’t have to be wireless, don’t make it wireless!

        It seems that you, like myself, have a solid enough understanding of wireless systems to know when it is NOT the correct solution.

      2. I’ve worked in broadcasting on large transmitters both AM, FM and TV, and have been a HAM operator for ove 25 years. Spent 10 years with HP on RF gear. I think I kind of know a bit about RF. So I totally agree with Harold and his comments. Same for Severe Tire Damage. The only WIFI I like to use is for portable devices like cell phones and tablets. Don’t get me started on all the bad things I have to say about WEMO!! I do agree about the comment about my ESP32. I love those little boards for unique little jobs. My house and barn are wired but they connect over a WIFI bridge although I have a project in the works to run fiber between them and remove the bridge devices. It takes very little to wire things together and causes a whole lot less pain.

        1. That reminds me of my chicken pen with an electronic door I built which is controlled by an STM32 Blackpill at the pen and an ESP8266 in the house that connects to the home WIFI connection.

          The comms between ESP8266 and the STM32 Blackpill is via RF24.

          Everything was working fine until a small tree that was growing near the line of sight eventually grew branches large enough that blocked the RF24 signal…

          That sort of thing doesn’t occur with wired networks! :)

  2. What? No Gigabit?
    j/k
    I can think of a lot more than robotics for a device like this.
    My car, a wheelchair, a the-open-frame-computer-building-a-hardware-hacker-friendly-pc
    or project-retrospective-raspberry-pi-field-unit-from-2015

      1. As a network guy, my house built in the 90’s uses single gang boxes to connect cat5 for tip/ring phone – I always wanted to exploit this for wired ethernet around my crib, but small electronics were an issue to fit into gang boxes than as cat5 at least, as was 3-floor construction that makes it hard to run new. I saw this and suddenly got re-interested. I remember old 3com wall switch fixtures for this I considered.

        Awesome, almost something I can terminate rj45 jacks in and out from, at least one data plane, and a few outbound ports like this I can fit into a wall outlet. I see audio/video connectors like hd-base-t use these, nothing more open though or generally produced like this.

        Probably a small market for this, how small can you make a few port switch? I’d love to daisy-chain my switching per wired outlet in/out, as it’s clean signal path, but hop to hop to hop through my house per phone jack.

        1. Depends on the number of ports, tough to say. But if made a three port version (which would sort of be the minimum), I could probably get it to fit within a 27mm x 27mm (roughly 1 inch square) footprint. The toughest part is doing that while matching lengths on the differential ethernet lines… still probably doable

      2. That is very exciting for me and I’ve signed up for updates. I’ve got two GigE cameras mounted on a vehicle and a need to control some additional accessories. I looked around for for switch boards that were small enough to mount inside the camera enclosure and something roughly this size would be perfect.

          1. No blog but we’re using two allied vision cameras, a Mako for visual and a Goldeye for SWIR wavelengths. We’re synchronizing the image capture to GPS so we’ve got bandwidth requirements around 200-500Mbps.

  3. 149 GBP for a 10/100 switch?!

    thats almost 185 USD, and then add shipping!

    I can get a 10/100 switch for almost nothing on ebay, or $18 at microcenter, and a good chance I can get gigabit for that.

    take it out of the case, and bang! I got a small profile switch.

    I get it that it’s “open source” meaning the pcb is free, but wow, just wow.

    -I have an open-source ethernet cable for sale, 4″ for $20.00

    -I have an open-source serial cable for sale 9pin, 4″ for 25.00, 25pin for an extra 10.00

      1. One got to be really frugal you know.
        Pennies here and pennies there is what makes the difference between us plebs and a billionair.
        So just think about what a whole bunch of dollars does instead!

        Or rather, one can enter in any name one wants here on HackaDay, and any website link too.
        Not to mention any email address too… So it really isn’t anything but anonymous to be fair.
        (Ie, I doubt that Bill Gates has the desire to stroll around this place, let alone post actual comments under his own name.)

        1. Yeah it’s a fair point. I would like it to be cheaper. Realistically the cost is around £50-70 for me to make them in small volume, so generally my selling price needs to be at least double that to make an ok profit after taxes.

          I’ll look at making a cost optimised one in the future, but I’d rather get something helpful out there quickly, then optimise later when there’s demand (seems like there is which is awesome).

          In any case it’s open source specifically so that people can make their own version.

      1. It is not a managed switch. VLAN is typically available on the Ethernet switch. QoS may be. The rest does require an IP capable processor.

        – Ability to prioritise network connections (QoS) – so your IP calls or video will never be interrupted
        – Added security by ringfence some devices (VLAN), for example for testing purposes
        – Granular monitoring of network stats (enabling SNMP)
        – Advance networking tools like IP routing, CLI (Command-line Interface)

        Closest thing is the cheapest WiFi router with an alternate firmware to expose the VLAN interface.

        1. True. It has the capability to be a managed switch if you connect to the expansion header over SPI to set the control registers from another devices. I’d love to build an addon board for that, and write firmware when I get some time.

          1. I’m not passing it off as a managed switch, I haven’t called it such. As in my comment, it has the capability to be a managed switch if you connect to it over the expansion header.

            The datasheet for the switch IC states that it can operate both as a unmanaged and managed switch. On its own, on this board, it’s unmanaged.

            The guy who wrote this article tagged it as “managed switch”, which isn’t accurate; unfortunately I have no control over that.

          2. On the site, you mention that it can do spanning tree with SPI. You need more than SPI, you have to have a host processor connected via port 5 as well. The switch chip can handle the addressing and punting of STP packets, but it cannot process them. It needs a processor on port 5 to receive and process the packets, and configure the STP state of each port, which is done via SPI. With SPI only, sure you can do VLANs and QOS, static MACs, etc. But it’s still not a managed switch unless it’s got a CPU port and the CPU exposes a management interface.

    1. That was my thought on this. At first it sounded amazing for ethernet based cameras. Instead of running 4 often difficult to handle wires across the building, run 1 across to one of these and then 4 to their respective cameras. At that cost however, it’s cheaper just to run the extra wire and deal with the pain of guiding them along a good path.

    2. I did a quick run through on the BOM. In batches of 50, total BOM cost should be about $32. Add build cost, etc, and you should be approaching $50. Street price of $69-89 would be typical. I see he has them listed on sale for $99 right now, which is still fair for a new launch. You could roll your own cheaper, but there is something to be said for having one ready to go. Unfortunately, nowadays, no one wants to pay anything above chinese knockoff prices. Not saying te price couldn’t come down, but you can’t expect everything for free.

      1. If the BOM is £50 and he sells them for £70, he’ll make £8 after tax. Assuming he’s paying himself £20/hour for his time – because hey, EEs aren’t exactly skilled labour, any idiot can design something like this, haha – then that gives him 24 minutes to assemble and test each one, and box and ship it. We’ll also assume he had no design costs or time to recoup. We’ll also assume he has no marketing costs, and no support costs (because it’s open source, his support@ email can just give an auto-reply with the source code! Problem solved! It’s open source!)

        So yeah, his pricing seems reasonable.

        1. He was saying $50 fully built (I’m assuming Chinese contract manufacturer). Set things up right and all you need to do is watch the cash arrive in your account, nothing else to do beyond the design and development work. Yes, his time isn’t free, but once the up-front work is done then that can be amortised over the units sold (so the higher the volume the better).

          1. Its a bit more than that e.g. competition, user support, business risk (what if it doesn’t sell), capital for setup, inventories, paperwork.

            On the other hand, one can make smart investments and not having to run a business. e.g. ETF, index funds etc.

        2. That’s Henry Ford making 100 Model Ts by hand and selling them for a million dollars each. You can do that ever since mass production was invented. It will always be a luxury item. And hobbyist are young cheapo guys living in the basement…

        3. You are mixing up DIY Open Source efforts with a full fledged business model so your math will of course not work out, but rather simply support sarcasm in posts. You can’t use straight labor rate based math because that doesn’t exist in the DIY world.
          I do not usually include amortization of my design time into my product cost, but rather consider them part of my profit margin because my efforts are valued at the success level of my design, not because I am an Engineer. If my design is for a client, then they will get charged design time accordingly as an NRE charge.
          That is obviously different in my day job at an EMS where my employer charges more per hour than what I get paid per hour for my deliverables to our customers.

  4. The two Pulse products show in the photo are a 4-port magnetics package and a 1-port package. The switch chip must be under the 4 port or on the other side. Pulse doesn’t make switch chips.

  5. This is an excellent idea!

    But they completely lost me with the price.

    At that rate, fora hobby project it’s still more than worth the effort to pull the PCB out of a small, inexpensive switch and desolder all the connectors. Maybe a scratch build is worthwhile, I haven’t priced out the parts but I doubt it because if so then their profit margin must be huge!

    1. To be fair I’m only considering this against the cost of buying a cheap switch and those generally do not have as good of throughput as an expensive rack-mount pro switch.

      Maybe this thing comes with 149GBP worth of quality?

      Who puts that kind of money into the network side of a hobby robot though? I’m pretty sure Boston Dynamics shops elsewhere. If my robot gets a $10 switch off of Fleabay it will be grateful that it isn’t stuck with just RS485!

          1. Also I’d argue the market isn’t really hobbyists.

            This is designed for people who are wanting to integrate a quality piece of hardware into their semi-professional prototype; and given that it’s open source, they can then later design this part directly into their own boards. They can also write custom firmware for advanced applications, given them a tonne of functionality.

            Not to be rude, but trying doing any of that with an off-the-shelf ethernet switch.

          2. “Also I’d argue the market isn’t really hobbyists.”

            Ok. That makes sense then. I would much rather bring your product to my boss than the PCB gutted from some cheap switch with the connectors desoldered like I described earlier. Sorry, I misjudged who you were aiming for.

      1. I mean, they cost me like £50 to £70 to make in the small volumes I order. To make an ok profit after that I sorta need to sell for at least double after taxes.

        Trust me, I’d like it to be cheaper… I’m working on ways to make that happen, but in the mean time the source files are open source :)

          1. Sorta yeah. It was my first time getting a product like this out there, so it’s never going to be perfect.

            I think what’s great is that people are interested, so I can work on ways to increase volume and reduce cost for the future.

            It’s not really comparable to an off-the-shelf ethernet switch, because everything’s open including the software; I feel like your comparison to a “Switch Dev Board” is pretty accurate.

    2. “pull the PCB out of a small, inexpensive switch and desolder all the connectors.”

      In general, removing them would be a bad idea as switches usually have the magnetics in the connectors.

      No magnetics means no DC isolation, no protection for the PHY, no common mode noise filtering, etc.

      1. You can kinda spot that by height of the ports off the board though. If you get one that’s lower profile it may have them separate. I guess you can chop their tops off if you really need to cut weight or space. If it’s a packaging issue, maybe one can buy a bunch of scrap PCI NICs at the 30 cents a pound rate and pull off magnetic packages, but those are usually klunkier than modern stuff.

  6. The H1102FNL is a single transformer. The H1164NL is a quad transformer. The KSZ8895MQXCA is a five port ethernet switch. The switch IC is on the BOTTOM of the board.

    Hence the confusion.

    Also, $149!?

      1. There is also a gigabit version of this chip for a few dollar more: KSZ9897R. I used it, it more or less just works.

        It also has 2 RGMII ports so you can connect a local microcontroller without wasting a PHY.

  7. from the looks of things it’s a very simple design and if you build your own it’s fairly cheap
    given they’ve released all the firmware and pcb’s open source it should be a lot cheaper just to roll your own

    the two main IC’s appear to be
    https://uk.rs-online.com/web/p/ethernet-switch-ics/1773543 – £4.54
    https://www.digikey.co.uk/product-detail/en/pulse-electronics-network/HX1344NL/HX1344NL-ND/6025118 – £5.31

    two features of interest would be Gb and EtherCat support for motion control

  8. If you want an ethernet solution, seriously take a look at Microchip’s other ethernet solutions. There are some really cool options from 10/100 up to gigabit and some open app-notes, full reference designs, some software provided…
    A scroll through their website lists some really interesting gigabit options with integrated PHY’s and SFP support.

    I have been looking for reasons to build an embedded switch with some of Microchip’s other switch products, waffling between the KSZ9897 and the KSZ9477 and whether or not I want to try and drive myself insane building a managed PTP (IEEE1588v2) compatible switch to bolt into to an eventual network time solution.

      1. The transformers are providing electrical isolation – this is being undone by sharing a common ground between the boards.

        Building cables that twist TX+/TX- and RX+/RX-, like in CAT5, will have a greater impact on reducing interference than a shield.

        1. It’s not really intended to be used to ground two boards together. In fact the cables I sell omit the ground connection specifically for that reason.

          As a designer I have a choice to include something that could be useful for shielding (even it rarely used) or omit it completely. As it happened, I had the space for the ground connection so I added it. I don’t see any issue with that.

  9. Looks promosing as to integrate in a small distributed computing platform.

    Yeah the price does “appear” to be high but that’s only because we have been conned by Organisations that use slave labor and heavy subsidies and mass manufacturing.

    Open source doesn’t mean you should be able to have it for nothing – we all need to eat. If you don’t like the price I’m sure you can roll your own and it will cost more. Your unlikely to get it right first rev. So you you’ll need to make at least 2 and spend the time working out what you did wrong the first time. And wait for the new boards to be made, more components to arrive, more shipping costs. Or you just pay this guy to send you one and gives him enough money to buy dinner for the next couple of days.

    Or you could pay a fraction of the price and get a unit you can’t integrate into your design, and you will be unlikely to buy an identical one in 3months time.

  10. I have a prototyped and production ready design sitting on my desk for a similar device to this, it’s a 4 port 10/100 managed ethernet switch as a raspberry pi hat. The switch is controllable via SPI on the pi so you can do port mirroring and switch individual ports on and off.

    I designed it as a “why not” project and showed it to a few of the usual suspects to see if anyone would pick it up to sell but had little interest due to the price being relatively high compared to a cheap 4 port off the shelf switch.

    The port mirroring means you could install wireshark on it and use it as a remote packet sniffer, the port switching allows you to daisy chain the devices and then assign them IP addresses based on their location in the chain, I’m sure there are plenty more uses I haven’t thought of yet!

    Retail price for something like tindie would be 60gbp/70usd. Is there much interest from the community in something like this?

    1. Yeah I believe that’s true, though I think the ethernet spec sorta discourages against it. The issue with that I believe would be reduced tolerance to external noise. These are designed to be integrated into robots and drones, with spinning motors, so it’s really prudent to just include the magnetics.

    2. Most ethernet PHYs don’t generate a very clean differential signal, and the receivers don’t have that high common mode rejection. It will work fine with capacitive coupling for short lengths, but it will cause and be susceptible to EMI. For a device like a robot that is likely to contain radios etc it probably it not good, you can easily de-sense the receiver.

      For backplane applications capacitive coupling is perfect with differentially routed traces. You can go >20cm without EMI problems.

    1. I think the point of this is it’s a switch, all ports are just switch ports in the same vlan/network. A router, firewall, whatever you want to call them, has a “wan”, and an “inside”, typically inside some 4-5 port switch (like this), but otherwise include a full processor for routing, nat (security), and some sort of policy management between “wan” and “inside” like any dd-wrt-based router for home. This is just the 5 switch ports in a single vlan, no routing, security, etc, real dumb networking over ethernet.

      1. Ethernet ports are full duplex, so they’re simultaneously “in” and “out”.

        Switches do routing on the data link layer so they’re not dumb at all. It has to learn what IPs are connected first (in a process called network discovery) and then forwarding packets based on the right destination IP. In other words, it works on the data link layer; it has to know the network and read the packet addresses and destinations so it’s not dumb at all.

        You’re thinking of an ethernet hub, which essentially just forwards packets on all ports, which would be regarded as dumb.

      2. You said: “It has to learn what IPs are connected first” which is incorrect.

        From datasheet:
        >Non-Blocking Switch Fabric Ensures Fast Packet Delivery by Utilizing a 1K MAC Address LookupTable and a Store-and-Forward Architecture
        >The KSZ8895MQX/RQX/FQX/MLX is a highly-integrated, Layer 2 managed, five-port switch

        i.e. it is learning and looking at MAC for routing. it doesn’t even need to be IP packets.

        For networking people, a simple layer 2 switch is considered dumb (no additional smarts) and boring.

      1. Hey Glen,

        So I did a re-design of the board and added PoE injection onboard now. It’s still sort of a Beta feature, but what it does is take the input voltage and injects this onto any combination of the ethernet ports via a DIP switch and some onboard transistors.

        If you use 44-48 input voltage, this is compliant with IEEE 802.3af. If not, it’s not really PoE that’s compliant so it might not work. I’m planning a board to handle PoE from 5V input.

        Link to the new version of SwitchBlox with PoE injection is below.

        https://www.botblox.io/product/small-ethernet-switch/

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.