Home > Basic Circuits >Sensor Circuits > How to use temperature sensors to design plant monitoring systems

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

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号