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.

Comments

  1. iamalion says:

    Would a 2CAN be easier?

  2. canidsong says:

    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.

  3. regulatre says:

    Nice job! I’m already thinking of how these plans could be applied to a vehicle CAN network…

  4. Gerhard Bertelsmann says:

    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 …

    @iamalion,
    do you know about a cheaper device ?

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Follow

Get every new post delivered to your Inbox.

Join 94,522 other followers