Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use SparkFun AST-CAN485 IO Shield 24V: Examples, Pinouts, and Specs

Image of SparkFun AST-CAN485 IO Shield 24VDesign with SparkFun AST-CAN485 IO Shield 24V in Cirkit Designer

Introduction

The SparkFun AST-CAN485 IO Shield is an electronic component designed to facilitate communication between a microcontroller, such as an Arduino, and devices using the CAN (Controller Area Network) protocol. This shield operates at 24V, making it suitable for industrial applications where higher voltage levels are common. It is an ideal choice for automotive systems, home automation, and other projects requiring robust communication between various electronic devices.

Explore Projects Built with SparkFun AST-CAN485 IO Shield 24V

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ESP32-Based Motion Tracking System with ICM20948 Sensor: A project utilizing SparkFun AST-CAN485 IO Shield 24V in a practical application
ESP32-Based Motion Tracking System with ICM20948 Sensor

This circuit features a SparkFun ESP32 Thing Plus microcontroller interfaced with an Adafruit ICM20948 9-axis motion sensor via an Adafruit TXB0104 4-channel bi-directional level shifter. The ESP32 reads data from the ICM20948 sensor, calculates orientation angles such as pitch, roll, yaw, and azimuth, and outputs these values to the serial monitor. The level shifter ensures compatibility between the 3.3V logic levels of the ESP32 and the 1.8V logic levels required by the ICM20948.

Open Project in Cirkit Designer
Image of Arduino UNO R4 WiFi Controlled Dissolved Ozone Monitoring System with RS485 and LCD Display: A project utilizing SparkFun AST-CAN485 IO Shield 24V in a practical application
Arduino UNO R4 WiFi Controlled Dissolved Ozone Monitoring System with RS485 and LCD Display

This circuit features an Arduino UNO R4 WiFi microcontroller connected to an RS485 module for serial communication with a dissolved ozone sensor, whose readings are displayed on a 2.4" LCD. A joystick provides user input, and a power supply module converts 220V AC to 24V DC for the sensor. The Arduino's embedded code orchestrates the sensor data acquisition, display updates, and user interaction.

Open Project in Cirkit Designer
Image of Arduino Nano and SX1278 LoRa Communication Module: A project utilizing SparkFun AST-CAN485 IO Shield 24V in a practical application
Arduino Nano and SX1278 LoRa Communication Module

This circuit integrates an Arduino Nano with an SX1278 LoRa transceiver module via an I/O Expansion Shield for SPI communication. It is designed for long-range wireless data transmission, with the Arduino Nano serving as the central processing unit to control the LoRa module. The provided code is a placeholder, suggesting that the user-specific application logic is yet to be developed.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Description Notes
1 CAN_H CAN High
2 CAN_L CAN Low
3 GND Ground
4 V+ (24V) Supply Voltage
5 NC Not Connected
6 NC Not Connected
7 Digital IO Configurable digital input/output
8 Analog Input Analog sensor input

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Ensure that the shield is powered with a stable 24V supply.
  2. Connection to Microcontroller: Attach the shield to your Arduino or compatible microcontroller.
  3. CAN Bus Connection: Connect the CAN_H and CAN_L pins to your CAN network.
  4. Digital/Analog IO: Utilize the digital and analog pins for additional sensors or actuators as needed.

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can I use this shield with a 5V Arduino? A: Yes, the shield is compatible with 5V Arduinos, but the CAN network operates at 24V.

Q: How do I program the Arduino to communicate over CAN? A: You will need to use a CAN library for Arduino, such as the MCP_CAN library, to handle the CAN communication.

Q: What is the maximum length for the CAN bus wiring? A: The maximum length depends on the baud rate; for lower baud rates, longer lengths are possible. Typically, up to 40 meters at 1 Mbps is acceptable.

Example Arduino Code

#include <mcp_can.h>
#include <SPI.h>

// Initialize CAN controller at CS pin 10
MCP_CAN CAN0(10);

void setup() {
  Serial.begin(115200);
  
  // Initialize CAN controller at 500 kbps
  if (CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_8MHZ) == CAN_OK) {
    Serial.println("CAN controller initialized");
  } else {
    Serial.println("CAN controller initialization failed");
  }
  
  // Set normal operation mode
  CAN0.setMode(MCP_NORMAL);
}

void loop() {
  // Check for incoming messages
  if (CAN0.checkReceive() == CAN_MSGAVAIL) {
    unsigned char len = 0;
    unsigned char buf[8];
    
    // Read data: len = data length, buf = data byte(s)
    CAN0.readMsgBuf(&len, buf);
    
    // Print received message
    for (int i = 0; i < len; i++) {
      Serial.print(buf[i], HEX);
      Serial.print(" ");
    }
    Serial.println();
  }
}

Note: This example assumes the use of the MCP_CAN library for handling CAN communication. Ensure that the library is installed in your Arduino IDE before compiling and uploading the code to your microcontroller.