eChook GPT Documentation
  • Welcome to the eChook nano documentation
  • System Overview
  • The eChook Nano Kit
    • Versions
  • Build Instructions (Kit V1.x)
    • Build Steps Photos
    • First Power On
  • Build Instructions (Kit V2+)
  • Programming the Arduino
    • Install Arduino IDE
    • Arduino Drivers
    • Download the eChook Arduino Code
    • Programming the Arduino
  • Setting up the Bluetooth
    • Pairing with a phone
  • Connecting the eChook to the Car
    • Power and Voltage
    • Current Sensor
    • Throttle Input
    • External Buttons and Brake
    • Temperature Sensors
    • Wheel and Motor RPM
    • PWM Output
  • Calibrating the eChook
    • Wheel Speed and Motor RPM
    • Temperature
    • Voltage
    • Current
  • Using the App
    • Pair eChook to Phone
    • Setting up the App
    • Logging Data
    • Lap Counting
  • Telemetry (Live Data)
    • eChook Live Data
    • Node-Red Integration
    • DIY Web Dashboard
  • Using the Data
  • Circuit Schematics
    • 12 and 24v Inputs
    • Temperature Inputs
    • Bluetooth Module
    • Throttle Input
    • Current Input
    • Button Inputs
    • RPM Inputs
    • PWM Output
    • Power Regulator
    • Expansion Port
  • All about the Arduino nano
    • The eChook nano Code
  • Bluetooth Communication
    • Bluetooth Packet Encoding
    • Bluetooth Packet Decoding
  • Experimental Section
    • GUI Calibration
  • eChook Accessories
  • DIY eChook
  • Spare Parts
  • Troubleshooting
  • Contributing
Powered by GitBook
On this page
  • Bluetooth Hardware
  • Communication Schema
  • Encoding the data

Was this helpful?

Bluetooth Communication

Bluetooth Hardware

The HC-05 bluetooth module takes a serial (USART) input and transmits any incoming data to a paired phone. This is compatible with any microcontroller with a hardware (or emulated) serial port. On Arduinos, this is accessed by using 'Serial' in your code.

The HC-05 modules are cheap to buy - generally under £5.

Communication Schema

Sending data over bluetooth takes time and power. To minimise these on the eChook a very compact packeting system was used. Each sensor update is sent in a packet of data 5 bytes long. Each byte looks like this:

[{][id][data_1][data_2][}]

The [ ] indicate each byte.

{} - These braces indicate the start and finish of a packet - this allows for basic error detection as the receiver knows to expect a '}' 4 bytes after the '{'. When that is detected, anything within is likely to be data.

id - This is the data identifier. It is a single character that can be looked up in a table to identify what sensor the data in the packet is from.

data 1 and 2 - These two bytes contain the value from the sensor.

Encoding the data

Encoding the data into 2 bytes required limiting the data that is sent. To achieve this any value below 127 is sent to an accuracy of 2 decimal points, and any value above 127 is sent as an integer.

If the value being sent is below 127 the data1 byte contains the integer portion of the value and the data2 value contains two decimal points. If the value is over 127 the data1 byte contains the hundreds and thousands portion and the data2 value contains the tens and units.

PreviousThe eChook nano CodeNextBluetooth Packet Encoding

Last updated 6 years ago

Was this helpful?