How to use temperature sensors to design plant monitoring systems
Source: InternetPublisher:containsmachine Keywords: Temperature sensor monitoring system Updated: 2024/05/24
This solution is a real-time plant monitoring system that can check temperature, light and humidity.
Made with a MKR1000, the standard Firmata Wifi sketch, and Johnny-Five and Node.js.
I first load the MKR1000 with the StandardFirmataWifi sketch. This will allow us to communicate with the board using Johnny-Five.
Open Arduino IDE
File -> Examples -> Firmata -> StandardFirmataWifi
Switch to the second tab "wifiConfig.h"
Read the comments and set the options to match your device. For the MKR1000, I had to comment out step 1 option A and uncomment option B. Then scroll down and configure the SSID and password for your wifi. You can set the IP address of the board to static if desired. Below are the lines in wifiConfig.h that I had to change for my home wifi setup.
Switch back to the first tab "StandardFirmataWifi"
Compile and upload the sketch to the MKR1000
Next, I created a web application using node and express. This will allow us to run Johnny-Five, an open source framework based on the Firmata protocol that allows easy communication between the MKR1000 and my node application.
I then created a basic dashboard where the user can see the current sensor data being streamed from the MKR1000 to the client in real time. I am using WebSockets to send the sensor data to the client every second.
The user can also click on any sensor reading to see the full history for that specific sensor. This view presents 2 charts, the top chart is a zoomed-in version of the total readings, and the bottom chart is the full history of data for that sensor. The user can select a range on the bottom chart, which updates the top "detailed" chart for the selected range. These charts display the data saved to RethinkDB every 10 seconds.
You need to install RethinkDB and run it locally.
They have some great documentation, so check it out
https://rethinkdb.com/docs/install/
After installing RethinkDB, we will need to create a database and table to store the measurements mentioned earlier.
Open a terminal and type rethinkdb to start our rethinkdb server.
Then open any modern browser and go to localhost:8080
This will load the RethinkDB dashboard where you can access your database and create tables. For this system, we need to create a database called plant_monitoring_system and a table called measurements
Click on the table to load the table view
Click the + Add Database button
Type plant_monitoring_system and click Add
Then, click Data Explorer to open the Data Explorer, where we will run commands to create the tables needed for this project. Type the following code in the Data Explorer and click Run.
r.db(‘plant_monitoring_system’).tableCreate(‘measurements’)
That should do it for the database creation. We just need to make sure the database is running before starting our node application. We started our database earlier using the command
rethinkdb
Here are some photos after setting it up.
Below is a schematic of the circuit I built for this system. The board is actually an Arduino MKR1000. The 5v pin is actually 3.3v, but all components will work fine at 5v.
It's hard to see in the photo, but you just need to connect the following sensors to the corresponding ports.
LM35 sensor connections:
3.3V
Analog Pin 1
ground
Photoresistor connection:
3.3V
Analog pin 2 and 10k ohm resistor to ground
Humidity sensor connection:
Analog Pin 1
3.3V
ground
- Digital number selection machine
- NE5532 standard linear preamplifier IC circuit features and application schematics
- Presettable 8-bit counter circuit
- An easy-to-make counting frequency meter
- Method for obtaining second reference signal using CMOS pointer-type quartz electronic clock integrated circuit
- A night light made of LED
- ISO103 circuit to reduce power consumption
- Broadband transconductance operational amplifier and buffer OPA660 common emitter (common-E) amplifier circuit
- Class A2 single-ended parallel amplifier circuit
- Analog Karaoke Accompaniment Amplifier Circuit
- Remote temperature sensing circuit diagram
- Motor thermal protection circuit controlled by 3UN2 (has a temperature sensor)
- T-X type temperature sensor thermometer
- AD590 integrated temperature sensor typical application circuit
- Remote control temperature sensor circuit
- Temperature sensor compensation circuit
- TMP12 air temperature sensor integrated circuit
- Temperature measurement circuit of KTY81-110 silicon temperature sensor
- AD22100 type voltage temperature sensor circuit with signal conditioning
- Interface circuit of platinum resistance temperature sensor