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
- Touch circuit design and analysis
- Experiment and production of NE555 time base integrated circuit
- Common electrical circuits: frequency-selective (bandpass) amplifier circuit
- Using Monostable Trigger to Construct Pulse Delay Circuit
- Phase-locked Frequency Multiplier(9316)
- 150-300MHz frequency multiplier composed of MC1596
- Method for obtaining second reference signal using CMOS pointer-type quartz electronic clock integrated circuit
- Power-saving LED dimming circuit
- 0dB current amplifier circuit designed with K1058/J162
- Low noise preamplifier circuit composed of OPA37
- 3 and 1/2 digit digital thermometer using diode as temperature sensor
- Quartz temperature sensor circuit diagram
- Temperature sensor used in crystal compensation circuit
- Temperature sensor amplifier circuit
- Temperature sensor resistance compensation circuit
- TMP12 air temperature sensor integrated circuit
- AD22100 type temperature sensor circuit with signal conditioning voltage output
- Natural lithium chloride dew point temperature sensor circuit
- Silicon temperature sensor temperature measurement circuit
- Platinum resistance temperature sensor circuit