User Tools

Site Tools


record_temperature_from_lexibook_asm30_sensor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
record_temperature_from_lexibook_asm30_sensor [2016/04/02 11:20]
sgripon [The arduino sketch]
record_temperature_from_lexibook_asm30_sensor [2016/04/04 13:24] (current)
sgripon [The arduino sketch]
Line 5: Line 5:
 ===== Needed hardware ===== ===== Needed hardware =====
  
-  * Arduino Uno R3 board (available on [[http://​www.amazon.fr/​dp/​B008GRTSV6/​ref=pe_386181_40444391_TE_item|Amazon]]) with USB cable +  * Arduino Uno R3 board (available on [[http://​www.amazon.fr/​dp/​B008GRTSV6/​ref=pe_386181_40444391_TE_item|Amazon]]) with USB cable {{ :​arduino.jpg?​200|}} 
-  * 433Mhz RF transmitter and receiver (available on [[http://​www.ebay.com/​itm/​433Mhz-RF-transmitter-and-receiver-kit-for-Arduino-ARM-WL-MCU-Raspberry-pi-new-/​370685120131?​ssPageName=ADME:​X:​AAQ:​US:​1123|eBay]])+  * 433Mhz RF transmitter and receiver (available on [[http://​www.ebay.com/​itm/​433Mhz-RF-transmitter-and-receiver-kit-for-Arduino-ARM-WL-MCU-Raspberry-pi-new-/​370685120131?​ssPageName=ADME:​X:​AAQ:​US:​1123|eBay]]) ​{{ ::​rf433.jpg?​200|}}
   * Lexibook ASM30 temperature sensor: I had one since many years and I noticed it communicates with 433RF signals with the base   * Lexibook ASM30 temperature sensor: I had one since many years and I noticed it communicates with 433RF signals with the base
 +
 +
  
 ===== Assembly ===== ===== Assembly =====
Line 18: Line 20:
 Then I suppose you have the Arduino connected with a USB cable to a PC running the Arduino development environment. Then I suppose you have the Arduino connected with a USB cable to a PC running the Arduino development environment.
  
 +{{ :​arduino-rf433_receiver_bb.png?​300 |}}
 ===== Reverse engineering Lexibook ASM30 temperature sensor ===== ===== Reverse engineering Lexibook ASM30 temperature sensor =====
  
Line 25: Line 28:
  
 Analysing the timings show several things : Analysing the timings show several things :
-  * There is a short timing (<500each other pulse +  * There is a short timing (<500µsevery other pulse 
-  * Some pulse have medium duration (around ​1900+  * Some pulses ​have medium duration (around ​1900µs
-  * Some pulse have long duration (around ​4500+  * Some pulses ​have long duration (around ​4500µs
-  * The full frame is sent 3 times with a timing >9500 between frames+  * The full frame is sent 3 times with a timing >9500µs ​between frames
  
-My asumption was a short pulse was a separator, a medium pulse was a "​0"​ bit and a long pulse a "​1"​ bit. So I tried to decode bytes knowing the expected temperature which is displayed on the sensor itself: so easy, the 3rd byte is the temperature x10.+My asumption was a short pulse was a separator, a medium pulse was a "​0"​ bit and a long pulse a "​1"​ bit. So I tried to decode bytes knowing the expected temperature which is displayed on the sensor itself: so easy, the 3rd byte is the temperature x10 simply encoded in decimal.
  
 So now, this is what I found: So now, this is what I found:
Line 41: Line 44:
 ===== The arduino sketch ===== ===== The arduino sketch =====
  
-The following sketch reads the temperature and output ​to the serial line in JSON format. In this sketch, I use RFControl library as is, so it is not very optimized for my needs. However, for now it works and it is enough!+The following sketch reads the temperature and outputs ​to the serial line in JSON format. In this sketch, I use RFControl library as is, so it is not very optimized for my needs. However, for now it works and it is enough!
  
-<code c++>+<file c++ SmartHomeBox_sgripon.ino>
 #include <​RFControl.h>​ #include <​RFControl.h>​
  
Line 66: Line 69:
     Serial.print(",​ \"​channel\":​ ");     Serial.print(",​ \"​channel\":​ ");
     Serial.print(channel);​     Serial.print(channel);​
-    Serial.print("​ }\r\n");+    Serial.print("​ }\n");
 } }
  
Line 127: Line 130:
   printData(); ​   printData(); ​
 } }
-</code>+</file> 
 +===== Next Step ===== 
 + 
 +  * [[add_temperature_sensor_in_domoticz|Add temperature sensor in Domoticz]] using a respberry pi. 
 ===== References ===== ===== References =====
   * RFControl RF 433MHz sniffer library for Arduino: [[https://​github.com/​pimatic/​RFControl|RFControl]]   * RFControl RF 433MHz sniffer library for Arduino: [[https://​github.com/​pimatic/​RFControl|RFControl]]
record_temperature_from_lexibook_asm30_sensor.1459588805.txt.gz · Last modified: 2016/04/02 11:20 by sgripon