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

Arduino Uno Smart Feeder with GSM Alerts and Ultrasonic Level Detection

View and Edit Project In Cirkit DesignerImage of Arduino Uno Smart Feeder with GSM Alerts and Ultrasonic Level Detection

Circuit Documentation

Summary

This circuit is designed to control a servo motor, relay, and various sensors using an Arduino Uno R3. It includes an LCD display for user interaction, a real-time clock (RTC) for timekeeping, and a GSM module for sending SMS notifications. The circuit also features push buttons for setting the time and an ultrasonic sensor for distance measurement.

Component List

  1. Arduino Uno R3

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: D8, D9, D10, D11, D12, D13, GND, AREF, SDA, SCL, D0/RX, D1/Tx, D2, D3, D4, D5, 6, D7, A5/SCL, A4/SDA, A3, A2, A1, A0, Vin, 5V, 3.3V, RESET, IOREF, NONE, USB Jack, Power Jack
  2. 1 Channel Relay 5V

    • Description: A relay module that allows control of high voltage devices.
    • Pins: VCC, GND, IN, NC, COM, NO
  3. SIM900A

    • Description: A GSM module for sending and receiving SMS.
    • Pins: GND, DB9-3 (RXD), DB9-2 (TXD), 5V, 3VR, 5VR, 3VT, 5VT, VCC, Ring, RESTART, RESET, STATUS
  4. Servo Motor

    • Description: A motor that can be controlled to move to a specific position.
    • Pins: PWM, GND, VCC
  5. 20x4 I2C LCD Panel

    • Description: An LCD display with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  6. DS1302 RTC

    • Description: A real-time clock module for timekeeping.
    • Pins: VCC, GND, CLK, DATA, RST
  7. Push Button Round

    • Description: A simple push button for user input.
    • Pins: leg0, leg1
  8. HC-SR04 Ultrasonic Sensor

    • Description: A sensor for measuring distance using ultrasonic waves.
    • Pins: VCC, TRIG, ECHO, GND
  9. DC Motor

    • Description: A motor that runs on direct current.
    • Pins: pin 1, pin 2
  10. 12V 200Ah Battery

    • Description: A high-capacity battery for powering the circuit.
    • Pins: GND, 12V

Wiring Details

Arduino Uno R3

1 Channel Relay 5V

SIM900A

Servo Motor

20x4 I2C LCD Panel

DS1302 RTC

Push Button Round

HC-SR04 Ultrasonic Sensor

DC Motor

12V 200Ah Battery

Documented Code

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <RTClib.h>
#include <Servo.h>
#include <SoftwareSerial.h>

// Initialize LCD, RTC, Servo, and GSM
LiquidCrystal_I2C lcd(0x27, 16, 4);  // Adjust the I2C address if necessary
RTC_DS3231 rtc;
Servo servoMotor;
SoftwareSerial sim900(11, 10);  // GSM SIM900A RX to 11, TX to 10

// Pin definitions
const int relayPin = 13;
const int servoPin = 9;
const int hourButton = 3;                    // Button to increment hour
const int minuteButton = 4;                  // Button to increment minute
const int confirmButton = 5;                 // Button to confirm time
const int triggerPin = 6;                    // Ultrasonic trigger pin
const int echoPin = 7;                       // Ultrasonic echo pin
const float distanceThreshold = 45.0;       // Distance threshold in cm
const char phoneNumber[] = "+639686791256";  // Replace with target phone number
const char phoneNumbers[] = "+639550468037";  // Replace with the second target phone number

boolean timeSet = false;   // Flag to indicate if the time has been set
int hour = 1, minute = 0;  // Default time settings

// Timing variables
unsigned long previousMillis = 0;
const