The open source CAN-Bus network for leisure vehicles

User Tools

Site Tools


Functional Overview


LeisureCAN is a CAN-Bus system designed for the leisure vehicle industry - campervans, boats, caravans, …

It allows manufacturers and owners to control all electrical and electronic components of the leisure side of the vehicle through a single CAN Bus. Any component can be switched from anywhere on the bus system, and any measurement taken can be displayed or used anywhere on the bus.

What is a CAN Bus?

CAN (Controller Area Network) technology was designed for the automotive industry in the 1990s. Nowadays, pretty much every new car has a CAN bus system that controls the engine, temperature, lights, indicators, etc. through a single bus system. They are very reliable (if electronics fail, it's usually not the bus itself, but individual components), and have been manufactured in the millions. That means the individual components are cheap, ubiquitous and reliable.

LeisureCAN functionality

LeisureCAN is based on a peer-to-peer network. Every component connected to the bus is able to receive messages from any other component, and can send messages to all other components. The failure of a single component has no effect on the others, and there is no single point of failure.

The peer-to-peer model means that each component decides on its own what it wants to do with the information it receives. Each component can subscribe to events. As an example, a set of lights in the dining area can subscribe to a switch. When the switch is operated, a signal is transmitted onto the bus telling all components that the switch is now on. The component that the dining area lights are connected to reads the signal, figures out that it is subscribed to the signal, and turns the dining area lights on.

The same set of lights can have multiple subscriptions, e.g. a panic switch next to the bed can turn the same lights on in blinking mode when operated.

Components can also react to measurements, e.g. if the inside temperature gets too low, the heating can turn on automatically. At the same time, a switch could turn on the heating overriding the temperature reading, etc.

To sum it up, it's up to each individual component to decide what it wants to do with the messages received from the bus.

All this is freely configurable through a browser interface that can be accessed through WiFi; either as an ad-hoc access point, or bound into an existing WiFi network.

Security is provided through the WiFi networks own security, e.g. WEP password protection.


The main component is the bus itself, which consists of a 4 wire twisted pair shielded cable that runs along the length of the vehicle. The maximum bus length is 40 m, so the bus can easily be run along both sides, criss-cross, or in whatever layout is best. The bus cable is run through junction boxes into which the components are plugged. The cable, boxes and plugs are all IP68 compliant, e.g. the whole system is waterproof.

LeisureCAN units are plugged into the bus wherever needed in the vehicle. These units have a combination of switch inputs, analogue inputs (e.g. measuring inputs), relay outputs, and measuring gauge outputs. They can be bought or self made according to the needs of the customer. Most units will have a combination of switch inputs and relay outputs. As an example, a unit that is placed close to the dining area will have relay outputs to turn lights on and off, operate a fan, and receive switch inputs from a bank of switches.

Each unit attached to the network can have up to 32 ports. A port can be a relay output, so have two connectors, or it can be a measuring gauge output providing a voltage from 0 to 5V, or it can be a switch input, that will change from 0 to 1 if connected to ground, and from 1 to 0 if the connection to ground is removed. Whoever makes the unit determines at making time which port does what, and configure the software accordingly. When a master controller queries the unit, it will send out a set of messages that describes how many ports it has, and what function they have.

When the units are installed, the subscriptions can be set up, e.g. the user can configure freely how the components react to each other.

Please read the detailed LeisureCAN specification document for more information.


A subscription is when a device reacts to the change from another device.

Any port on any device can subscribe to multiple other ports on other devices, so it can react to changes throughout the system.

So far, there are 6 subscription types, and they are as follows:

Subscription TypeShort NameFunctionality
0Normal SwitchIf the subscribed unit receives a change from 0 to 1, it will switch on; if it receives a change from 1 to 0, it will switch off
1Reverse SwitchIf the subscribed unit receives a change from 0 to 1, it will switch off; if it receives a change from 1 to 0, it will switch on
2BlinkIf the subscribed unit receives a change from 0 to 1, it will start “blinking” the output relay at a set frequency (up to the implementor). The blinking will stop when a change from 1 to 0 is received.
3push buttonA push button subscription will switch on as soon as it receives a change from 0 to 1, but it will ignore the following change from 1 to 0. The next change from 0 to 1 will switch the subscriber off again. It's easy to have multiple subscriptions for multiple push buttons, as any push of a button will make the relay output change.
4Measuring DataA measuring data output port will listen to a measuring data feed, that will supply an absolute measurement together with an integer indicating the unit (e.g. “1” for degrees C). When configuring a measuring output port, the unit will get a minimal and maximal value set. It will now calculate the percentage of the measurement received in respect to the known minimal and maximal value, and calculate a percentage that the received measurement represents. It will then set the output voltage between 0 and 5 Volt on the port according to the received percentage. This can be used to drive stepper motor gauge outputs.\\As an example, we have a temperature gauge that gives us readings from -20C to 140C. The gauge that we have subscribed to the measuring output goes from 40C to 120C. We have set up the measuring port output with a minimum value of 40, and a maximum value of 120. Any measurement received below 40C will result in an output of 0 Volt. Any measurement received above 120C will result in an output voltage of 5V. Measurements received from 40C to 120C will result in an output voltage from 0V to 5V (linear).
5Any change switchesThis is useful when for example a set of lights can be switched from multiple locations, e.g. different access routes leading to the same space. Each entry to the space has an on/off switch, and the relay driving the lights has a subscription to all of the switches. Any change on any of the switches will lead to a switch of the lights, no matter if the switch that changed switched from on to off or from off to on - pretty much like your traditional house electrics set-up for hallways.


The huge advantage of a LeisureCAN system is that it's freely configurable, and the configuration can be changed at any time. If the user wants to add a new component (e.g. a new switch), he/she can just do that, and then configure which device reacts to the switch. In the same manner, a new device can be connected to the relay output of a LeisureCAN unit, and then be configured to be switched on by a set of events on the bus, e.g. a switch that's operated, …

Once the bus cable and a pair of power cables are fitted throughout the vehicle, new components can be added with a minimal amount of wiring required. Just hook up the new component to the power cable (don't forget the fuse!), and connect it to a relay output of the nearest LeisureCAN unit, and you are ready to go.

When you first think about a CAN bus, you might worry that this is a more complex system than a traditionally wired electrical installation.

If you have ever seen your average boat or campervan installation and tried to find a problem, you will have noticed that there are lots and lots of cables, relays and other components, and that it takes a long time even for an electrician to figure out what does what.

If you have a clean LeisureCAN installation, it's very easy to figure out what is connected where, and with the web interface in front of you, it's astonishingly easy to find problems and to resolve them.

If you have a bit of computer knowledge, you can fix the system yourself with a bag of parts worth £50, a soldering iron and a multimeter.

The little OLED display on the master control unit also shows all events on the bus, so a faulty switch can be diagnosed within seconds. You flick the switch, and there is no message on the bus → you have a faulty switch. Diagnosed without opening anything, without measuring anything, without following cables through small spaces, …


You could argue that a traditional copper cable wiring to each component is more reliable, but you have to take into account that you have a lot more connectors, cables, etc. running through your vehicle. All those provide additional points of failure.

I have been working in the car industry for over 2 decades, and when I started out in 1982, there were very little electronics in cars, especially the ones we mostly worked on. Electrical faults were rife, mostly contact problems, and they provided a constant source of annoyance for drivers.

Since the introduction of CAN bus systems in cars, the problems have shifted to individual components, which are now far more abundant. There are hundreds of sensors in a modern car, and huge amounts of actuators, valves, etc. that control the engine, brakes, steering, heating, air conditioning, etc. If we still had traditional cabling without a bus for those, we would see a lot more failures than we see with a neat central bus system that minimises cabling and connectors.

In my book, a complex electrical system with a CAN Bus is more reliable than a complex electrical system with traditional wiring. The most reliable system is of course a minimal system with minimal wiring and minimal functionality, but that might not be to everyone's taste … If your life depends on the electrical installation, go for this option. If you want an reliable, easy to set up and maintain electrical installation, go for LeisureCAN.

functional_specification.txt · Last modified: 2021/01/17 17:29 by christian