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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s