Smart Greenhouse Application Demo
Overview
The demo concentrates on several important agriculture characteristics including soil moisture, soil pH with temperature compensation, as well as visible light recognition and control. These are three of the main sources of plant growth, and monitoring these are critical to the efficiency and optimization of the crop you are growing. CN0398 is a reference design that enables the demo to measure soil moisture, soil pH, and temperature. CN0397 allows the demo to measure the light intensities at certain visible light wavelengths that plants are sensitive to. CN0370 is a 16-bit LED current driver that controls the light intensity for a particular color LED, providing optimal lighting levels for the plants.
Smart Greenhouse demo showcases the capability of ADICUP360 in a fast prototyping environment in combination of 3 reference designs in two different form factors, Arduino form factor and PMOD form factor, to cater an applications in Smart Agriculture.
To learn more about the reference designs, please refer their individual circuit notes CN0370, CN0397 and CN0398.
Setup Requirements
Smart Greenhouse Demo Requirements
Boards/Hardware
Sensors
pH Probe with BNC termination type (Atlas Scientific pH probe)
3 Wire Moisture Sensor (VH400)
3 Wire PT100
627nm LED’s (LXM2-PD01-0050 used in demo)
540nm LED’s (LXML-PM01-0100 used in demo)
470nm LED’s (LXML-PB01-0040 used in demo)
Cables/Power
5V, 2A wall power supply(3 Pcs)
7V to 12V DC wall power supply
USB to micro USB cable
Software/Tools
How to setup Hardware
Functional Block Diagram

ADICUP360 Hardware Setup

CN0398 Hardware Setup

CN0397 Hardware Setup

CN0370 Hardware Setup

Chip select Assignment for each CN0370 boards are as follows:

CN0370 Control |
ADICUP360 Pin (P4) |
ADuCM360 Pin/Port |
|---|---|---|
Red LED |
7 |
P1.0 |
Green LED |
10 |
P2.2 |
Blue LED |
8 |
P1.1 |
MOSI |
2 |
P1.6 |
MISO |
3 |
P1.4 |
SCLK |
4 |
P1.5 |
GND |
5 |
DGND |
VDD |
7 |
DVDD |
Note
The demo used three CN0370 hardware routed on the same SPI bus with different chip selects and each hardware controls specific external LEDs which includes BLUE LED, GREEN LED and RED LED
Complete setup
Hardware Connections as follows
Connect P3, P4, P6 and P7 connectors of EVAL-CN0398-ARDZ board on top of connectors P2, P5, P7 and P8 of the ADICUP360 board.
On top of the EVAL-CN0398-ARDZ board, connect the EVAL-CN0397-ARDZ to the Analog, Power , DigI1 and DigI0 connectors.
Route the SPI lines of three CN0370 boards to P4 (PMOD_SPI) of ADICUP360 board.
Apply 7-12V supply to DC barrel jack(P11) of ADICUP360 board
Connect USB micro to P14(DEBUG) of ADICUP360 using a micro USB to USB on the PC.
Drag and drop the Smart_Ag.bin file onto the MBED drive.Allow a few seconds for the program to download.
Disconnect the micro USB cable from P14(DEBUG) and connect the micro USB to P13(USER) of ADICUP360
Apply +5V, 1A supply to each CN0370 board
Software Description
The demo software is an integrated software of all the three reference designs which allows measurements of soil pH and moisture measurements with temperature compensation, as well as light detection and control.
The software allows calibration of the pH sensors and the photodiodes on the board for more accurate measurements. The LED’s can be controlled manually using the software and automatically by setting the desired intensity of each wavelength and using proportional control.
Obtaining the Source Code
There are two basic ways to program the ADICUP360 with the software for the Smart Greenhouse Demo.
Dragging and Dropping the .Bin to the MBED drive
Building, Compiling, and Debugging using CCES
Using the drag and drop method, the software is going to be a version that Analog Devices creates for testing and evaluation purposes. This is the EASIEST way to get started with the reference design.
Importing the project into CrossCore is going to allow you to change parameters and customize the software to fit your needs, but will be a bit more advanced and will require you to download the CrossCore toolchain.
The software for the ADuCM360_demo_Smart_Greenhouse demo can be found here:
Download
Prebuilt Smart Greenhouse Demo Bin File
Complete Smart Greenhouse Demo Source Files
Note
For more information on importing, debugging, or other tools related questions, please see the tools user guide.
How to use the Tools
The official tool we promote for use with the EVAL-ADICUP360 is CrossCore Embedded Studio. For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the Tools Overview page.
Importing
For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to import existing projects into your workspace section.
Debugging
For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to configure the debug session section.
Software Flow Diagram
Upon start of the software, it will initialize all of the boards attached to the ADICUP360. CN0398 initialization will write all the settings to the IC’s on board, while CN0397 initialization will write the settings to the DAC registers. The CN0370 will be written with code zero to turn off all of the LED’s.
Once the initialization is complete, the program will now wait for a user command to execute the corresponding tasks.
Serial Terminal/Output
In puTTy cofiguration, select serial as the connection type with a baud rate of 115200. Select the correct COM port by checking it in your device manager. 
