CAN bus is the two-wire network through which the battery, the machine and the charger tell each other what they need to know: how much charge is left, how much current can be drawn, what voltage to charge at, or whether there is an alarm. When a lithium battery and a machine do not "speak" the same CAN, the typical integration problems appear: the machine will not start, the charge indicator reads wrong, or the charger does not charge at the right current.

In this article we explain what CAN bus is, what information travels over it, just enough about how it works to understand it, and the most common faults when connecting a battery, whether you are replacing a machine's battery or designing a new vehicle.

CAN bus in one sentence

It is a common language and a shared cable so that all the electronic units in a machine can talk to each other without a dedicated wire for every conversation.

Bosch developed it in the 1980s for cars, where the number of control units and wires was growing out of control. Today it is found in cars, forklifts, AGVs, agricultural and construction machinery, and almost any industrial equipment with several control units.

What the battery, the machine and the charger say to each other

The BMS (battery management system) is one of the nodes on the network. It typically sends messages like these several times per second:

  • State of charge (the percentage you see on the indicator) and state of health of the battery.
  • Voltage, current and temperature of the battery.
  • Maximum discharge and charge current allowed at that moment.
  • Alarms and warnings: high or low temperature, a cell out of range, insulation fault…

The allowed current is the part you notice most day to day. If the battery is cold, the BMS lowers the charge current it accepts and the charger adapts automatically. If a cell approaches its limit while climbing a ramp, the BMS lowers the discharge current and the machine limits its power before a disconnection is needed. Without that conversation, the only protection available is to cut off, and the machine stops abruptly.

How it works, just enough

Diagram of a CAN network: the battery BMS, the machine controller and the charger connected in parallel to a CAN_H / CAN_L twisted pair, with a 120 Ω resistor at each end

Two wires and a voltage difference. The network is two twisted wires, CAN_H and CAN_L. To send a 0 (a "dominant" bit), CAN_H rises to about 3.5 V and CAN_L drops to about 1.5 V: a difference of about 2 V. To send a 1 (a "recessive" bit), both stay around 2.5 V and the difference is practically zero. Because receivers only look at the difference between the two wires, electrical interference that affects both equally (for example from a nearby traction motor) does not change the message.

Everyone hears everyone. No unit is in charge of the others. Each message carries an identifier that says what it contains (for example, "battery status") and each node decides whether it is interested. The identifier also sets the priority: if two units start transmitting at the same time, the one with the lower identifier wins, without the message being lost or anything being repeated. The other waits and tries again straight after.

Short, checked messages. In classic CAN each message carries at most 8 bytes of data, plus a check code (CRC) that lets receivers detect transmission errors, and an acknowledgement that someone has received it. A node that keeps accumulating errors disconnects itself from the network so it does not block everyone else's communication.

Resistors at the ends. Each end of the network has a 120 Ω resistor. Without them, the signal bounces back when it reaches the end of the cable, like an echo, and mixes with the following bits.

The standards and the "languages" of CAN

The reference standard is ISO 11898: part 1 defines how messages are built and arbitrated, and part 2 the physical layer of high-speed CAN, up to 1 Mbit/s, which is the one used in vehicles and machinery.

What that standard does not say is what each message means. Two units having CAN is like two people having a phone: they can call each other, but that does not guarantee they speak the same language. Protocols on top of CAN define that:

  • CANopen, widespread in industrial machinery and forklifts. The CiA association publishes specific profiles for battery modules (CiA 418) and chargers (CiA 419).
  • SAE J1939, the standard for heavy vehicles and agricultural and construction machinery.
  • Proprietary protocols from each machine manufacturer, usually described in a message list or a DBC file.

Almost all the work of integrating a battery lies here: making the battery send the data the machine expects, with the identifier, format and rate it expects.

The most common faults when integrating a battery

1. Different bit rates. All nodes on the network must work at the same speed: 125, 250, 500 kbit/s or 1 Mbit/s are the most common. A battery set to 250 kbit/s on a machine running at 500 kbit/s floods the network with errors and nobody understands anybody.

2. Wrong termination. You can check it in a minute with a multimeter: with everything switched off, the resistance between CAN_H and CAN_L should be around 60 Ω (two 120 Ω resistors in parallel). If you read 120 Ω, one is missing. If you read about 40 Ω, there is one too many, which often happens when the new battery comes with its own resistor enabled and the machine already had both.

3. Duplicate identifiers. If the new battery uses an identifier already used by another unit in the machine, the messages clash and the information arrives mixed up.

4. Wiring. Untwisted cable, long branches from the main line to each node, a shield poorly connected to ground, or the communication cable run alongside the motor power cable.

5. A different protocol. The physical layer works and messages are flowing, but the machine does not understand what the battery says because it expects another protocol or format. This is the most frequent case when replacing an original battery with one from another manufacturer.

Network length also limits speed: as a guide, about 40 m at 1 Mbit/s, about 100 m at 500 kbit/s and about 250 m at 250 kbit/s. In a forklift or an AGV distances are short and this is rarely a problem, but long branches are.

What to ask about CAN before buying a battery

  • Which protocol does it use? CANopen, J1939 or a proprietary one? Does it match my machine and my charger?
  • What bit rate does it run at? Can it be configured?
  • Can you adapt the messages to my equipment's protocol? A manufacturer that develops its own BMS can; one that buys it from a third party depends on someone else.
  • Is there documentation of the messages? The message list or DBC file is the first thing your engineering team will ask for.
  • Does the battery include a termination resistor? Can it be disabled?
  • What does the battery do if communication is lost? It should go to a safe mode and warn, not carry on blind.

CAN bus at NCPower

We develop our own BMS, and it communicates over CAN bus with the machine and the charger. In vehicles and machinery the conversation is with the equipment's control unit; in AGVs and mobile robots, integration is done over CAN bus with the vehicle's PLC. Because the BMS is our own, we can adapt the messages to the protocol each machine uses, instead of forcing the machine to adapt to the battery.

If you are designing a vehicle, our article on the keys to BMS integration in electric vehicles covers the other points to review, and the guide what a BMS is and why it decides the life of your lithium battery covers everything the BMS does besides communicating. More about our BMS with CAN bus communication on our technology page.

Where do we start?

Replacing a lead-acid battery? Send us a photo of your current battery's nameplate and the machine and charger models. We will tell you which lithium battery matches it and how it will communicate with your equipment.

Designing a vehicle or an AGV? Send us your controller's protocol and message list, and our engineers will explain how to integrate the battery and its BMS. You can also ask us for a preliminary consultation.

Write to us from the NCPower contact page and we will get back to you.