Arduino and MCP2515 CAN Bus Communication with LED Indicators
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves multiple microcontrollers (Arduino UNO and SparkFun RedBoard) interfacing with MCP2515 CAN controllers and LEDs. The circuit is designed to demonstrate communication between microcontrollers and control of LEDs.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
MCP2515
- Description: A CAN controller with SPI interface.
- Pins: INT, SCK, SI, SO, CS, GND, VCC, H, L
LED: Two Pin (green)
- Description: A green LED with two pins.
- Pins: cathode, anode
Resistor (330 Ohms)
- Description: A resistor with a resistance of 330 Ohms.
- Pins: pin1, pin2
LED: Two Pin (yellow)
- Description: A yellow LED with two pins.
- Pins: cathode, anode
SparkFun RedBoard
- Description: A microcontroller board similar to the Arduino UNO.
- Pins: GND, VIN, A0, A1, A2, A3, A4/SDA, A5/SCL, ICSP MISO, 5V, ICSP SCK, ICSP MOSI, RESET, D8, D9 PWM, D10 PWM/SS, D11 PWM/MOSI, D12/MISO, D13/SCK, AREF, D0/RX, D1/TX, D2, D3 PWM, D4, D5 PWM, D6 PWM, D7, ioref, N/C, 3V3
Wiring Details
Arduino UNO
- D3 connected to anode of LED: Two Pin (green)
- D2 connected to anode of LED: Two Pin (green)
- D13 connected to SCK of MCP2515
- D12 connected to SO of MCP2515
- D11 connected to SI of MCP2515
- D10 connected to CS of MCP2515
MCP2515
- H connected to H of other MCP2515 modules
- L connected to L of other MCP2515 modules
- VCC connected to 5V of SparkFun RedBoard
- GND connected to pin1 of Resistor
- CS connected to D10 PWM/SS of SparkFun RedBoard
- SI connected to D11 PWM/MOSI of SparkFun RedBoard
- SO connected to D12/MISO of SparkFun RedBoard
- SCK connected to D13/SCK of SparkFun RedBoard
LED: Two Pin (green)
- anode connected to D3 of Arduino UNO
- cathode connected to pin2 of Resistor
Resistor (330 Ohms)
- pin1 connected to GND of MCP2515
- pin2 connected to cathode of LED: Two Pin (green)
LED: Two Pin (yellow)
- anode connected to D2 of Arduino UNO
- cathode connected to pin2 of Resistor
SparkFun RedBoard
- 5V connected to VCC of MCP2515
- GND connected to pin1 of Resistor
- D10 PWM/SS connected to CS of MCP2515
- D11 PWM/MOSI connected to SI of MCP2515
- D12/MISO connected to SO of MCP2515
- D13/SCK connected to SCK of MCP2515
Code Documentation
Arduino UNO (Instance 1)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Arduino UNO (Instance 2)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the microcontrollers.