My brothers electric bike's display controller by DWIN, has failed, not repairable. I wish to use Arduino nano and LCD display. It had two main inputs for data to display, 1 is CAN to display battery percentage and other 1WT = 1 wire technology/protocol to read the rpm, speed , odometer coming from the Motor controller of the bike. I managed to get the details from the CAN using MCP2515 module. I have the code to find the 1WT device id but how to read the data?
#include <OneWire.h>
const int oneWireBus = 2;
OneWire oneWire(oneWireBus);
void setup() {
Serial.begin(9600);
}
void loop() {
byte addr[8];
oneWire.reset_search();
while (oneWire.search(addr)) {
Serial.print("Device ID: ");
for (int i = 0; i < 8; i++) {
Serial.print(addr[i], HEX);
}
Serial.println();
}
delay(1000);
}
This code will print the IDs of all 1-Wire devices connected to the bus.
You would be extremely lucky if anyone on the forum knows how to read the data.
If you mentioned the make and model of the bike, there's a chance that an internet search could reveal something.
You will need to reverse-engineer the bike's electronic systems to figure out the chip part numbers that are sending the data over the 1-wire bus. From that part number you might be able to find the datasheet for the chip. The datasheet might tell you how to request and read/interpret the data.
This requires a very high level of engineering knowledge experience.
It's a Chinese brand manufactured in India under the brand name Kabira Mobility model KM3000. Opening the motor controller may not be a feasible option. I think I would be better off by using a hall sensor to detect speed.
Company doesn't even know what type of battery is used in their motorcycle, whether LFP or Lithium ion. They just reply it's a lithium battery. So I asked how many cells in series or how many S, they say its 54 ah battery.
If you want to learn all about your battery, open it and count the colored wires to the BMS to know your "S". You can find the contents of the cells (or just the identifying marks) stamped on it.
If you are into spending $200 to know S, as well test and graph every aspect of your battery state of health, purchase one West Mountain Radio's CBA-V. I've had the CBA-IV (the "old" one) for three years. It never fails. "Standard (free)" software is automatically checked and updated during startup of the application. I'm certain someone in your social group has a CBA-V, or would really, really, really like to use your new CBA-V.
I just asked them to know. I do not own the electric motorbike. I cannot open it as it has a 3 year warranty on it and the battery pack sealed/welded in a metal box.
Attach a magnet to the wheel (a spoke) and and hall sensor to the fork. Measure the linear distance of travel of the wheel in one revolution with a rider (rider causes a reduction in diameter). Count the revs, multiply by the measured distance, divide by time, result is speed.
Or, turn the battery in for warranty replacement. "They" will know what type it is.
What I think is the motor controller would output maybe around 3 to 4 information data.
Rpm. It could be used by the MCU in the display panel to calculate Speed in kmph, get distance traveled (odometer)
Speed of the motorbike. If it's a customised built controller
Temperature information of the controller and the motor.
Gear/mode indicator. Indicate the motorbike is in Reverse, Parking, Economy, City or sports mode
Using the code I could get the number of IDs transmitted by the controller. If I can know how to read the data, I might be able to figure out/interpret the data of each id
The CAN connector is only connected to the battery box. Previously when the connector was removed on the battery percentage would not show. the display console has a 2 pin connector with the wire terminal marked on the PCb as CAN_H and CAN_L. There is another 6 pin connector, Gnd, 12v, BL and BR(Blinker left and right), FL (front headlight, high beam) and 1WT.
I do agree with you. Just that I don't think that would get me the solution to read the 1wt data. As mentioned by user @PaulRB only getting the chip details from the motor controller would help.
The controller manufacturer's data is the way. The "picture" was just to make the wiring easier to see.
Is the emotorbike display a 5-wire, green, YLS connector? I've dug my way into a few displays. The 1WT might be the live "ON/OFF" to get the system up.