# Measurement of tire pressure with external sensors type bluetooth low energy with arduino and the BLE HM10 module

**URL:** <https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486>\
**Category:** Science and Measurement\
**Created:** [April 22, 2021, 11:19pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486 "2021-04-22T23:19:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [April 22, 2021, 11:19pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/1 "2021-04-22T23:19:15Z")

</div>

Hello, this is a program that reads the pressure and temperature of the tires through external bluetooth low energy sensors model vc601 or equivalent using the bluetooth module HM-10, with this you can improve the code to add an oled screen and integrate it into the dashboard of any car. Thanks to everyone who supported this  
Hola este es un programa que lee la presion y temperatura de las llantas por medio de los sensores externos bluetooth low energy modelo vc601 o equivalente utiizando el modulo bluetooth HM-10, con esto se puede mejorar el codigo para agregarle una pantalla oled e integrarlo al tablero de instrumentos de cualquier coche. Gracias a todos los que apoyaron en esto

```cpp
[code]
/* El presente codigo se obtuvo a partir del hilo publicado en: https://forum.arduino.cc/t/arduino-ble-tpms-capteur-pression-pneus/592030
 * Mi agradecimiento y reconocimiento a los autores originales del codigo
 * Este programa permite leer los sensores Ble TPMS externos por medio del modulo BLE HM-10 conectado al arduino
 * y mostrar la presion y temperatura de esos sensores en el monitor serial
 * Detalles importantes
 * Conexion:
 * pin arduino HM-10
 * D4<--------->TXD
 * D5<--------->RXD
 * 5v<--------->VCC
 * GND<-------->GND
 * El modulo HM-10 debe estar actualizado con la version 709 consulte:
 * http://kio4.com/arduino/161_HM10_BLE_Actualizar.htm
 * Ami me funciono sin usar resistencias
 * 21 abril de 2021
  */
#include <SoftwareSerial.h>
unsigned int baTrama[50];// trama de datos leidos de los sensores tpms
int iLenTrama = 0; //indice para los arreglos
/*Datos de los sensores El ID de cada sensor transformarlo a decimal por pares y ponerlo en forma inversa en las variables de abajo ejemplo
 * ID= 3007DD
 * HEX 30 07 DD
 * DEC 48 7 221--->221,7,48 invertido
 */
byte IDsti[3]={221,7,48};//IDsti=Identificador sensor trasero izquierdo en decimal -->"30 07 DD"
byte IDstd[3]={153,3,64};//IDstd=Identificador sensor trasero derecho en decimal -->"40 03 99"
byte IDsdi[3]={208,0,32};//IDsti=Identificador sensor delantero izquierdo en decimal-->"20 00 D0"
byte IDsdd[3]={98,1,16};//IDsti=Identificador sensor delantero derecho en decimal-->"10 01 62"

String IDstiTxt="30 07 DD"; //Identificador sensor trasero izquierdo en texto
String IDstdTxt="40 03 99"; //Identificador sensor trasero derecho en texto
String IDsdiTxt="20 00 D0"; //Identificador sensor delantero izquierdo en texto
String IDsddTxt="10 01 62"; //Identificador sensor delantero derecho en texto

/*
 * Variables para la temperatura y presion de cada rueda
 * pdd=presion de la rueda delantera derecha
 * pdi=presion de la rueda delantera izquierda
 * ptd=presion de la rueda trasera derecha
 * pti=presion de la rueda trasera izquierda
 * 
 * tdd=temperatura de la rueda delantera derecha
 * tdi=temperatura de la rueda delantera izquierda
 * ttd=temperatura de la rueda trasera derecha
 * tti=temperatura de la rueda trasera izquierda
 */
char pdd[8],pdi[8],ptd[8],pti[8];
char tdd[5],tdi[5],ttd[5],tti[5];

SoftwareSerial moduloHM_10(4, 5);//rx, tx
unsigned long uiTimerBT;
char cTemp[5];
char cPres[8];  
  
void setup() {
Serial.begin(9600);
   moduloHM_10.begin(9600);
   moduloHM_10.write("AT+IMME1");
   moduloHM_10.write("AT+ROLE1");
}

void loop() {  
presion_temp();
}

void presion_temp()
{
  while (moduloHM_10.available() > 0)//mientras haya datos
  {
    //leer los datos
    baTrama[iLenTrama] = moduloHM_10.read();
      if ((iLenTrama == 7 && baTrama[0] == 'O' && baTrama[1] == 'K' && baTrama[2] == '+') || iLenTrama > 38)
    { // borra el texto "OK+DISA:" de la trama obtenida de los sensores
      iLenTrama = 0;
      return;
    }
    if (baTrama[iLenTrama - 1] == 13 && baTrama[iLenTrama] == 10) //fin de la trama
    {
       // Analise la trame
      if (iLenTrama == 37)//el sensor transmite 2 tramas diferentes
      { //solo nos interesa la trama mas larga
         if (baTrama[0]==IDsti[0]&&baTrama[1]==IDsti[1]&&baTrama[2]==IDsti[2])//muestra presion y temp de un sensor especifico  
        { uint32_t c = ((long)baTrama[28] * 65536UL) + (baTrama[27] * 256) + baTrama[26];//Calcule la pression
        if (c > 400000UL)// a veces da lecturas incoherentes
        {
          iLenTrama = 0;
          return;
        }     
unsigned long uiTimerBTWait = millis();     
        float fP = float(c) / 100000.00;
        sprintf(pti, " %1d.%02d", (int)fP, ((int)(fP * 100) - ((int)fP) * 100));// podemos usar%
        c = baTrama[32] * 65536 + baTrama[31] * 256 + baTrama[30];//Calcule la temp.     
        sprintf(tti, "%2d", c / 100);
      }      
         if (baTrama[0]==IDstd[0]&&baTrama[1]==IDstd[1]&&baTrama[2]==IDstd[2])//muestra presion y temp de un sensor especifico  
        { uint32_t ctd = ((long)baTrama[28] * 65536UL) + (baTrama[27] * 256) + baTrama[26];//Calcule la pression
        if (ctd > 400000UL)// a veces da lecturas incoherentes
        {
          iLenTrama = 0;
          return;
        }     
unsigned long uiTimerBTWait = millis();     
        float fPtd = float(ctd) / 100000.00;
        sprintf(ptd, " %1d.%02d", (int)fPtd, ((int)(fPtd * 100) - ((int)fPtd) * 100));// podemos usar%
        ctd = baTrama[32] * 65536 + baTrama[31] * 256 + baTrama[30];//Calcula la temp.     
        sprintf(ttd, "%2d", ctd / 100);
      }
         if (baTrama[0]==IDsdi[0]&&baTrama[1]==IDsdi[1]&&baTrama[2]==IDsdi[2])//muestra presion y temp de un sensor especifico  
        { uint32_t cdi = ((long)baTrama[28] * 65536UL) + (baTrama[27] * 256) + baTrama[26];//Calcula la pression
        if (cdi > 400000UL)// a veces da lecturas incoherentes
        {
          iLenTrama = 0;
          return;
        }     
unsigned long uiTimerBTWait = millis();     
        float fPdi = float(cdi) / 100000.00;
        sprintf(pdi, " %1d.%02d", (int)fPdi, ((int)(fPdi * 100) - ((int)fPdi) * 100));// podemos usar%
        cdi = baTrama[32] * 65536 + baTrama[31] * 256 + baTrama[30];//Calcule la temp.     
        sprintf(tdi, "%2d", cdi / 100);
      }
       if (baTrama[0]==IDsdd[0]&&baTrama[1]==IDsdd[1]&&baTrama[2]==IDsdd[2]) //muestra presion y temp de un sensor especifico  
        { uint32_t c = ((long)baTrama[28] * 65536UL) + (baTrama[27] * 256) + baTrama[26];//Calcula la pression
        if (c > 400000UL)// a veces da lecturas incoherentes
        {
          iLenTrama = 0;
          return;
        }     
unsigned long uiTimerBTWait = millis();     
        float fP = float(c) / 100000.00;
        sprintf(pdd, " %1d.%02d", (int)fP, ((int)(fP * 100) - ((int)fP) * 100));//podemos usar%
        c = baTrama[32] * 65536 + baTrama[31] * 256 + baTrama[30];//Calcule la temp.     
        sprintf(tdd, "%2d", c / 100);
      }      
      }
      iLenTrama = -1;// borra la trama
      }    
    iLenTrama++;
  }  

  if (uiTimerBT + 3500 < millis()) // relanzar el comando "AT+DISA?" cada 3.5 segundos y muestra los datos en el puerto serial
  {
   Serial.print("ID: "+IDstiTxt);//Sensor 1
   Serial.println();
   Serial.print("Presion: ");//presion en bar
   Serial.println(pti);
   Serial.print("Temp: ");//temperatura en Celcius
   Serial.println(tti);
   
   Serial.print("ID: "+IDstdTxt);//Sensor 2
   Serial.println();
   Serial.print("Presion: ");
   Serial.println(ptd);//presion en bar
   Serial.print("Temp: ");
   Serial.println(ttd);
   
   Serial.print("ID: "+IDsdiTxt);// Sensor 3
   Serial.println();
   Serial.print("Presion: ");
   Serial.println(pdi);//presion en bar
   Serial.print("Temp: ");
   Serial.println(tdi);
   
   Serial.print("ID: "+IDsddTxt); //Sensor 4
   Serial.println();
   Serial.print("Presion: ");
   Serial.println(pdd);//presion en bar
   Serial.print("Temp: ");
   Serial.println(tdd);
   
    moduloHM_10.write("AT+DISA?");//comando para consultar la informacion y obtener la trama de datos de cada sensor
    uiTimerBT = millis();
  }
}
[/code]

```

---

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [May 19, 2021, 2:59am UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/2 "2021-05-19T02:59:28Z")

</div>

Voy a poner unas fotos de como queda el sencillo esquema de conexiones

---

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [May 22, 2021, 3:51am UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/3 "2021-05-22T03:51:57Z")

</div>

Mañana lo pongo

---

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [June 19, 2021, 8:15pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/4 "2021-06-19T20:15:51Z")

</div>

![ble tpms arduino_4](https://europe1.discourse-cdn.com/arduino/original/4X/6/5/0/650f2e33b477b23aef5af2bd4cec4fabf8ee06b3.jpeg)

---

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [June 19, 2021, 8:22pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/6 "2021-06-19T20:22:47Z")

</div>

![sensor BLE vc600](https://europe1.discourse-cdn.com/arduino/original/4X/2/7/d/27d080e581f8d6e0a11df68876e7cee689d1156c.jpeg)

---

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [June 19, 2021, 8:27pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/7 "2021-06-19T20:27:26Z")

</div>

![20210619_152451](https://europe1.discourse-cdn.com/arduino/original/4X/7/a/3/7a3910b94d1c73d506bc68c010a50beb4c8eb8fe.jpeg)

---

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [October 2, 2021, 1:05am UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/8 "2021-10-02T01:05:26Z")

</div>

ya esta terminado cualquier duda estoy a la orden

---

<div class="post-metadata">

**Author:** ![Valid\_Operant](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/valid_operant/32/647023_2.png) [@Valid\_Operant](https://forum.arduino.cc/u/Valid_Operant)\
**Post date:** [October 28, 2021, 2:29pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/9 "2021-10-28T14:29:20Z")

</div>

This is awesome. I found this thread as I'm also trying to send an LE signal to the arduino and I'm trying to get a small motor to activate when a particular amplitude is reached. This is the closest project I've found but my Spanish is terrible.

is ID the UUID for the vc601?

---

<div class="post-metadata">

**Author:** ![raularduinoforum](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@raularduinoforum](https://forum.arduino.cc/u/raularduinoforum)\
**Post date:** [January 26, 2022, 4:21pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/10 "2022-01-26T16:21:19Z")

</div>

Hi Luis, thanks so much for this. Can you share the pressure sensor model and the BLE module is using?

---

<div class="post-metadata">

**Author:** ![luis\_vs](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/luis_vs/32/296042_2.png) [@luis\_vs](https://forum.arduino.cc/u/luis_vs)\
**Post date:** [January 26, 2022, 4:52pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/11 "2022-01-26T16:52:22Z")

</div>

[https://articulo.mercadolibre.com.mx/MLM-660399323-modulo-bluetooth-40-hm-10-cc2541-ble-maestro-esclavo-\_JM](https://articulo.mercadolibre.com.mx/MLM-660399323-modulo-bluetooth-40-hm-10-cc2541-ble-maestro-esclavo-_JM)

El sensor es como este

US $26.20 28%de DESCUENTO | Sensor de presión de neumáticos de coche, alarma externa Universal a prueba de agua, Bluetooth 4,0, 5,0, Android, iOS, BLE, TPMS  
[https://a.aliexpress.com/\_mMSq7PQ](https://a.aliexpress.com/_mMSq7PQ)

Saludos

---

<div class="post-metadata">

**Author:** ![raularduinoforum](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@raularduinoforum](https://forum.arduino.cc/u/raularduinoforum)\
**Post date:** [January 26, 2022, 6:08pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/12 "2022-01-26T18:08:52Z")

</div>

Muchas gracias !

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 26, 2022, 6:09pm UTC](https://forum.arduino.cc/t/measurement-of-tire-pressure-with-external-sensors-type-bluetooth-low-energy-with-arduino-and-the-ble-hm10-module/852486/13 "2022-05-26T18:09:26Z")

</div>

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
