Robotics ArduinoJLCPCB
Published © GPL3+

Fish feeder automatic diy with arduino

Learn how to create your diy fish feeder automatic with Arduino.

BeginnerFull instructions provided5 hours8,608
Fish feeder automatic diy with arduino

Things used in this project

Hardware components

JLCPCB Customized PCB
JLCPCB Customized PCB
×1
Servo motor MG996
×1
Arduino UNO
Arduino UNO
×1
LCD i2c 20x4
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Laser cutter (generic)
Laser cutter (generic)

Story

Read more

Code

Source Code

Arduino
#include "Servo.h"       
#include <DS1307.h>
#include <Wire.h> //Biblioteca de Comunicacao I2C 

int DataTime[7];

int actual_hour = 0, last_hour = 0;
int cont = 0;

Servo myservo;

void setup() 
{  
  
Wire.begin(); //Inicializacao da Comunicacao I2C
DS1307.begin();

DS1307.getDate(DataTime);

actual_hour = DataTime[4];
last_hour = DataTime[4];

myservo.attach(9);

}

void loop() 
{

  DS1307.getDate(DataTime);
  actual_hour = DataTime[4];

  if(actual_hour != last_hour)
  {
    cont++;
    last_hour = actual_hour;  
  }

  if(cont == 2)
  {
    myservo.write(180);  
    delay(30000);
    myservo.write(90);

    cont = 0;

    last_hour = actual_hour;   
  }
  
}

Credits

Robotics Arduino

Robotics Arduino

42 projects • 60 followers
JLCPCB

JLCPCB

73 projects • 42 followers
JLCPCB, is the largest PCB and PCB Assembly prototype enterprise in Asia. Coupon code "JLCPCBcom" for all and permanantly available.

Comments