Tag: Arduino

CAN-ISO: Code configuration and test

08 Feb 20
admin
,
No Comments

In this section we will see how to configure the module RubinoLAB CAN-ISO on Arduino and how to test it.

To buy CAN-ISO: LINK

The implemented protocol uses a standard ASCII communication. This makes the system compatible with any program (Python, LabVIEW, MATLAB etc), simple to adapt to your project.

The first step is to install the MCP_CAN library (if you have not already installed it), in the Arduino editor. Here is the link of the library:

https://github.com/coryjfowler/MCP_CAN_lib

Create a project with the example code shown here or alternatively download the attached project and unpack it in your workbook.

CANINO_v2 CANINO_V2.zip

Compile and upload it to the Arduino module.

//revisione 2 del 30/03/2018, con Arduino 1.8.5
/*
  CAN BUS + ARDUINO --> CANINO interface :)
  USB <--> CAN BUS interface
  Author: Luigi Rubino

  Adesso accetta 3 byte di indirizzo

  STRING EXAMPLE:
  @00A0102030405060708\n
*/

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

#define CAN0_INT 2                              // Set INT to pin 2
MCP_CAN CAN0(10);                               // Set CS to pin 10


// the cs pin of the version after v1.1 is default to D9
// v0.9b and v1.0 is default D10
// Can_Bus_shield-ISO-v1 is default D10
//const int SPI_CS_PIN = 10;
//MCP_CAN CAN(SPI_CS_PIN);                                    // Set CS pin

unsigned char buf[8];
unsigned char canId;
long unsigned int rxId;


#define LEN_STRING 10

unsigned char ReceivedString[LEN_STRING];  //stringa ricezione carattere da USB

int inByte = 0;         // incoming serial byte

//global var
int  digValue, sign=1;
char rxpos, rxpos2;          //per il parser seriale
int address;                //comando da eseguire
int DT;


void setup() {
  // start serial port at 115200 bps:
  Serial.begin(115200); //provare velocità 115200
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
 
  // Initialize MCP2515 running at 16MHz with a baudrate of 500kb/s and the masks and filters disabled.
  if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK)
    Serial.println("MCP2515 Initialized Successfully!");
  else
    Serial.println("Error Initializing MCP2515...");
  
  CAN0.setMode(MCP_NORMAL);                     // Set operation mode to normal so the MCP2515 sends acks to received data.

  pinMode(CAN0_INT, INPUT);                            // Configuring pin for /INT input
  
  Serial.println("CANINO READY...");
}

void loop() {

  unsigned char len = 0;
  
  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {
    // get incoming byte:
    inByte = Serial.read();
    //Serial.write(inByte);
    // delay 10ms to let the ADC recover:
    //delay(10);
    
 /* Get the character received from the USART */
  if (inByte=='@')
   {
     rxpos     = 1;
     digValue  = 0;
   }
  else
  {
    
//    Serial.print("-->");
//    Serial.print((int) rxpos);
//    Serial.println();
    
  switch(rxpos)
  {
   case 1:
      address   = hex2int(inByte);
      rxpos    += 1;
      
      break;

   case 2:
      address   <<=4; 
      address += hex2int(inByte);     
      rxpos    += 1;

      break;
      
   case 3:
      address   <<=4; 
      address += hex2int(inByte);    
      rxpos    += 1;
      rxpos2   =  0; 

      break;
                  
   case 4:   //byte 1
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 5:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;

   case 6:   //byte 2
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 7:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;
 
   case 8:   //byte 3
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 9:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;

   case 10:   //byte 4
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 11:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;
      
   case 12:   //byte 5
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 13:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;

   case 14:   //byte 6
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 15:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;

   case 16:   //byte 7
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 17:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;

   case 18:   //byte 8
      DT = hex2int(inByte);
      rxpos    += 1;
      break;
   case 19:
      DT   <<=4; 
      DT += hex2int(inByte);
      ReceivedString[rxpos2] = DT;
      rxpos    += 1;
      rxpos2   += 1;
      break;
                  
   case 20: //eseguo il comando
        CAN0.sendMsgBuf(address, 0, 8, ReceivedString);
        //byte sndStat = CAN0.sendMsgBuf(0x100, 0, 8, data);
    //delay(100);          // send data per 100ms
      rxpos    = 0;

//da rinuovere
//      Serial.print(address, HEX);
//      for (int kk=0;kk<=7; kk++)
//      {
//        Serial.print(" ");
//        Serial.print(ReceivedString[kk], HEX);
//        
//        }
//        Serial.println();
    break;
    default: 
        rxpos    = 0;
        break;
  }
  }    //fine gestione acquisizione 
  }  //fine gestione seriale

  // --------------------------------------------------
  //gestione CAN BUS
  if(!digitalRead(CAN0_INT))                         // If CAN0_INT pin is low, read receive buffer
  {
    CAN0.readMsgBuf(&rxId, &len, buf);      // Read data: len = data length, buf = data byte(s)

    canId = (unsigned char) rxId;
//    canId = CAN0.getCanId();       // indirizzo risposta
        
 //       Serial.println("-----------------------------");
 //       Serial.print("Get data from ID: ");
        Serial.print("@");
        Serial.print(canId, HEX);

        for(int i = 0; i<len; i++)    // print the data
        {
            if (buf[i]<=15)  {  Serial.print('0');}
            Serial.print(buf[i], HEX);
        }
        Serial.println();
    }
 
}

void establishContact() {
  while (Serial.available() <= 0) {
    Serial.print('A');   // send a capital A
    delay(300);
  }
}

int hex2int (char c)
{
  if (c >= '0' && c <= '9')
  {
      return (int) (c-'0');
  }
  else
  {
      return (int) ((c - 'A')+10);
  }
}
CANINO library

Now we are ready to start!

Code test (Transmission)

A typical CAN-Bus connection in the industrial automation domain is shown in the figure, where there is a master and several multi slaves. In the master/slave one device or process (known as the master) controls one or more other devices or processes (known as slaves). Once the master/slave relationship is established, the direction of control is always from the master to the slave(s).

For the code test it is necessary to create a CAN-BUS micro-network, for example using two Arduino CAN-BUS interfaces.

For the example code shown here we used an Arduino CAN-BUS interface connected to a commercial CAN-BUS interface.

NB. The interface is configured for a CAN communication speed of 500kbps. Change this value in the code for a different speed. The addresses are configured to 11bit.

Open the serial terminal from the Arduino editor and configure it for a speed of 115200 baud, no flow control.

Enter the following string: @00A0102030405060708 and press enter.

The string consists of three parts:

  • @ (Attention) warns the interface that a new string is coming and that it must realign for a new send
  • 00A destination address
  • 01 02 03 04 05 06 07 08 are the 8 bytes to be sent in hexadecimal format. Recall that a hexadecimal byte is between 00 and FF.

If all the operations have been carried out correctly, the other interface will receive at the address 0A the bytes as in the sequence shown.

Code test (Reception)

For the reception code test, the reverse operation is performed.

We send to the address 0B, the string 08 07 06 05 04 03 02 01

In reception we will have an ASCII string formatted in the same way as the transmission, as shown below:

Example (Canino+LabView)

A YouTube video where CAN-ISO communicates with a CAN BUS industrial device, using the “CANINO” code and the “LabView” graphical interface:

Conclusions

Now that the code is tested and we are able to transmit / receive a generic package, appropriately formatted, the next step is to use the interface with a program. In the next tutorial we will see how to use the interface with Python, LabVIEW, MATLAB, bash shell and others.

Contact us to let us know your opinionsinfo(at)rubinolab dot com

To buy CAN-ISO: LINK

Enjoy!

CAN-ISO: CAN-BUS isolato galvanicamente (ARDUINO)

07 Feb 20
admin
, ,
No Comments

Unico prodotto “isolato galvanicamente”, professionale sul mercato mondiale per Arduino e/o similari!!

CAN-ISO è uno shield CAN-BUS (isolato galvanicamente) e permette di interfacciare una scheda Arduino o similare con propri dispositivi e/o commerciali, quali centraline, condizionatori, BMS (sistemi di ricarica), ecc che utilizzano il bus CAN.

Il costo di CAN-ISO (Made in Italy) è di 35 euro (solo shield).

 

Per informazioni o altro, e-mail: rubinolab(at)gmail dot com

 

E’ uno shield “professionale” completo di tutte le protezioni hardware con pin-out standard CAN su DB-9 facile da utilizzare.

Perché sceglierla rispetto altri prodotti? Principalmente poiché è isolata galvanicamente, di qualità, dalle alte prestazioni, riconfigurabile.

Ma l’isolamento galvanico a cosa serve? Per operare in sicurezza visto che solitamente si lavora su linee CAN con diversi dispositivi collegati. Nel caso di malfunzionamento di un dispositivo CAN (non isolato) per esempio guasto all’alimentatore o dispersioni di tensione che possono verificarsi in un ambiente di lavoro per umidità o pioggia è possibile che sulla linea CAN ci sia una tensione pericolosa per l’utente. In generale in base alla norma tecnica IEC 60479-1 la soglia di tensione minima considerata pericolosa per una persona è di 50Vac (tensione alternata a 50Hz) e 120Vdc (tensione continua). Gli effetti più frequenti e più importanti che la corrente elettrica produce sul corpo umano sono fondamentalmente quattro e bastano decine di milliampere per trovarsi in una delle condizioni: Tetanizzazione (>10-15mA), Arresto della respirazione (20-30mA), Fibrillazione ventricolare (70-100mA), Ustioni (>100mA).

Dove si utilizza? Si può utilizzare in moltissimi campi, per connettere più dispositivi con soli 2 fili twistati (consiglio di utilizzare anche uno schermo). E’ un sistema Real-Time, alla velocità di 1Mbit/s è possibile connettere linee di 40metri, mentre a 10kbit/s linee fino a 6 chilometri.

Riporto alcuni campi di utilizzo:

  • Automazione Industriale, Controllo, Sensori, Sistemi di comando a distanza
  • OBD II (On Board Diagnostics) Automotive
  • Industria 4.0 internet of things
  • Automazione di edifici e controllo del clima (HVAC)
  • Sistemi di sicurezza
  • Mezzi di trasporto
  • Sistemi medicali
  • Sistemi di telecomunicazioni
  • Standards CAN Bus quali: CANopen, DeviceNet, NMEA2000, ARINC825, ISO11783, CAN Kingdom, CANaerospace

Inoltre CAN-ISO è un progetto OPEN Software per i Makers !!!

In questa pagina sono riportati:

Grazie al supporto della community, questa pagina raccoglierà anche i migliori progetti di Makers, dando alla comunità dei Makers il miglior archivio per i loro progetti sviluppati con questo hardware.

Declinazione di responsabilità: RubinoLAB non può essere considerato responsabile per l’uso improprio del progetto.

Descrizione Tecnica

CAN-ISO è uno shield isolato galvanicamente per CAN-BUS, con protezioni e filtri su can-bus per board Arduino o similari.

In combinazione con una board Arduino è un potente strumento per l’invio e la ricezione di comandi, test e analisi delle reti CAN-BUS.
CAN-ISO può essere alimentata da una board Arduino attraverso la USB oppure da una alimentazione esterna a 12V sul connettore DB-9 consentendo di avere una board “standalone”. La scheda sarà sempre isolata sia se alimentata da Arduino che dal connettore DB-9.

Caratteristiche

  • Completamente conforme con le specifiche CAN 2.0A & CAN 2.0B Bosch
  • ISO 11898-2 (CAN alta velocità) interfaccia fisica
  • CAN baud rate configurabile da software fino a 1Mbps
  • 1000Vrms isolamento galvanico tra CAN-BUS e board Arduino
  • Protezione Fault Bus tra –27 V e 40 V
  • Protezione ESD
  • Filtro CAN di modo comune (rumore di linea)
  • Terminatore di linea CAN da 120 ohm (configurabile)
  • MCP2515 @16MHz
  • Circuit Operating Voltage: 5V default; 3.3V su richiesta prima dell’acquisto
  • Alimentazione isolata tra la board Arduino e il CAN-BUS (il dispositivo previene le il rumore delle correnti parassite sul bus dati o altri circuiti che possono entrare sul piano di massa e interferire o danneggiare i circuiti sensibili)
  • Pienamente compatibile con i protocolli ad alto livello quali: CANopen, DeviceNet, NMEA2000, ARINC825, ISO11783, CAN Kingdom, CANaerospace
  • Connettore industriale standard DB-9 (possibilità di alimentare da una sorgente esterna a 12V dc)
  • Protezione inversione di polarità da sorgente esterna su DB-9
  • Indicatori LED

Connessione

Riportiamo le connessioni dello shield “CAN-ISO”. Le etichette in blu sono utilizzate da CAN-ISO.

Il clock della board per il chip MCP2515 è 16.00 MHz.

Note :

  1. Lo shield CAN-ISO ha a bordo un terminatore CAN bus che è possibile inserire/disinserire mediante pinhead
  2. Il CAN bus deve essere terminato con un solo terminatore a 120 Ohm per cavi piccoli di lunghezza (< 2m)
  3. Per cavi CAN networks (>10m) & ambienti rumorosi usa cavi con schermo, con fili twistati.

Compatibilità

CAN-ISO Shield è utilizzabile sulle board che lavorano con segnali a 5V (default), fornibile per segnali a 3.3V su richiesta prima dell’acquisto:

Nome dispositivo Compatibilità Note
Arduino UNO (ATmega328) 100% testato
Arduino Mega (ATmega1280/2560) 100% da testare
Arduino Leonardo (ATmega32U4) 100% da testare

Test

Diversi test di base sono stati condotti per garantire che lo shield lavori in modo appropriato. I tests includono la misurazione della frequenza di clock, la potenza assorbita, le caratteristiche del filtro EMI.

Inoltre sono stati condotti altri specifici test con strumenti dedicati o hardware personalizzato. Questi test includono:

ISOLAMENTO fino a 1000 V Misuratore di isolamento:

NORMA

L.Nr.1806 30303

ERRORE DI COMUNICAZIONE più di 10 ore continue di comunicazione due shields sono stati utilizzati per un test in loopback

Lo Shield CAN-ISO ha superato con successo tutti i test menzionati!

On-Board Diagnostics (OBD)

Interfacciare OBD-II con DB9

Questo è la connessione standard per interfacciarsi alla OBD-II per tutti i veicoli in circolazione dal 2008. Per quelli più vecchi o per le auto FORD la piedinatura OBD-II potrebbe variare e dipende dal costruttore auto.

Codice di esempio RubinoLAB

Il primo esempio di codice si chiama “CANINO”. Questo codice trasforma l’hardware Arduino + CAN-ISO in un bridge tra la porta seriale USB e il CAN BUS. I pacchetti sono facilmente leggibili con un programma “serial terminal”, ciò consente di debaggare facilmente le linee o creare una facile interfaccia grafica con LabVIEW, Python, Processing ecc.

Per l’esempio: Configurazione del codice e test CAN-ISO

Un video YouTube dove CAN-ISO dialoga con una centralina CAN BUS, utilizzando il codice “CANINO” e interfaccia grafica “LabView”:

Per l’utilizzo con interfaccia grafica “professionale” vai alla pagina: CANHacker

 Maker

Per condividere il tuo progetto realizzato con CAN-ISO, invia una e-mail a: info(at)rubinolab dot com e proponi la tua idea.

Se la tua idea sarà considerata interessante, sarà ospitata nel sito web RubinoLAB o collegata alla nostra pagina.

Dove acquistare

Abbiamo realizzato una prima serie per soddisfare le nostre esigenze e quelle di molti makers, fino ad esaurimento scorte. Nel caso ci sia ulteriore richiesta ci sarà una ulteriore produzione.

Il costo della scheda (Made in Italy) è di 70 euro ora in offerta a 35 euro.

Per informazioni o altro, e-mail: rubinolab(at)gmail dot com

Comparison isolated galvanically converter USB – CAN BUS

08 Jan 20
admin
,
No Comments

This article reports a comparison between CAN-ISO (of RubinoLAB) with commercial USB-CAN BUS product (galvanically isolated).
Since there are no “galvanically isolated” CAN bus shields on the market for Arduino or similar platforms, the RubinoLab Team has compared CAN-ISO with the best interfaces on the market that allow to use both proprietary and new interfaces for customization.

Comparing the data shows that the CAN-ISO interface (RubinoLAB) is the only solution with “open software”, all others have limitations on the use platforms (typically OS Windows), firmware, and use of proprietary software.
This allows use in the industrial, and low-cost automotive sector.
CAN-ISO has two power inputs (but only one power supply): USB and pin on CAN connector. Typically via USB for use as a sniffer connected to the PC, from pins on CAN connector to create a stand-alone device with remote power supply (not connected to the PC). The two power supplies guarantee galvanic isolation and power supply of the CAN-ISO shield and the Arduino board (or compatible).
CAN-ISO has many free pins on the shield and allows you to connect displays, buttons, potentiometers, sensors, etc. to create new devices with bi-insulated CAN-BUS bidirectional connectivity.
Excellent for creating a CAN test bench for control units with interfaces created ad hoc.

Contact us to let us know your opinionsinfo(at)rubinolab dot com

To buy the CAN-ISO: LINK

Enjoy!

Clone Arduino & driver chip CH340, CH340G, CH341

08 Jul 19
admin
,
No Comments

The CH340/CH341 chip is used by a number of Arduino compatible cards to provide USB connectivity.
Many operating systems do not recognize these chip natively because they lack the drivers and consequently we have an error due to lack of drivers.
The lack of this driver does not allow you to communicate with the hardware platforms and to use the Arduino development software.

No panic, driver installation is very easy!

The driver must be downloaded from the official (Chinese) website.

Once the unzip of the package has been executed, it is possible to proceed with the update of the driver for the device CH340/CH341 and equivalent (download driver only for your OS):

 

WINDOWS 32/64bit (version: 3.4 – 2016/09/27)

Drivers in the Windows OS are missing, you need to download and install them.

(WINDOWS 32/64bit) for Windows 10/8.1/8/7/VISTA/XP/2000/ME/98 & SERVER 2016/2012/2008/2003

 

LINUX 32/64bit (version: 1.5 – 2018/03/18)

The drivers are integrated into different Linux distributions. If the device is not recognized, download the Linux CH340/CH341 driver.

(LINUX 32/64bit)

 

MAC OS 32/64bit (version: 1.5 – 2018/07/05)

This driver is for MacOS Sierra/High Sierra. Do not install the drivers for the Mojave, because it seems that the latest versions are equipped with the built CH340/CH341 support.

(MAC OS 32/64bit) for MacOS Sierra/High Sierra

Installation
• Unplug any CH34* devices.
• Unload the old drivers if running:
• sudo kext unload /Library/Extensions/usbserial.kext
• sudo kext unload /System/Library/Extensions/usb.kext
• Remove the old driver by issuing one of the following commands (depending on your installation):
• sudo rm -rf /System/Library/Extensions/usb.kext
• sudo rm -rf /Library/Extensions/usbserial.kext
• Double-click on the CH34x_Install_V1.3.pkg file and install (no need to reboot)
• Instead of rebooting, you can force quit Installer after it completes.
• Load the new driver:
• sudo kextload /Library/Extensions/usbserial.kext
• Plug in your device. It should now be listed under the /dev directory. Examples:
• /dev/cu.wchusbserial1410
• /dev/cu.wchusbserial1420

 

ANDROID (version: 1.5 – 2018/03/18)

Android 3.1 – USB Host, root, apk, lib, (Java Driver), App Demo, (USB UART Demo SDK)

 

Enjoy!

CAN-ISO with CANHacker graphic interface

05 Nov 18
admin
,
No Comments

In this section we will see how to make an “Universal isolated galvanic CAN BUS monitor” using Arduino with a CAN-ISO shield (RubinoLab) and a graphic interface CANHacker.

A complete professional device for all CAN-BUS protocols, from the automotive to the industrial sector.

To buy CAN-ISO: LINK

A CAN network device that allows to write / read on CAN-bus to perform operations such as diagnostics, analyze network traffic, identify network problems, etc. For example:

In the automotive sector: it can be used to read the error codes of the cars, motorcycles, etc. that use OBD-II, or carry out operations of “CAN Bus Reverse Engineering” by monitoring the exchange of CAN data between engine side units, or send commands to reset error codes, perform bench tests of individual subsystems, etc

In the industry: with network monitoring you can help managers of a CAN network to identify whether a network is working normally or is congested. In addition, bottlenecks can be identified within a network to identify and improve performance with upgrades to the infrastructure.

Identification of problems: As mentioned above, in addition to reading / writing to CAN you can identify all the problems related to the network. By reading the information acquired by the sniffer it is possible to identify the wrong packets and / or identify the node that has not responded to the requests. This facilitates the identification of defective devices within the network efficiently and provides the ability to take quick corrective actions.

Here’s what you need

Buy the hardware:

Download the software:

Now we are ready to start!

Features

Before installation, let’s see what they are and what they do “Arduino canbus monitor” and “CANHacker tool”.

The sketch “Arduino canbus monitor”, implements CAN ASCII/SLCAN protocol compatible with Lawicel CAN232/CANUSB. It can be used for monitoring a large part of CAN protocols. Note: For CAN speeds exceeding 500kbps with a high data density on the serial port of Arduino, the serial port can become a bottleneck.

The graphic interface windows “CANHacker tool” of (Lawicel) can be interfaced to “Arduino canbus monitor”. It implements communication CAN with:

  • send & receive Can Frames
  • supports standard (11 bit) & extended (29 bit) frames
  • supports remote frames (RTR)
  • supports filter by ID (mask + code)
  • supported can baudrates from 10Kbps up to 1Mbps
  • support MCP2515 @ 16 MHZ

Now we will see step by step how to install the software “Arduino canbus monitor”  and “CANHacker tool”.

Installation

After downloading “Arduino canbus monitor”:

  1. load sketch “arduino-canbus-monitor.ino”
  2. Compile and if there are no errors continue to step 3. If there are errors about missing libraries (“mcp_can.h” and “can-232.h”) zip the files into a folder (can-232.cpp, can-232.h, mcp_can.cpp, mcp_can.h, mcp_can_dfs.h) and then from the Arduino IDE: Sketch -> Include Library -> Add .ZIP Library. Restart the Arduino IDE and go to point 1.
  3. Load to Arduino platform
  4. Disconnect and reconnect Arduino to USB

Now download “CANHackerV2.00.02.exe” and install the software to Windows platform.  After installation, restart Windows. Now it’s ready.

Usage

Now we can start using ours “sniffer” or “monitor canbus”.

  1. Connect the CAN Device (Arduino+CAN-ISO shield) to PC. Wait for Windows assign a COM serial port number. Check the serial port number assigned by windows in “device management”.
  2. Start the software CANHacker, and in “Setting” choose:
  • CAN Device: the COM port assigned to Arduino from windows
  • COM Baudrate: 115200 bits/s
  • CAN Baudrate: CAN port speed

Click on the button “OK”, then “Connect”. Have fun! Monitor your Can bus, save traces, send messages, do what your analyzer/visualizer software can.

EXAMPLE 01

In this test we will carry out Canbus communication tests between two “Arduino UNO” boards with “CAN-ISO” shields.

For the test we need:

(2) boards “ARDUINO UNO”
(2) Shields “CAN-ISO”
(1) cable Canbus

In order to use the same PC to read/write on the Canbus, we will use a “Windows terminal” and “CANHacker” as graphic interfaces.

As result, the download sketches on the first Arduino board is “CANINO”, in the second “Arduino canbus monitor”
Download CANINO
Download Arduino canbus monitor

Now launch the terminal:
CANHacker: configure the COM port, CAN speed (for board with Arduino canbus monitor);
CANINO: configure the COM port, CAN speed (for board with Canino);

In the figure, for example, we can see the sending of the string @00A0102030405060708 from “Windows terminal” of CAN to “CANHacker”.

Conclusions

With this solution we will have a complete tool, galvanically isolated for multiple uses, at low cost.

Contact us to let us know your opinionsinfo(at)rubinolab dot com

To buy CAN-ISO: LINK

Enjoy!

CAN-ISO: Galvanically isolated CAN-BUS Shield (ARDUINO)

12 Sep 18
admin
, ,
No Comments

The first “galvanically isolated” product, professional on the world market for Arduino and / or similar !!

CAN-ISO is a shield CAN-BUS that allows to interface an Arduino board or equivalent with own devices and / or commercial, such as control units, air conditioners, BMS (charging systems), etc. that use the CAN BUS.

The cost of CAN-ISO (Made in Italy) is 35 euro (only shield).

 

To buy CAN-ISO: LINK

or write me: rubinolab(at)gmail dot com

 

It is a “professional” shield complete with all hardware protections with standard CAN pin-out on the DB-9 easy to use.

Why choose it compared to other products? Mainly because it is galvanically isolated, quality, high performance, reconfigurable.

But why do you need galvanic isolation? To operate safely since you usually work on CAN lines with different connected devices. In the event of a malfunction of a CAN device (not isolated), for example a power supply failure or voltage losses that may occur in a working environment due to humidity or rain, it is possible that there is a dangerous voltage for the user on the CAN line. In general, according to the IEC 60479-1 International Electrotechnical Commission, the minimum voltage threshold considered dangerous for a person is 50Vac (AC voltage at 50Hz) and 120Vdc (DC voltage). The most frequent and most important effects that the electric current produces on the human body are basically four and just tens of milliamps are enough to find one of the conditions: Tetanization (> 10-15mA), Breathing arrest (20-30mA), Ventricular fibrillation ( 70-100mA), Burns (> 100mA).

Where is it used? It can be used in many fields, to connect multiple devices with only 2 twisted wires. It’s a Real-Time system, at the speed of 1Mbit / s it is possible to connect lines of 40 meters, while at 10kbit / s lines up to 6 kilometers.

I report some fields of use:

  • Industrial Automation, Control, Sensors, and Drive Systems
  • OBD II (On Board Diagnostics) Automotive
  • Industry 4.0 internet of things
  • Building and Climate Control (HVAC) Automation
  • Security Systems
  • Transportation
  • Medical
  • Telecom
  • CAN Bus Standards such as CANopen, DeviceNet, NMEA2000, ARINC825, ISO11783, CAN Kingdom, CANaerospace
Moreover CAN-ISO is a project OPEN SOFTWARE for Makers !!!

In this page are reported:

Thanks to the community support this page will also collect the best Makers project, giving to the Makers community the best code repository and hardware for their projects.

Disclaimer: RubinoLAB cannot be considered responsible for the improper use of the project.

Technical Description

CAN-ISO is a shield isolated galvanically, with protection and filter on can-bus for board Arduino or similar.

In combination with an Arduino board it is a powerful device for the command, test and analysis of a CAN network.
CAN-ISO can be powered by the Arduino board via USB or by an external 12V power supply on the DB-9 connector. The card is always isolated with both the Arduino power supply on the DB-9 connector.

Features

  • Fully compliant with the CAN 2.0A & CAN 2.0B Bosch specifications
  • ISO 11898-2 (High speed CAN) physical interface
  • CAN baud rate adjustable by software up to 1Mbps
  • 1000Vrms galvanic isolation barrier
  • Bus-Fault Protection of –27 V to 40 V
  • ESD protection
  • Common Mode Filters CAN
  • 120 ohm terminating resistor at CAN node (setup)
  • MCP2515 @16MHz
  • Circuit Operating Voltage: 5V (3.3V on request)
  • Isolated power supplies between board Arduino and CAN-BUS (the device prevents noise currents on a data bus or other circuits from entering the local ground and interfering with or damaging sensitive circuitry)
  • Fully compatible with higher level protocols such as CANopen, DeviceNet, NMEA2000, ARINC825, ISO11783, CAN Kingdom, CANaerospace
  • Industrial standard DB-9 connector (possibility to supply external to 12V dc)
  • Protection inversion of polarity on the DB-9 (supply external to 12V dc)
  • LED indicators

Connection

We report the most important connections of the shield “CAN-ISO”. Blue labels are used by CAN-ISO.

Notes :

  1. The CAN-ISO Shield contains onboard a internal CAN bus termination that is possible insert or no with pinhead
  2. The CAN bus must be terminated with a 120 Ohm resistor, with a single 120 Ohm resistor for short cable lengths (< 2m)
  3. For long CAN networks (>10m) & in noisy environments the use of screened, twisted pair wire is recommended.

Compatibility

CAN-ISO Shield can be used on boards that work with 5V signals (default), available for 3.3V signals on request before selling:
Device name Compatibility Note
Arduino UNO (ATmega328) 100% tested
Arduino Mega (ATmega1280/2560) 100% not tested
Arduino Leonardo (ATmega32U4) 100% not tested

Tests

Several basic tests have been conducted in order to guarantee that the shield is properly working. Tests include clock frequency measurement, power absorption, EMI filter characteristics.

Furthermore other specific tests have been conducted with dedicated instruments or custom hardware. These tests includes:

ISOLATION up to 1000 V Isolation instrument:

NORMA

L.Nr.1806 30303

COMMUNICATION ERROR more of 10 hours continuous communication two shields have been used for loopback test

The CAN-ISO Shield have successfully passed all the above mentioned tests!

On-Board Diagnostics (OBD)

 

OBD-II to DB9 interface

This is the standard connection to OBD-II for all vehicles from 2008. For old vehicles or FORD cars the OBD-II pinout may vary and depends on the car manufacturer.

RubinoLAB code example

The first example is the CANINO code. This code transform your Arduino hardware + CAN-ISO to a bridge between the USB serial port and the CAN BUS. The packets are easily readable with a serial terminal, this allow to easily debug the line or write a custom graphical interface with LabVIEW, Python, Processing etc.

For the example: Code configuration and test CAN-ISO

A YouTube video where CAN-ISO communicates with a CAN BUS control unit, using the “CANINO” code and the “LabView” graphical interface:

For use with “professional” graphical interface: CANHacker

Maker’s

To share your project made with CAN-ISO, please send an email to: info(at)rubinolab dot com and propose you idea. If considered interesting, your project can be hosted in the RubinoLAB website or linked to our page.

Where to buy

We have created a first series to meet our needs and those of many makers, while stocks last. If there is further request there will be a further production.

The cost of CAN-ISO (Made in Italy) is 35 euro (only shield).

To buy CAN-ISO: LINK

or write me: rubinolab(at)gmail dot com