Skip to content

006 Arduino & CBUS Demo Plank

johnmholmes edited this page Aug 28, 2024 · 19 revisions

Project started mid 2024

CAN Input & Outputs Sketches

While I have used Martins original sketch to produce these versions I have not adopted the changes to the Event variable changes that can be found in his latest version.

I wanted to make a variety of sketches available which people could just download and use without changing anything within the sketch.

Project introduction.

The reason I am sharing this project with the group is because I feel it offers a good way to have a CAN layout control bus. I will be building this system using Arduino Nano's and the MCP2515 modules which are readily available from various sources. There will be a number of libraries required to get this working.

The project will be shared with short step by step videos shared on the MersAG YouTube video channel as I make them available. I am using GitHub rather than the MERG Knowledgebase as I find it easier this way.

I will not be going in to how it all works as this will put a lot of people off trying to give this a go. But will cover the important items I feel need to be explained.

Items required for the project.

  1. At the start of the project the CANUSB4 kit is available at £12.54 plus postage.
  2. Arduino Nano's x 2 from Aliexpress £2.20.
  3. Arduino Sensor shield x 2 from Aliexpress £2.40.
  4. DuPont jumper cables.
  5. LEDs x 6.
  6. Suitable current limiting resisters x 6.
  7. Push buttons x 6.
  8. Breadboard.
  9. 12volt 2 Amp power supply. Used later on in the series.
  10. A computer with the Arduino IDE installed.
  11. Installed libraries covered in the videos.

Connecting the Arduino to the MCP2515 Module

Screenshot 2023-12-10 041615

Part 1 video Intro to project

https://youtu.be/qulLcbNJFVg

Can Bus wiring & Termination resistors

My intention is to keep it simple to follow and not go into much details. Depending on the layout side certain things will need to be taken into consideration.

  1. Termination resistors

It is best practice to use 2 120 ohm resistors at either end of the twisted pair wires of the Can Bus. The MCP2515 modules I show have a jumper that can be used to achieve this.

Screenshot 2024-08-16 133838

  1. Crystal frequency

The modules have two different crystals frequencies. I am using the 8 megahertz versions and have set this in the example sketches.

Part 2 video

https://youtu.be/yxI2G12sg5U