Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Wi-Fi Environmental Monitoring System with DS18B20, pH Meter, and Turbidity Sensor

View and Edit Project In Cirkit DesignerImage of Arduino UNO Wi-Fi Environmental Monitoring System with DS18B20, pH Meter, and Turbidity Sensor

Circuit Documentation

Summary

This circuit is designed to read data from a DS18B20 temperature sensor, a pH meter, and a turbidity sensor. The data is then serialized and sent via WiFi to the Blynk app for remote monitoring. The circuit utilizes an Arduino UNO with WiFi capabilities, a DC Buck Step-down converter, and a 12V power supply to power the sensors and the microcontroller.

Component List

DS18B20

PH Meter

Turbidity Sensor

12V Power Supply

Arduino UNO+WiFi R3 ATmega328P+Node MCU ESP8266 CH340G

XL4015 5A DC Buck Step-down

Wiring Details

DS18B20

PH Meter

Turbidity Sensor

12V Power Supply

Arduino UNO+WiFi R3 ATmega328P+Node MCU ESP8266 CH340G

XL4015 5A DC Buck Step-down

Code Documentation

/*
 * This Arduino Sketch reads data from a DS18B20 temperature sensor, a pH meter,
 * and a turbidity sensor. The data is then serialized and sent via WiFi to the
 * Blynk app for remote monitoring.
 */

#include <OneWire.h>
#include <DallasTemperature.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// Data wire is connected to Arduino pin 2
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);

// Blynk credentials
char auth[] = "YourAuthToken";
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

// Sensor pins
const int pH_PIN = A0;
const int TURBIDITY_PIN = A1;

void setup() {
  // Start serial communication
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

  // Start up the DS18B20 library
  sensors.begin();
}

void loop() {
  Blynk.run();

  // Request temperature readings
  sensors.requestTemperatures();
  float temperature = sensors.getTempCByIndex(0);

  // Read pH value
  int pHValue = analogRead(pH_PIN);
  float pH = (pHValue * 5.0 / 1024.0) * 3.5; // Example conversion

  // Read turbidity value
  int turbidityValue = analogRead(TURBIDITY_PIN);
  float turbidity = (turbidityValue * 5.0 / 1024.0) * 2.5; // Example conversion

  // Print values to serial monitor
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" °C, pH: ");
  Serial.print(pH);
  Serial.print(", Turbidity: ");
  Serial.println(turbidity);

  // Send values to Blynk
  Blynk.virtualWrite(V1, temperature);
  Blynk.virtualWrite(V2, pH);
  Blynk.virtualWrite(V3, turbidity);

  // Wait 2 seconds before next loop
  delay(2000);
}

This code initializes the sensors and WiFi connection, reads data from the sensors, and sends the data to the Blynk app for remote monitoring. The temperature is read from the DS18B20 sensor, the pH value is read from the pH meter, and the turbidity value is read from the turbidity sensor. The values are printed to the serial monitor and sent to the Blynk app every 2 seconds.