Router Controlling Choo-choos Over The CAN Bus

This setup is used to control a model railroad. Well, not entirely this setup. [Gerhard Bertelsmann] already has a proper railroad controller, and it just happens to offer CAN bus communications. He’s using OpenWRT and a cheap router to connect the bus to the network.

Originally he wanted to use a Raspberry Pi board for the project, but the incredible backorder  situation with that hardware led him to grab an old router. After loading OpenWRT he started working out how to connect a couple of ICs (MCP2515 and MCP2551) that will take care of the CAN bus communications. The hardware connections end up being pretty simple, with five data lines (and their pull-up resistors) connecting to the router’s serial header. From there it was a matter of mapping the device in software so that the hardware can be controlled over the network.

We like this example since CAN is used is a lot of other applications.

4 thoughts on “Router Controlling Choo-choos Over The CAN Bus

  1. Not everybody is looking for easier, and easier is a very relative concept. A couple of $2 ICs, some perf-board and connectors/minor components (which may already be laying around the shop) might not need to get easier. It could certainly be much more economical.

  2. There are many ways to connect a CAN controller
    to an OpenWrt board (e.g. USB, serial). Most of the devices are quite expensive. I didn’t find any SocketCAN compatible device under 80 bucks …

    do you know about a cheaper device ?

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.