Open source robust passive two-wire bus
- Abstract
- See also
- Open source
- What is the benefit of cable reduction on an e-bike?
- Just one resistor is required per switch and sensor
- How it works
- Cable killer first version from 2015
- Cable PCB killer first version from 2015
- A simple alternative to the two-wire LIN bus
- 2-wire bus circuit description
- Fora
- Control of additional components
- Robustness against leakage currents and current variations
- 2-wire controlled bus software
- 2-wire control bus development
- Software oscilloscope used for measuring intern Arduino variables
Abstract
To reduce the cabling on an ebike, I have developed a simple, but very robust, 2-wire control bus. The signal and the power supply go together with in total two wires: GND and 5V.
This article describes the application of the 2-wire bus on an ebike, for which the bus was originally designed, named: cable killer.
The principle of an analog, resistance driven, 2-wire bus is not new, it is a well known solution to save on cabling. For example, in a VCR, this principle was used to reduce the wiring to a button panel by connecting the many buttons through different resistors to a single control wire. From the resistance of the control wire it can then be deduced which switch has been pressed.
See also
- Maxun e-kit cable killer
- Bluetooth Watt meter cockpit
- Bluetooth Watt meter dongle
- Yamaha hacking dongle
- Sale on Tindie
Open source
I give everyone permission to use my two-wire current-controlled bus circuit and the software, if you mention my name. Contact me for the software.
What is the benefit of cable reduction on an e-bike?
With this bus we can wire among other the throttle switch, brake sensor, pedal assist sensor and the speed sensor. Because the number of cables has been reduced, very robust 3-pin RC-model connectors can be used. Also, the many vulnerable thin control cables can be replaced by only two thick, AlphaWire EcoWire cable.
Each sensor or switch only needs one resistor to work. In addition, the sensor can also be powered by 5V.
Here is a view of the rat's nest of cables coming out of a motor controller and the reduced cabling with the two-wire current controlled bus:
Just one resistor is required per switch and sensor
For example, see the the throttle switch with just one resistor per switch:
How it works
I have called the current controlled bus the “Cucobus”. It is a bus with the least number of wires possible, only two: GND and 5V. Maximal 7 switches can be connected to the Cucobus. When a switch is pressed, the 5V is loaded with a resistor, see the circuit. The cable killer measures the current from the 5V and deduce from this which switch has been pressed. Two current controlled busses are used, one for the electronics at the bicycle frame and one for the handle bar. Just a single 3 pole connector is needed for the total control of an ebike:
Cable killer first version from 2015
Here is the first version of the cable killer from 2015, it uses an ATSAMD21G micro controller:
Cable PCB killer first version from 2015
A simple alternative to the two-wire LIN bus
There is a standardized 2-wire control bus: LIN (Local Interconnect Network). This is a serial network protocol used for communication between components in vehicles. But with LIN, each sensor requires its own microcontroller board, which reduces reliability and also takes up too much space. My 2-wire current controlled bus is a simple alternative to this. Each sensor only needs 1 resistor.
- http://ww1.microchip.com/downloads/en/DeviceDoc/article_ac9_two-wire-lin-networking.pdf
- https://en.wikipedia.org/wiki/Local_Interconnect_Network
2-wire bus circuit description
Here is the circuit of the 2-wire bus controller part, it used in the Maxun One solar bike.
Fora
Control of additional components
The cable killer has two also two extra connectors, JM4 and JM5, for the control of components such as lights, torque sensor, temperature sensor, shift servo etc:
Robustness against leakage currents and current variations
For safety reasons, no errors are allowed. As a result, the development of the cucobus took a lot of time and is quite complicated. The bus has been made interference-resistant by software, so that it is also suitable for automotive applications. The electronic has proven to be very stable, even when currents drifts occur. It is used since 2015 without any problems.
2-wire controlled bus software
- Hall sensors can be also powered by the Cucobus 5V, its supply current is compensated by software.
- The bus is continuously calibrated.
- When threshold values are exceeded, an error is generated and the system will be shut down.
- The error message is showed by a LED on the front.
2-wire control bus development
Here are photos that give an insight into how the Cucobus works: