At farm, we have this old temperature sensor, but the electronics device to read them is dead:
So 2 options, throw them or starting a new interesting electronics project. So lets start a new project !
After a few measurement with a multimeter and an water ice bath, the sensor type is identified: RTD PT1000 sensor.
So the goal is to transform them into wireless connected temperature sensor:
- Running into batterie, with an autonomy for at least 3 months
- A temperature mesurement period of 6 hours (so a sample every 6 hours), enought for grain storage monitoring
- Data available “on internet”, so that we can consult them everywhere (not requiered to be at farm to read them)
My project is greatly inspired from this @BrianTee_Admin video: Farming the LoRa Network - YouTube
For the wireless aspect, I also choose LORA, main reason:
- Low power, easy to use
- Range: the internet box is not close to the hangar were grain is stored, Wifi signal is too low
Some details about LORA network:
Hardware used for the sensor:
- The old PT1000 sensor
- Adafruit Feather 32u4 RFM95 LoRa Radio- 868 or 915 MHz:
Adafruit Feather 32u4 RFM95 LoRa Radio- 868 or 915 MHz [RadioFruit] : ID 3078 : $34.95 : Adafruit Industries, Unique & fun DIY electronics and kits
- Adafruit PT1000 RTD Temperature Sensor Amplifier - MAX31865:
Adafruit PT1000 RTD Temperature Sensor Amplifier - MAX31865 : ID 3648 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Also, it’s required to used a LORA Gateway, so for development, I choose this low cost 8 channels LORA Gateway (available on AliExpress):
Picture of the prototype of the sensor:
So currently I have the sensor that read temperature, send the value to LORA. The Feather go to “deep sleep” during 8s, then wake up, make a measurement and send data on LORA, go to deep sleep again for 8s.
The 8s is the limit of the 34u4 Wathdog Timer used to generate the interup to wake up the microcontroler;
The measurements are received by the LORA gateway (connected to my Wifi) and then send by internet to the open LORA network TheThingsNetwork (https://www.thethingsnetwork.org/). The LORA gateway
Then the temperature data is send from TheThingNetwork to Cayenne (Cayenne Features - Developer | myDevices.com), a service that alow to easily design a IoT data visualisation. Exemple, temperature data of my sensor from this week-end in Cayenne:
Since monday afternoon, I’ve started an “endurance” test of the sensor: the sensor is running continusly on a 4000mAh battery (with the cycle deep-sleep for 8s, send a measurement, deep-sleep for 8s, etc.). The goal is to have a first a estimation of the sensor autonomy with this cycle that I can interpolate for a 6 hours cycle.
Of course, I plan to share the code I have made for this project, hardware design ect, when all of this will be more mature.
Documents that I’ve used for this project:
For the MAX31865, I haven’t use the Adafruit library: as MAX31865 use SPI and LORA module of the feather also use the SPI so I wanted to keep a controle of SPI traffic. So I rewrite function for MAX31865 using Arduino SPI library
Next steps planned for this porjects:
Make a range test between Gateway and sensor at farm: check that with the sensor in the grain storage building and the LORA gateway in the orther bluiding with internet box, the LORA range is enought for data tranmision
Find a conviniant way to manage a deep-sleep of 6 hours (how to generate an interrupt every 6 hours ?)
Test the Heltec Cubecell board (CubeCell – Dev-Board – Heltec Automation) as an alternate to the Adafruit board. The Heltec board has many advantages compare to the Adafruit board that I currently use:
- Twice cheaper
- A real “deep-sleep” mode: in deep sleep Adafruit board consumption is ~330µA, where Cubcell datasheet announce 11µA
- The 3.3V output of Cubecell can be switched off: so during deep-sleep, we can switch off the 3,3V output of the board, so shut-off the MAX31865, for saving more power
Have a RGB LED (where le Adafruit has a standard red LED): so the led can light up with different color depending on the state of the board: INIT, temperature measuring, sending data, error state…
But main drawback of the Heltec board is that the documentation is very light compare to Adafruit.
When I choose between this to board, design a PCB and 3D printed box
I’m also not very satisfied with Cayenne: the interface is slow, and configuration is limited. So enought for tests and initial use, but eventually I would like to find another solution.
I will continue to share here the progress of the project.