Skip to main content

Explanation Of CAN Bus

Modern car today like an a small computer where everything is connected each other in the same network.  It have a few network normally used in car like a Controller area network(CAN), Local Interconnect network(LIN), Media Oriented System Transport(MOST) and FlexRay. The most used is CAN Bus.

CAN BUS allow ECU communicate each other without host computer. Before, in Old car, the number of ECU is less because low demand on the technology. Today, with current technology, a modern Car have a more than 70 ECU. How it looks like if everything is connected using old way? Hard wire?

That the reason in mid-1980, Bosch design CAN Bus to reduce costs and complexity inside the vehicle.

CONTROLLER AREA NETWORK(CAN)

       CAN is a serial communication bus where allow ECU in car communicate each other robustly with maximum bit rate of 1Mb/s for high speed. It is a mist suitable for systems where a small amount information needs to be exchange. Instead of automotive, it been used in other industry as well like elevators, robotics, medical and building automation.

       It is implemented using pair of differentially signalled wire which is CAN-H and CAN-L. Bits can be either dominant(0) or recessive(1) where dominant win arbitration over recessive and win the bus to allow the winner ECU transmit the data on the bus.


 


CAN high / CAN low
CAN SIGNAL






      CAN is a based message network rather than address-based. Means that every node can send a message to all node at the same time. Every node has a filter, means that nodes always filter which message it need and ignore the rest.















    

   CAN using CSMA/CD which is carrier sense multiple access/collition detection protocol. When a node want to send message over the network, it must monitor the bus first, and if the bus is idle, it start to transmit. If two node transmit a message at the same time, a collision detection. This issue is solved by looking on the ID which are more priority. The highest priority is always win the bus.

  


Lets prove with Arduino:)




l








 









                          

Comments

Popular posts from this blog

Arduino Interfacing With LCD(16x02) Without Potentiometer

All, today i gonna to share how Arduino connected to LCD(16x02). LCD 16x02 means 16 character in 2 rows. Connection between LCD and UNO Code: #include <LiquidCrystal.h> int Contrast=75;  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);   void setup()  {     analogWrite(6,Contrast);      lcd.begin(16, 2);   }      void loop()  {      lcd.setCursor(0, 0);      lcd.print("ITS WORK");        lcd.setCursor(0, 1);      lcd.print("WELL DONE");  }

Ultrasonic Sensor With Arduino Uno

Yeah, Ultrasonic sensor now its working. Today i am gonna to share the code of how its work:) It quite easy. We just need to connect 4-pin which is VCC,GND,ECHO and TRG from Ultrasonic sensor to Arduino. Done:) Code : int trigger_pin = 4; int echo_pin = 2; int LED_pin = 13; int time; int distance; void setup ( ) {         Serial.begin (9600);         pinMode (trigger_pin, OUTPUT);         pinMode (echo_pin, INPUT);         pinMode (LED_pin, OUTPUT); } void loop ( ) {     digitalWrite (trigger_pin, HIGH);     delayMicroseconds (10);     digitalWrite (trigger_pin, LOW);     time = pulseIn (echo_pin, HIGH);     distance = (time * 0.034) / 2;   if (distance <= 10)         {  ...

Humidity_temperature (DHT11) using CAN MCP2515

Deep interesting in CAN BUS and working in this area encourage me to make a project using CAN BUS as a medium connection between two MCU. Today, i am gonna to share DHT11 temp sensor as a transmitter and give a output to serial monitor as Receiver using MCP2515. Interesting right?:) Code: Transmitter : #include <SPI.h>           //Library for using SPI Communication #include <mcp2515.h>        //Library for using CAN Communication #include <DHT.h>           //Library for using DHT sensor #define DHTPIN A0         //Define DHT 11 Pin Connected to Arduino #define DHTTYPE DHT11 //DEFINE DHTTYPE struct can_frame canMsg; MCP2515 mcp2515(10);       // Set the pin number where SPI CS is connected (10 by default) DHT dht(DHTPIN, DHTTYPE);      //initilize...