---
title: "Urban Garden Environment Monitor"
url: "https://maker.wiznet.io/gavinchang/projects/city-garden-monitor/"
markdown_url: "https://maker.wiznet.io/gavinchang/projects/city-garden-monitor/md"
type: "UCC: User Created Content"
author: "Chen Jian"
author_url: "https://www.elecfans.com/soft/Mec/2022/202212131956672.html"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Chen Jian"
original_url: "https://www.elecfans.com/soft/Mec/2022/202212131956672.html"
published: "2023-04-04"
language: "en"
likes: 1
views: 137
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Urban Garden Environment Monitor

> The device allows a fast, safe and remote analysis of the environment around urban gardens. The Urban Garden Monitor, powered by a WIZnet WI

Original author: Chen Jian (source: https://www.elecfans.com/soft/Mec/2022/202212131956672.html)

## Article

## escribe

![pYYBAGOSmhSATDLVAAcSkn_s2d8613.jpg](https://file.elecfans.com/web2/M00/82/24/pYYBAGOSmhSATDLVAAcSkn_s2d8613.jpg)

Urban Garden Monitor is running.

The device allows a fast, safe and remote analysis of the environment around urban gardens. The Urban Garden Monitor, powered by a [WIZnet](https://bbs.elecfans.com/group_696) WIZ750SR serial-to- [Ethernet](https://www.elecfans.com/tags/%E4%BB%A5%E5%A4%AA%E7%BD%91/) module and [Arduino](https://www.elecfans.com/v/tag/62/) 101, reads temperature, humidity and pressure data and classifies them into a category system using an integrated neural [network .](https://www.elecfans.com/v/tag/1722/)

The device was created using some intertwined ideas:

### WIZnet WIZ750SR serial port to Ethernet module

![pYYBAGOSmkSAIn6LAAbhFpmJQLY212.jpg](https://file.elecfans.com/web2/M00/82/24/pYYBAGOSmkSAIn6LAAbhFpmJQLY212.jpg)

WIZ750SR on Urban Garden Monitor.

WIZ750SR is a serial-to-Ethernet module that allows any device with a serial port to connect to the Internet. The module uses the W7500P processor which combines an [ARM](https://www.elecfans.com/soft/data/21-25/) Cortex-M0 with 128KB flash memory and a hardwired TCP/IP core for seamless connection between serial data and Ethernet data. In Urban Garden Monitor, the WIZ750SR bridges the gap between the environmental data collected by the Arduino 101 and the TCP client terminal accessible on any device connected to the same router as the WIZ750SR.

### Arduino 101 and Pattern Matching Engine [Neural Networks](https://www.elecfans.com/tags/%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/)

The Arduino 101 is a unique development board that functions as an [Intel](https://www.elecfans.com/tags/%E8%8B%B1%E7%89%B9%E5%B0%94/) Curie module in an Arduino form factor. Features real-time operating system, integrated BLE, six-axis accelerometer/ [gyroscope](https://www.elecfans.com/tags/%E9%99%80%E8%9E%BA%E4%BB%AA/) module, and 128-node pattern matching engine (PME) or artificial neural network. Urban Garden Monitor leverages [RTOS](https://www.elecfans.com/tags/RTOS/) and PME to provide optimized characterization of daily environmental data into a 30-class library that fills up as the device learns different classifications of this data, allowing users to visualize data trends and adjust them as needed The Garden. The Arduino 101 also comes with an additional [hardware](https://www.elecfans.com/v/tag/1751/) serial port which is critical to the operation of the WIZ750SR and acts as a link between the two devices.

### BMP180 and DHT22 Environmental [Sensors](https://www.elecfans.com/v/tag/117/)

![pYYBAGOSmm6AJ4PbAAb-7IG-zUo653.jpg](https://file.elecfans.com/web2/M00/82/25/pYYBAGOSmm6AJ4PbAAb-7IG-zUo653.jpg)

The BMP180 is the silver square next to the tape on the far left, and the DHT22 is the sensor next to it.

There are two environmental sensors on the Urban Garden Monitor, BMP180 and DHT22, which collect data for interpretation by the Arduino 101 and PME. The BMP180 is a barometric pressure and [temperature sensor](https://www.elecfans.com/tags/%E6%B8%A9%E5%BA%A6%E4%BC%A0%E6%84%9F%E5%99%A8/)[that communicates](https://m.elecfans.com/v/tag/1301/) with the device using the [I2C](https://www.elecfans.com/tags/i2c/) bus , while the DHT22 is a temperature and [humidity sensor](https://www.elecfans.com/tags/%E6%B9%BF%E5%BA%A6%E4%BC%A0%E6%84%9F%E5%99%A8/) that communicates with the device using a single digital pin. Together, these sensors provide a range of information that the Arduino 101 can interpret and send to the user.

### how to build

To build this device, first obtain all the components in the included bill of materials. Note that your computer must have an ethernet port. [If you don't have a DB9 RS](https://www.elecfans.com/tags/rs/) -232 port on your computer , get [a USB](https://www.elecfans.com/tags/usb/) to RS-232 DB9 adapter cable.

1. Configure WIZ750SR. When you purchase a module as part of the EVB kit, the module will be attached to the evaluation board.

- Plug the included DB9 RS-232 cable into the EVB's DB9 port.

- Plug the included USB Micro to USB A cable into the EVB's Micro-USB port.

- Plug the included Ethernet cable into the Ethernet port of WIZ750SR on the EVB.

- If necessary, plug the DB9 end of the USB to RS-232 DB9 adapter cable into the DB9 RS-232 cable and the USB end into the computer. Otherwise, plug the DB9 end of the DB9 RS-232 cable directly into the computer. [You may need to download](https://www.elecfans.com/soft/special/) a USB-to-serial driver for your cable if it does not already exist on your computer .

- Plug the USB A end of the USB Micro to USB A cable into the computer.

- Plug the Ethernet cable into the computer. This will allow testing of device functionality.

- [Tap the power](https://bbs.elecfans.com/zhuti_power_1.html) switch on the side of the board . The LED will indicate that your device has power.

- Download and open WIZnet-S2E-Tool-GUI using this link: https://github.com/Wiznet/WIZnet-S2E-Tool-GUI/releases/tag/v0.5.4

- Make sure the operating mode is set to "TCP Server". If necessary, use the upload button to update the device.

![poYBAGOSmnGALTPlAAF1b4NXG8w590.png](https://file.elecfans.com/web2/M00/81/9B/poYBAGOSmnGALTPlAAF1b4NXG8w590.png)

Annotated view of the configuration tool. To find your device, click Search and select your device from the table.

- Unplug the Ethernet cable from the EVB, and plug your own Ethernet cable between the home router and the board. This will allow testing device connectivity. Re-open the S2E-Tool software and check the "Local IP" and "Local Port" of your device. Once you have these, your device is ready to use.

2. Test data transmission through WIZ750SR. Keep the device plugged in.

- [Download Socket Test](https://www.elecfans.com/tags/te/) from this link : https://sourceforge.net/projects/sockettest/. This is a TCP client/server terminal program that tests Ethernet functionality.

- Download [the latest](https://www.elecfans.com/article/bbs/)version of the Arduino IDE fromSoftware->Downloads at [arduino.cc](https://bbs.elecfans.com/zhuti_1472_1.html) .

- Open the Arduino IDE. Go to Tools->Port and select the communication port of the EVB. If there are multiple ports, check your computer's device list to see which one belongs to your board.

- Go to Tools -> Serial Monitor and open the monitor. Change the baud rate to 115200 baud.

- Open SocketTest and go to the Clients tab. Enter your EVB's IP address and port number in the respective fields. Click connect to start the terminal.

- If everything is set up correctly, you should be able to type strings in the Arduino terminal and see them appear in the SocketTest terminal, and vice versa. After completing the module test, close all applications and unplug the EVB's cable.

3. Build the Urban Garden Monitor using the parts included in the bill of materials.

- Unplug WIZ750SR from EVB. Turn the WIZ750SR over so that the connectors are facing up.

- Follow this circuit diagram to assemble the electronics of the [display](https://m.elecfans.com/v/tag/1267/) . [Wrap electrical](https://www.elecfans.com/v/tag/162/) tape around the breadboard after wiring before placing it in the center of the Arduino 101. Wrap the tape tightly to ensure a stable connection, but make sure the hole in the silver BMP180 unit is exposed and facing upwards.

![pYYBAGOSmniAFSnDAAHHgWdMnZM486.png](https://file.elecfans.com/web2/M00/82/25/pYYBAGOSmniAFSnDAAHHgWdMnZM486.png)

Fritzing circuit diagram for Urban Garden Monitor. The 4 wires leading to the 12-pin connector are F/F.

- Note that the WIZ750SR connector consists of male pins. Use 4 F/F jumpers, each with a solid M/M jumper on one end, to create a low profile connection on the Arduino 101.

- Place the WIZ750SR on top of the mini breadboard and glue everything together. Tuck any loose jumper wires into the Arduino 101's side pocket. Make sure the three LEDs on the WIZ750SR are still visible and the reset button and Ethernet and USB ports are accessible.

- Connect the Arduino 101 to the Arduino stand to ensure protection of the board.

![poYBAGOSmnuAVMTxAABA7OYLQJ0232.jpg](https://file.elecfans.com/web2/M00/81/9B/poYBAGOSmnuAVMTxAABA7OYLQJ0232.jpg)

Final product. Results may vary based on tape selection.

4. Upload the Urban Garden Monitor code to the Arduino 101.

- Download the included code to your computer and open it in the Arduino IDE. Helpful comments are included in the file to guide your understanding.

- Go to Tools->Board->Boards Manager and find [the Intel](https://www.elecfans.com/tags/intel/) Curie Boards core. Download version 2.0.2.

- Close the IDE.

- Download the following additional repositories to your computer:

Intel Pattern Matching Technology: https://github.com/intel/Intel-Pattern-Matching-Technology

Adafruit DHT Humidity and Temperature Unified Sensor Library: https://github.com/adafruit/DHT-sensor-library

Adafruit Unified BMP085/BMP180 Driver: https://github.com/adafruit/Adafruit_BMP085_Unified

- Open your computer's file system and find the "Arduino" folder. If the folder does not exist, create a folder called "libraries" in it. Open the folder and paste the downloaded three code libraries into the folder.

- Re-open the Arduino IDE and plug the Urban Garden Monitor's USB port into the computer using the USB AB cable. Go to Tools->Port and select the Arduino 101's port. Then go to Tools->Board and scroll down to Intel Curie (32-bit) board. Choose Arduino/Genuino 101.

- Click the Upload button to upload the code to your board. are you ready!

### device settings

To run the device, first set up the Urban Garden Monitor in the area where you want to take environmental readings. The best location is close if not next to a specific group of plants you may be concerned about, as this will allow you to get the most accurate readings of the plants you are monitoring.

![poYBAGOW21-AZKCsAAmpKJZ2g5o114.jpg](https://file.elecfans.com/web2/M00/82/DD/poYBAGOW21-AZKCsAAmpKJZ2g5o114.jpg)

The process of plugging in the device.

With the monitor in place, take a USB wall charger and plug the USB AB cable into it. Plug the charger into a wall outlet. Connect the B end of the cable to where the monitor is. When you're ready, remove the ethernet cable from the router and connect it to the monitor as well. Plug the USB cable into the USB-B port, then plug the Ethernet cable into the Ethernet port. You should first see the red LED light up, then the blue LED light up once the device connects to the internet.

![poYBAGOW24eADeLiAAeHGs8KHLU869.jpg](https://file.elecfans.com/web2/M00/82/DD/poYBAGOW24eADeLiAAeHGs8KHLU869.jpg)

The LED indicator on the device is located in the upper right corner.

Once the monitor is connected, you can leave it alone. Go to your computer and open the SocketTest application. Enter the IP address and port number you noted earlier for the EVB and click Connect. Note that the IP address may change if you add or disconnect any other devices between when you first obtained the IP address and now. If this is the case, you can check the router's home page to see the monitor's current IP address.

![pYYBAGOW242AGb-FAABmXkZYltg143.png](https://file.elecfans.com/web2/M00/83/66/pYYBAGOW242AGb-FAABmXkZYltg143.png)

Get ready for SocketTest.

If the display fails to connect, please try again as it may take some time to fully connect to the network.

### Device Operations and Commands

Once connected, you should see this screen:

![pYYBAGOW25CANIkSAABqZv0D5jE617.png](https://file.elecfans.com/web2/M00/83/66/pYYBAGOW25CANIkSAABqZv0D5jE617.png)

SocketTest application after connecting to Monitor.

Type anything and hit send or enter to activate the monitor. You will then be prompted to provide the current time. Enter hours first, send, then minutes and send. If you make a mistake, you can hit the reset button on the monitor and try again.

![poYBAGOW25KAST4BAAAYSPhP5No743.png](https://file.elecfans.com/web2/M00/82/DD/poYBAGOW25KAST4BAAAYSPhP5No743.png)

The screen after entering the time. Note that the time should be entered in 24H format.

After configuring the time, you should see a menu prompt. Here are the commands you can enter:

![pYYBAGOW25WAKRGrAAA79Uoy9kk356.png](https://file.elecfans.com/web2/M00/83/66/pYYBAGOW25WAKRGrAAA79Uoy9kk356.png)

A list of commands printed by the device.

- LD: This command creates a 2-second interval loop of sensor data readings using an interrupt service routine. During this time the loop will take precedence over all other commands, so make sure you don't activate any other data display commands during this time or they will be interrupted. This command is recommended when you want to be able to remotely view the environment in which your plants are growing, so you can respond accordingly when conditions change.

![poYBAGOW252AX8T6AACYcM2UZcc383.png](https://file.elecfans.com/web2/M00/82/DD/poYBAGOW252AX8T6AACYcM2UZcc383.png)

Internal heat may cause unusually high temperatures. You can subtract offsets to help in your code.

- DL: This command closes the ISR data loop.

- DD: This command sends a single snapshot of the current sensor data readings.

- SS: This command shows the average data and neural network classification for the previous day. If you call this command when no data exists for the previous day, you will be notified and no data will be displayed.

- ST: This command displays the data classification for the last 30 days. It will show up as class 0 until the day is classified. Note that class 0 will also be used by the device for the first class. You can modify this by starting the array index at 1 and ending it at 30 instead of 29 if you like.

- [DC](https://www.elecfans.com/tags/DC/DC/) : This command displays what each saved numeric day data class represents. If the category has not been assigned a characteristic, the data for all fields will be shown as zero.

![poYBAGOW26CAE6ghAAAiwkLvt88569.png](https://file.elecfans.com/web2/M00/82/DD/poYBAGOW26CAE6ghAAAiwkLvt88569.png)

The Display Characterizations command is running. Since the data has not been classified, all values ​​are 0.

- SC: This command displays a list of commands, for reference if you need it.

### PME operation

When the user operates the board, the Pattern-Matching Engine will run in the background. Every hour, the device records samples of temperature, air pressure, and humidity around the device. This data is then saved to the device as an array. After 24 hours of recording, the device averages each data set and creates a three-variable representation of the past 24-hour environment. This data is then loaded into PME, which classifies it according to the learning experience. If no PME finds a matching previous classification, the data will be assigned a new classification and saved to the PME's memory. Otherwise, assign an existing classification. In both cases, the categories assigned for the day are also saved. Classifications are put into a 30-day array which dynamically fits to prevent overflow, removing the oldest saved dates and shifting all other data up, allowing the most recent [classifications](https://www.elecfans.com/article/zt/) to be recorded. This allows users to see how the environment changes on a daily basis, allowing them to adjust their gardens to potential data increases or decreases.

If the number of categories exceeds 30, the oldest category will then be deleted due to the limited amount of storage space in PME.

![poYBAGOW28CAXppwAAaMAbERRn0628.jpg](https://file.elecfans.com/web2/M00/82/DD/poYBAGOW28CAXppwAAaMAbERRn0628.jpg)

The Urban Garden Monitor is small enough to fit on the edge of and next to a plant pot.

Hopefully this project will give people more time in their lives to give more benefit to the urban gardens they might tend!

---

Source: https://maker.wiznet.io/gavinchang/projects/city-garden-monitor/
