Projects with Arduino Uno & Raspberry Pi with Examples for the MCP2515 CAN Bus Interface Module
This book details the use of the Arduino Uno and the Raspberry Pi 4 in practical CAN bus based projects. Using either the Arduino Uno or the Raspberry Pi with off-the-shelf CAN bus interface modules considerably ease developing, debugging, and testing CAN bus based projects.
This book is written for students, practicing engineers, enthusiasts, and for everyone else wanting to learn more about the CAN bus and its applications. The book assumes that the reader has some knowledge of basic electronics. Knowledge of the C and Python programming languages and programming the Arduino Uno using its IDE and Raspberry Pi will be useful, especially if the reader intends to develop microcontroller-based projects using the CAN bus.
The book should be a useful source of reference material for anyone interested in finding answers to questions such as:
What bus systems are available for the automotive industry?
What are the principles of the CAN bus?
How can I create a physical CAN bus?
What types of frames (or data packets) are available in a CAN bus system?
How can errors be detected in a CAN bus system and how dependable is a CAN bus system?
What types of CAN bus controllers exist?
How do I use the MCP2515 CAN bus controller?
How do I create 2-node Arduino Uno-based CAN bus projects?
How do I create 3-node Arduino Uno-based CAN bus projects?
How do I set the acceptance masks and acceptance filters?
How do I analyze data on the CAN bus?
How do I create 2-node Raspberry Pi-based CAN bus projects?
How do I create 3-node Raspberry Pi-based CAN bus projects?
Tout sur les protocoles et leur mise en œuvre avec Arduino
Initialement destiné aux véhicules routiers, le réseau CAN (« Controller Area Network ») et son successeur le réseau CAN FD (« Flexible Data ») ont vu leurs champs d’application s’élargir à de nouveaux domaines. L’industrie propose de nombreux modules microcontrôleurs dotés d’une interface CAN et/ou CAN FD. L’environnement de développement Arduino a démocratisé la programmation de ces modules et il existe des bibliothèques qui implémentent un pilote CAN et/ou un pilote CAN FD.
La première partie dresse un rapide historique des réseaux CAN et CAN FD et expose la problématique des lignes de transmission en abordant succinctement leur théorie et présentant des résultats de simulation Spice.
La deuxième partie est consacrée au réseau CAN, en détaillant successivement la fonction logique du réseau, les transcepteurs, les contrôleurs, la topologie la plus classique (le bus) et d’autres moins courantes, les répéteurs et les passerelles. Les aspects particuliers du protocole, tels que le bit stuffing, l’arbitrage, les trames d’erreur, la détection des erreurs sont exposés. La discussion de la fiabilité du protocole est illustrée par des exemples mettant en évidence ses faiblesses.
La troisième partie présente le protocole CAN FD, ses deux variantes CAN FD ISO et CAN FD non ISO, leurs fiabilités, leurs faiblesses, mises en évidence par des exemples. Différents transcepteurs et contrôleurs CAN FD sont décrits.
La quatrième partie est dédiée aux applications : comment utiliser les services d’un pilote, concevoir une messagerie, utiliser un analyseur logique. Deux exemples d’application terminent cette partie.
Ce livre s’adresse aux amateurs et aux ingénieurs non spécialistes pour comprendre les possibilités qu’offre un réseau CAN et comment on le met en œuvre. Un enseignant trouvera des informations pour approfondir ses connaissances et pour concevoir des travaux pratiques. Une connaissance des microcontrôleurs, de leur programmation, de l’électronique numérique aidera à la lecture des schémas. La connaissance du langage C++ et du langage de simulation électronique Spice facilitera la compréhension des programmes qui sont décrits dans le livre. Tous les codes source sont disponibles sur le dépôt GitHub de l’auteur.
Téléchargements
GitHub
Projects with Arduino Uno & Raspberry Pi with Examples for the MCP2515 CAN Bus Interface ModuleThis book details the use of the Arduino Uno and the Raspberry Pi 4 in practical CAN bus based projects. Using either the Arduino Uno or the Raspberry Pi with off-the-shelf CAN bus interface modules considerably ease developing, debugging, and testing CAN bus based projects.This book is written for students, practicing engineers, enthusiasts, and for everyone else wanting to learn more about the CAN bus and its applications. The book assumes that the reader has some knowledge of basic electronics. Knowledge of the C and Python programming languages and programming the Arduino Uno using its IDE and Raspberry Pi will be useful, especially if the reader intends to develop microcontroller-based projects using the CAN bus.The book should be a useful source of reference material for anyone interested in finding answers to questions such as:
What bus systems are available for the automotive industry?
What are the principles of the CAN bus?
How can I create a physical CAN bus?
What types of frames (or data packets) are available in a CAN bus system?
How can errors be detected in a CAN bus system and how dependable is a CAN bus system?
What types of CAN bus controllers exist?
How do I use the MCP2515 CAN bus controller?
How do I create 2-node Arduino Uno-based CAN bus projects?
How do I create 3-node Arduino Uno-based CAN bus projects?
How do I set the acceptance masks and acceptance filters?
How do I analyze data on the CAN bus?
How do I create 2-node Raspberry Pi-based CAN bus projects?
How do I create 3-node Raspberry Pi-based CAN bus projects?
De USB-CAN-FD is een hoogwaardige industriële USB-naar-CAN-FD-adapter, CAN/CAN-FD bus communicatie-interfacekaart en CAN/CAN-FD protocoldata analysator. Aan boord dubbele onafhankelijke CAN-FD interfaces met elektrische isolatie en meerdere beveiligingscircuits. Ondersteunt Windows, wordt geleverd met stuurprogramma's, CAN-FD Tools gerelateerde software, secundaire ontwikkelingsvoorbeelden en tutorials.Het kan via een USB-poort worden aangesloten op een pc of industriële besturingshost om transceiverbesturing, gegevensanalyse, verzameling en bewaking van CAN/CAN-FD-busnetwerk te realiseren. Het apparaat is compact en gebruiksvriendelijk en kan worden gebruikt voor het leren en debuggen van de CAN/CAN-FD-bus en voor secundaire ontwikkeling en integratie in diverse industriële, energiecommunicatie- en intelligente besturingstoepassingen die CAN/CAN-FD-bus communicatie vereisen.Specificaties
Soort product
Industriële kwaliteit: USB naar CAN-FD interfaceconverter, CAN/CAN-FD bus communicatie-interfacekaart, CAN/CAN-FD protocoldata analysator
USB
Bedrijfsspanning
5 V (rechtstreeks van de USB-poort zonder externe voeding)
Aansluiting
USB-B
CAN/CAN FD-interface
CAN/CAN FD-kanaal
Tweekanaals: CAN1 en CAN2 (onafhankelijk en volledig geïsoleerd, isolatie spanning: 3000 V DC)
Aansluiting
CAN-bus schroefklem (OPEN6 5,08 mm steek)
Afsluitweerstand
Elk CAN/CAN-FD-kanaal heeft twee ingebouwde 120? afsluitweerstanden, die kunnen worden ingeschakeld met een schakelaar
Baudrate
100Kbps~5Mbps (configureerbaar via software)
Protocol ondersteuning
CAN2.0A, CAN2.0B en ISO 11898-1 CAN-FD protocol V.1.0
Overdrachtssnelheid
De ontvangst- en verzendsnelheid van elk CAN/CAN-FD-kanaal kan 20000 frames/s en 5000 frames/s bereiken.
Buffer voor verzenden
1500 frames ontvangstbuffer en 64 frames zendbuffer per kanaal (automatisch opnieuw zenden als de verzending mislukt)
Indicatoren
PWR
Voedingsspanning
SYS
Systeemstatus, normaal uit; blijft aan als er een bus fout is
CAN1
CAN1-kanaalindicator (knippert bij verzenden en ontvangen van data)
CAN2
CAN2-kanaalindicator (knippert bij verzenden en ontvangen van data)
Systeemondersteuning
Windows
Windows XP/7/8/10/11 (32/64 bits); biedt nog geen ondersteuning voor Linux; de bijbehorende stuurprogramma's zijn in ontwikkeling.
Bedrijfstemperatuur
?40 tot +85°C
Materiaal behuizing
Aluminium behuizing + 3D vlamwerende isolatieplaten aan beide zijden (Dit ontwerp kan een betere bescherming bieden tegen elektrische ontladingen, verbetert de veiligheid van het product en verlengt de levensduur)
Afmetingen
104 x 70 x 25 mm
Inbegrepen
Waveshare USB-CAN-FD
USB-A naar USB-B kabel
4-pins kabel
Schroevendraaier
DownloadsWiki
This Grove CAN-BUS Module based on GD32E103 adopts a brand-new design, uses the cost-effective and high-performance GD32E103 microcontroller as the main control and cooperates with a firmware we wrote to complete the function of the serial port to CAN FD. Features
Support CAN communication: Implements CAN FD at up to 5 Mb/s
Easy to program: Support AT command which enables simple serial port programming
Grove ecosystem: 20 x 40 x 10 mm small size, 4-pin Grove connector to plug and play, Arduino compatible This Grove CAN-BUS Module supports CAN FD(CAN with Flexible Data-Rate) communication, which is an extension to the original CAN protocol as specified in ISO 11898-1 that responds to increased bandwidth requirements in automotive networks. In CAN FD, the data rate (i.e. number of bits transmitted per second) is increased to be 5 times faster than the classic CAN (5 Mbit/s for the data payload only, the arbitration bit rate is still limited to 1Mbit/s for compatibility). It supports AT command which enables simple serial port programming. This Grove CAN-BUS Module is based on GD32E103 with a frequency up to 120 MHz. It has a flash size from 64 KB to 128 KB and an SRAM size from 20 KB to 32 KB. Applications Car hacking: allows different parts of the vehicle to talk to each other, including the engine, the transmission, and the brakes. Windows, doors, and mirror adjustment. 3D Printers Building automation Lighting control systems Medical instruments and equipment Specifications MCU GD32E103 UART baud rate Up to 115200 (default 9600) CAN FD baud rate Up to 5 Mb/s Indicator TX and RX led Working voltage 3.3 V Grove connector 4-pin Grove connector to plug and play Size 20 x 40 x 10 mm Downloads Datasheet GitHub
The PiCAN2 Duo board provides two independent CAN-Bus channels for the Raspberry Pi 2, 3, and 4. It uses the Microchip MCP2515 CAN controller, with connections made via a 4-way screw terminal.
An easy-to-install SocketCAN driver is available, and programming can be done in C or Python.
Kenmerken
CAN v2.0B at 1 Mb/s
High speed SPI Interface (10 MHz)
Standard and extended data and remote frames
CAN connection screw terminal
120Ω terminator ready
Serial LCD ready
LED indicator
Four fixing holes, comply with Pi Hat standard
SocketCAN driver, appears as can0 and can1 to application
Interrupt RX on GPIO25 and GPIO24
Downloads
User guide
Schematic Rev B
Software installation
Writing your own program in Python
Deze kit is de perfecte oplossing om te communiceren met de OBD-II-interface van uw voertuig zonder dat u naar een monteur hoeft. Hij bevat een seriële CAN-busmodule, een OBD-II-connector en andere accessoires waarmee u alle diagnoses en datalogging eenvoudig kunt uitvoeren. Er is ook een tutorial gebaseerd op Arduino. Met deze tutorial kunt u eenvoudig gegevens uit uw voertuig halen.
Kenmerken
Snelle seriële communicatie met CAN-bussnelheden tot 1 MB/s
Eenvoudige installatie met alle meegeleverde componenten
Ga eenvoudig aan de slag met de meegeleverde Arduino-tutorials
Ondersteuning voor meerdere platforms (Arduino, Raspberry Pi, Beaglebone Board, enz.)
Inbegrepen
1x Seriële CAN-busmodule
1x OBD-II-connector
1x Schroevendraaier
1x Kabel voor CAN-bus
1x Grove-kabel
Downloads
Wiki
Arduino-bibliotheek
Schema
Van de makers van MagPi, het officiële Raspberry Pi-magazine
Ga aan de slag met Raspberry Pi 5, de nieuwste en beste in de Raspberry Pi-microcomputerlijn; leer programmeren en creeren met deze fantastische computer.
Daarnaast zijn er nog genoeg dingen die je kunt doen met Raspberry Pi 4, Raspberry Pi Zero 2 W en Raspberry Pi Pico W in dit handboek.
Met de nieuwste recensies, tutorials, projectpresentaties, handleidingen en nog veel meer is dit je ultieme bron voor Raspberry Pi!
228 pagina’s Raspberry Pi
Alles wat je moet weten over de Raspberry Pi 5
Snelle en praktische gids voor elke Raspberry Pi
Beleef serieus plezier met elektronica en de Pico W
Inspirerende projecten voor uw volgende bouwidee
Leer ?Python door een “handheld” te bouwen
Aan de slag met de Raspberry Pi Camera-module
Kunstmatige Intelligentie; bouw je eigen GPT Chatbot
Features Volgt CAN V2.0B tot 1 Mb/s Industriële standaard 9 pins sub-D connector OBD-II en CAN standaard pinout selecteerbaar. Verwisselbare chip select pin Verwisselbare CS pin voor TF-kaartslot Verwisselbare INT pin Schroef terminal die gemakkelijk aan te sluiten CAN_H en CAN_L Arduino Uno pin headers Micro SD kaarthouder 2 Grove connectoren (I2C en UART) SPI-interface tot 10 MHz Standaard (11 bit) en uitgebreide (29 bit) data en remote frames Twee ontvangstbuffers met geprioriteerde berichtopslag
2-ch CAN HAT+ is an isolated expansion board for Raspberry Pi. It supports dual-channel CAN communication and features multi-protection circuits, wide voltage input, and more.
Features
Designed for Raspberry Pi
Standard HAT+ design, with onboard EEPROM chip.
Adopts MCP2515 and SN65HVD230 dual-chip solution, allowing 2-channel CAN communication.
Integrated power isolation, providing stable isolated voltage, requires no extra power supply for the isolated terminal.
Onboard digital isolation chip, signal isolation communication is safer, more stable, and better anti-interference.
Onboard SM24CANB (transient voltage suppressor), provides ESD protection and transient peak voltage protection.
Onboard voltage conversion circuit, select 3.3 V/5 V operating voltage by jumper.
Onboard 120 Ω terminal resistor, enable through the jumper cap.
Elicits the SPI control interface, for connecting with host control boards like STM32/Arduino.
Provides online supporting information manuals and demos.
Specifications
CAN controller
MCP2515
Control Bus
SPI
Power supply method
External power supply terminal or Raspberry Pi GPIO
Terminal voltage input
DC 7~36 V
Operating voltage
5 V
Logic level
3.3 V/5 V
Dimensions
65.0 x 56.5 mm
Downloads
Wiki
This PiCAN 2 board provides CAN-Bus capability for the Raspberry Pi 2/3. It uses the Microchip MCP2515 CAN controller with MCP2551 CAN transceiver. Connection are made via DB9 or 3-way screw terminal. This board includes a switch mode power suppler that powers the Raspberry Pi is well.
Easy to install SocketCAN driver. Programming can be done in C or Python.
Not suitable for Raspberry Pi 4, please use PiCAN 3 instead.
Kenmerken
CAN v2.0B at 1 Mb/s
High speed SPI Interface (10 MHz)
Standard and extended data and remote frames
CAN connection via standard 9-way sub-D connector or screw terminal
Compatible with OBDII cable
Solder bridge to set different configuration for DB9 connector
120Ω terminator ready
Serial LCD ready
LED indicator
Foot print for two mini push buttons
Four fixing holes, comply with Pi Hat standard
SocketCAN driver, appears as can0 to application
Interrupt RX on GPIO25
5 V/1 A SMPS to power Raspberry Pi and accessories from DB9 or screw terminal
Reverse polarity protection
High efficiency switch mode design
6-20 V input range
Optional fixing screws – select at bottom of this webpage
Downloads
User guide
Schematic Rev B
Writing your own program in Python
Python3 examples in Github
Features
ATmega32U4 met Arduino Leonardo bootloader op het bord
MCP2515 CAN Bus controller en MCP2551 CAN Bus transceiver
OBD-II en CAN standaard pinout selecteerbaar op de sub-D connector
Compatibel met Arduino IDE
Parameter
Waarde
MCU
ATmega32U4(met Arduino Leonardo bootloader)
Kloksnelheid
16 MHz
Flashgeheugen
32 KB
SRAM
2,5 KB
EEPROM
1 KB
Bedrijfsspanning?CAN-BUS?
9 V - 28 V
Bedrijfsspanning?MicroUSB?
5 V
Invoer Interface
sub-D
Inclusief
CANBed PCBA
sub-D connector
4PIN aansluiting
2 x 4PIN 2.0 Aansluiting
1 x 9x2 2.54-kopje
1 x 3x2 2.54-kopje