GithubHelp home page GithubHelp logo

covrig / ev-v2x-data-reading-canbus Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 0.0 247 KB

The battery of an electrical vehicle (EV) can be used to support the power grid (V2G, Vehicle to Grid) or can act as a buffer for a home promoting self-consumption (V2H, Vehicle to Home). This technical report evaluates, in laboratory conditions and for different charging/discharging power levels, the round-trip efficiency of an EV and V2G/V2H charger setup.

C++ 100.00%

ev-v2x-data-reading-canbus's Introduction

EV-V2X-Data-Reading-CANbus

The battery of an electrical vehicle (EV) can be used to support the power grid (V2G, Vehicle to Grid) or can act as a buffer for a home promoting self-consumption (V2H, Vehicle to Home).

A ESP8266 microcontroller (others can also be used) is managing and coordinating the appropriate CAN bus dataframes. The microcontroller is connected to a MCP2515 CAN bus interface which allows it to use the CAN standard. An optional LCD screen is also connected to the microcontroller to display debugging information throughout the different tests, such as the time the test has been running for and the number of CAN requests sent. The whole system is powered using the 12V pin available at the OBD II por. Since the ESP8266 and the MCP2515 require 5V to operate, a voltage regulator is used to reduce the voltage. Finally a power switch is also included.

The ESP8266 microcontroller is programmed using the Arduino IDE. In order to control the MCP2515 CAN interface, the [25] MCP_CAN Arduino Library https://github.com/coryjfowler/MCP_CAN_lib library is used. The system is configured to regularly send requests for the battery variables required for the efficiency tests in the following order:

  • First the cell pair voltage values are requested. There are 96 cell pairs and thus 96 voltage values. The values are sent in mV using 2 bytes for each value. The initial response, received after sending the request for information about group 2 contains 4 bytes of data, which correspond to the first 2 voltage values. After this dataframe is received, a request for additional data is sent and the response is recorded. This is repeated until the the 28 dataframes containing the cell pair voltages are received. Since the additional data frames contain 7 bytes of data, and 2 bytes are required to send a voltage value, a value of every 4 has to be split over two dataframes. If the 96 values are successfully retrieved, they are sent to a database via WiFi, where they are stored.
  • Next the battery temperatures are obtained. A request for group-4 data is sent and after receiving the initial response, 4 additional data frames are sent and the answers are stored. 3 values for the battery temperature are obtained corresponding to 3 different sensors. These values are expressed in Celsius, each value using 1 byte. If all temperature values are received, they are transmitted to the database.
  • Finally the battery voltage and current are requested. Again this is done by sending a request frame, in this case for group 1 data and 5 additional data requests. The battery voltage is sent in cV using 2 bytes and the current is sent in mV using 4 bytes. It should be noticed that the battery current is the only variable that can have either positive (charge) or negative (discharge) values. If both values are obtained they are sent to the database. The database used to store the values is a local InfluxDB [19] database. To access it the microcontroller is connected to a WiFi network using an ESP8266 WiFi library and the Influx packages are sent using a web representational state transfer (RESTful API) library. Overall this system is able to send a value of each of the variables every 10 seconds, which is considered satisfactory to perform the tests.

Diagram Diagram

ev-v2x-data-reading-canbus's People

Contributors

covrig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.