8
/ Concept to Creation: Practical Applications for Smart, Connected and Secure IoT Solutions
ATMEGA328PB 8-Bit
Microcontroller Evaluation Kit
MPLAB
®
X Integrated Development
Environment (IDE)
STEMMA Soil Moisture Sensor
The STEMMA Soil Moisture Sensor Communicates via I
2
C. The
sensor measures the capacitive difference between the two
probes and reports and has an integer value from 300 to 500
based on the moisture content of the soil.
BME280 Temperature Sensor
The BME280 Temperature Sensor Communicates via I
2
C.
It reports a floating-point number with a unit of measure of
degrees Celsius. The value is convertible to degrees Fahrenheit
using the formula: F = C x 9/5 + 32
BME280 Humidity Sensor
The BME280 Humidity Sensor Communicates via I
2
C. It
reports a floating-point number with a unit of measure in the
percentage of relative humidity.
SEN0249 Soil pH Sensor
The output of the SEN0249 Soil pH Sensor is an analog
signal from 0–5VDC. The pH is a unitless measure that will
range from 0 to 14. The formulas to calculate the pH level are:
Voltage = ADC x (5V/1024) where ADC is the value read by the
microcontroller's ADC pin connected to the pH sensor.
The formula assumes the microcontroller has a 5VDC operating
voltage and 10-bit ADC. These numbers may require an
adjustment if you use an alternative microcontroller with a
different operating voltage or ADC resolution. Then calculate
the pH level: pH Value = (3.5 x Voltage) + Offset
The offset is a variable that gets determined
during the calibration process for the pH sensor.
Note that this sensor must get recalibrated
every two (2) hours. Find more information on the
calibration process on the DFRobot site.
MG-811 CO
2
Sensor
The output of the MG-811 CO2 Sensor is an analog signal
from 0–5VDC. The unit of measure is the concentration
of CO2 ppm. The following formulas are used to translate
the analog voltage value to a CO2 concentration in ppm:
Voltage = ADCx (5V/1,024) where ADC is the value read by
the microcontroller's ADC pin connected to the MG-811 CO2
sensor.
The formula assumes the microcontroller has a 5VDC
operating voltage and 10-bit ADC. These numbers may require
an adjustment if you use an alternative microcontroller with a
different operating voltage or ADC resolution. If the calculated
voltage is less than 0.4V, then the sensor has not yet warmed
up enough, and no readings should occur at that time. Once
the voltage rises above 0.4V, the following formula can be
useful to make the final CO2 concentration calculation: CO2
Concentration (ppm) = [(Voltage − 0.4) x 5000]/1.6
Complete Project Information
Want to grow vegetables, herbs, and fruits year-round? For
more project design information utilizing the Xplained board
series from Microchip Technology, so you can take advantage
of the fruits of their labor without having to get your hands
dirty, click on the link below:
To learn more about creating this project with a RF LoRA
development tool please follow this link.
https://www.mouser.com/applications/building-smarter-farm-
with-microchip/
To learn more about creating this project with a Wi-Fi
development tool please follow this link.
https://www.mouser.com/applications/smarter-green-thumb-
powered-by-microchip/
• On-board debugger
• Auto-ID for board identification
• Access to all signals on target MCU
LEARN MORE
• Data Visualizer
• Helpful Design Resources
• I/O View
LEARN MORE