GNU General Public License v2.0

项目介绍

schoolpost/IBS-Sensor-Lite 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 GNU General Public License v2.0 许可证,目前获得 9 个 Star、9 次 Fork。

仓库全名
schoolpost/IBS-Sensor-Lite
开源许可证
GNU General Public License v2.0
Star 数
9
Fork 数
9

README 摘要

IBS-Sensor-Lite Interface to IBS 200 X Automotive Battery Sensor via LIN-Bus. This repository is derivative work based on this existing library: https://github.com/mestrode/IBS-Sensor-Library Background For my project I was looking for a way to add battery monitoring to my vehicle, due to the long cold winters in Canada; it is nice to monitor the characteristics of the battery. Lots of modern vehicles today include…

完整内容见 GitHub 原始 README 或本页 。

常见问题

IBS-Sensor-Lite 用什么语言开发?

主要使用 C++ 编写,采用 GNU General Public License v2.0 许可证,目前有 9 个 Star。

IBS-Sensor-Lite 可以免费商用吗?

仓库标注的许可证为 GNU General Public License v2.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 IBS-Sensor-Lite 的源码?

可以直接克隆仓库:git clone https://github.com/schoolpost/IBS-Sensor-Lite.git,默认分支为 main;安装与运行步骤见仓库 README。

IBS-Sensor-Lite 最近还在维护吗?

仓库最近一次更新为 2022年2月19日,当前没有未关闭的 Issue;Star 数为 9,可作为社区活跃度的参考。

关于

IBS 200 X Automotive Battery Sensor via LIN-Bus

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
28
价值分
8
活跃状态
活跃

README

IBS-Sensor-Lite

Interface to IBS 200 X Automotive Battery Sensor via LIN-Bus.

This repository is derivative work based on this existing library: https://github.com/mestrode/IBS-Sensor-Library


Background

For my project I was looking for a way to add battery monitoring to my vehicle, due to the long cold winters in Canada; it is nice to monitor the characteristics of the battery.

Lots of modern vehicles today include battery monitoring, usually in the form of either a Shunt based battery monitor ( Like the IBS-200X ) or Hall Effect Sensor ( Like this HAB 80-S )

As is with alot of my projects, I like to re-use existing things and find new purposes for them. So instead of buying a brand new sensor, I decided to take a look at what was available at my local wrecking yard.

Hella is an OEM provider to many existing car manufacturers as I discovered. I found IBS-200X for Hyundai/Kia and some Ford models as well.


Reverse Engineering

With some Automotive IBS-200X on hand I was now tasked with connecting to them and seeing what kind of data I could read from the sensor. I referred to the few established github projects that were already interfacing with IBS-200X only to notice that they were not working with any of the sensors I was able to salvage.

After many head scratching hours, I came to conclusion that these Automotive IBS-200X likely use a very different firmware from the one that comes with official Hella branded IBS-200X.

Automotive IBS-200X would only respond to request on address 0x50 ( also 0x92, with static data.) This is very strange behavior because LIN format specifies an ID range from: 0x00-0x3F

Response frame for address 0x50

IBS-200X connected to bench power supply with 12V + 3.0A load

55      50      DD:73:62:97:1E:F8:EA:FF     62
sync    addr    |  |  |  |   |              chksm
                IL IU |  |   |              Ibat = (IU << 8)) | IL // current in milliamps
                      VL VU  |              Vbat = (VU << 8)) | VL // uncalibrated voltage value
                             MULT           this byte changes when the current load goes above ~16amps.

In this repository I provide some raw linbus output with the sensor at various power characteristics ( different voltage, current, temperature. ) Feel free to read and suggest improvements to sensor reading formulas.

Teardown


I cracked open on of the sensors to see how it’s heart beats, and it appears to be based on this ADuC7034


Dependencies

The Lin Interface utilizes a Hardware Serial (UART) of an ESP32. This requires a separate Library: https://github.com/mestrode/Lin-Interface-Library


Example

Below is a very basic exmaple of how to use this library.

#include <Arduino.h>
#include <Lin_Interface.hpp>
#include <ibs_lite.hpp>

#DEFINE SERIAL_OUTPUT_INTERVAL_MS 1000

// using UART 2 for LinBus
Lin_Interface LinBus(2);
IBS_Lite BattSensor;

void setup()
{
    Serial.begin(115200);
    LinBus.baud = LIN_BAUDRATE_IBS_SENSOR; // 19200
    //  LinBus.verboseMode = 1;
    //  BattSensor.debug = 1;
    BattSensor.Linbus = &LinBus;
    // BattSensor.setCapacity(60000)
}

unsigned long timer = 0;

void loop()
{
    BattSensor.loop();
    if (timer - millis() > SERIAL_OUTPUT_INTERVAL_MS) {
        Serial.print("Battery Current: ");
        Serial.println(BattSensor.current(), 3);
        Serial.print("Battery Voltage: ");
        Serial.println(BattSensor.voltage());
        Serial.print("Battery Capacity: ");
        Serial.println(BattSensor.capacity());
        timer millis()
    }
}

Hardware

This library was designed for use with the ESP32, however with some minor modifications can likely be tweaked to support most arduino compatible microcontrollers.

You will also require a LIN Transceiver to convert the logic level serial output into appropriate 12V signaling required for LIN Bus. I used this transceiver board from Mikroe based on the MCP2003B: https://www.mikroe.com/mcp2003b-click

If you do not have access to a transceiver there is a way to do this using some basic transistors, I will provide a schematic of this in the future.


References

If you use official Hella IBS-200X, please refer to the original creators repository: https://github.com/mestrode/IBS-Sensor-Library

评论

暂无评论