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

Arduino UNO-Based Weather Station with LCD Display and Motor Control

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Weather Station with LCD Display and Motor Control

Circuit Documentation

Summary

This circuit is designed to interface various sensors and a motor with an Arduino UNO microcontroller. The sensors include a DS18B20 temperature sensor, an ACS712 current sensor, a BMP280 pressure sensor, a rotary potentiometer, a wind vane, and an HX711 load cell interface. Additionally, an LCD TFT screen is used for display purposes. The circuit also includes a brushless motor controlled by the Arduino. The Arduino reads data from the sensors, processes it, and displays the information on the LCD screen while controlling the motor speed based on the potentiometer input.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. DS18B20 Temperature Sensor

    • Description: Digital temperature sensor.
    • Pins: GND, VCC, OUT
  3. ACS712 Current Sensor 5A 20A 30A

    • Description: Current sensor module.
    • Pins: 1, 2, GND, OUT, VCC
  4. Rotary Potentiometer

    • Description: Variable resistor used to control motor speed.
    • Pins: leg1, wiper, leg2
    • Properties: Resistance: 10000 Ohms
  5. Wind Vane

    • Description: Sensor to measure wind direction.
    • Pins: A0, VCC, GND
  6. LCD TFT screen ILI9488 HD

    • Description: Display module.
    • Pins: PEN, TDO, TDI, VCC (3.3~5V), GND, CS, RST, D/C, SDI(MOSI), SCK, BL, SDO(MISO), TCS, TCK
  7. Battery 12V

    • Description: Power source.
    • Pins: +, -
  8. BMP280

    • Description: Pressure sensor.
    • Pins: SDO, CSB, SDA, SCL, GND, VCC
  9. HX711 - Bridge Sensor Interface

    • Description: Load cell amplifier.
    • Pins: E+, E-, A-, A+, B-, B+, GND - GROUND, DATA (OUT), SCK - CLOCK (IN), 3.3/3.5V Supply
  10. Brushless Motor

    • Description: Motor controlled by the Arduino.
    • Pins: L1, L2, L3

Wiring Details

Arduino UNO

DS18B20 Temperature Sensor

ACS712 Current Sensor 5A 20A 30A

Rotary Potentiometer

Wind Vane

LCD TFT screen ILI9488 HD

Battery 12V

BMP280

HX711 - Bridge Sensor Interface

Brushless Motor

Documented Code

#include <DHT.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
#include <LiquidCrystal_I2C.h>

// DHT22 setup
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);

// BMP280 setup
Adafruit_BMP280 bmp;

// Load cell HX711 setup
#include "HX711.h"
#define LOADCELL_DT 3
#define LOADCELL_SCK 4
HX711 loadCell;

// Motor control setup
#define POT_PIN A1
#define ESC_PIN 9

// Current sensor
#define CURRENT_PIN A0

// LCD setup
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  // Serial setup
  Serial.begin(9600);

  // DHT22 setup
  dht.begin();

  // BMP280 setup
  if (!bmp.begin(0x76)) {
    Serial.println("BMP280 not detected!");
    while (1);
  }

  // HX711 setup
  loadCell.begin(LOADCELL_DT, LOADCELL_SCK);
  loadCell.set_scale();
  loadCell.tare();

  // Motor setup
  pinMode(ESC_PIN, OUTPUT);

  // LCD setup
  lcd.init();
  lcd.backlight();

  // Current sensor setup
  pinMode(CURRENT_PIN, INPUT);
}

void loop() {
  // DHT22 readings
  float temperature = dht.readTemperature();
  float humidity = dht.readHumidity();

  // BMP280 readings
  float pressure = bmp.readPressure();

  // Load cell readings
  float force = loadCell.get_units();

  // Current sensor readings
  float current = analogRead(CURRENT_PIN) * (5.0 / 1023.0) * 100;

  // Motor speed control
  int potValue = analogRead(POT_PIN);
  int escSignal = map(potValue, 0, 1023, 1000, 2000);
  analogWrite(ESC_PIN, escSignal);

  // Display data
  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(temperature);
  lcd.print("C");

  lcd.setCursor(0, 1);
  lcd.print("Press: ");
  lcd.print(pressure / 100);
  lcd.print("hPa");

  // Print to serial
  Serial.print("Temp: "); Serial.print(temperature);
  Serial.print(" Humidity: "); Serial.print(humidity);
  Serial.print(" Pressure: "); Serial.print(pressure / 100