Arduino Uno:: Main Components: Main Brain of The Device
Arduino Uno:: Main Components: Main Brain of The Device
LCD Screen: To provide visual output for data, messages, or sensor reading
DS1820 ( TEMPERATURE SENSOR): Used for measuring ambient temperature in
Environment like homes, geenhouses, or Industrial settings. It can also be use to monitor temperature in
liqiuds
pH Level Sensor: Used to measure the acidity or alkalinity of a solution which is essential in
many scientific, industrial, and Environmental applications
DC- DC Buck Converter: Used for stepdown high voltage from a power source to a lower voltage
suitable for electronics devices.
1. LCD Screen: For LCD screen, 1st connect the SDA Pin to the Analog Input 4 (A4) of Arduino Uno.
2nd Connect the SCL Pin to the Analog Input 3 (A3) of Arduino, and 3rd Connect the VCC PIN
(Posotive Supply Voltage) to the 5 volts Power Source and Connect the GND PIN( GROUND) to the
negative Supply Voltage of the Power Source.
2. pH Level Sensor: For pH Level Sensor, 1st connect the sensor probe to the pH sensor module. 2nd
From pH sensor module connect the signal pin of the sensor to the A0 of the arduino, and 3rd Connect
the VCC and ground the positive and negative supply voltage of the power source.
3. Temperature Sensor: For Temperature Sensor, 1st connect the VCC (Red Wire) and Ground (Black
Wire) to the positive and negative side of the supply voltage. 2nd Connect the signal pin (Brown wire)
to digital Pin 2 of arduino with 4.7k Ohm Pull up resistor
4. DC – DC Buck Controller: For DC – DC buck controller, Connect the positive and negative output
to the 5v input Pin and ground pin to arduino uno.
Program:
“””
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>
#define ONE_WIRE_BUS 2
#define SensorPin A0
“””
- This code sets up the necessary libraries and pin configurations for:
“””
//set LCD address
LiquidCrystal_I2C lcd(0x27,16,2);
// Temperature Sensor
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
“””
What Does This Code Do?
1. Sets up the LCD:
• Defines two values (calibrationOffset and calibrationSlope) that can be adjusted to make
sensor readings more accurate.
3. Sets up the Temperature Sensor:
• Prepares the Arduino to read temperature data from a DS18B20 sensor connected to a
specific pin.
“””
void phGravitySensor() {
float measure = analogRead(A0); //Read pin A0
double voltage = measure*5/1024; //Analog-to-Digital Conversion
“””
void tempSensor() {
// Send the command to get temperatures
sensors.requestTemperatures();
//delay(500);
}
“””
- This code defines a function named tempSensor() that reads the temperature from a DS18B20
temperature sensor, displays it on an LCD, and prints it to the Serial Monitor in both Celsius and
Fahrenheit.