Automatic liquid feelling system with line fallower robot



Robots are increasingly being used to automate various tasks in various industries, and the food and beverage industry is no exception. In this article, we will guide you through the process of building an automatic weight sensor-based cold-drink dispensing system with a line follower robot. This system involves combining a weight sensor, a liquid dispenser, and a line-following robot to create an autonomous robot that can dispense a set amount of cold drinks based on a target weight.

Materials Needed:

Semantics Diagram:-



Automatic Weight sensor based water feelling system with line fallower robot

Step 1: Connect the Weight Sensor

The first step is to connect the weight sensor to the HX711 amplifier module. The load cell will be placed on the amplifier module to measure the weight of the cold drink being dispensed. Connect the wires from the load cell to the HX711 amplifier module according to the wiring diagram provided. Then, connect the amplifier module to the Arduino board using jumper wires.

Step 2: Connect the Liquid Dispenser

Next, attach the liquid dispenser (peristaltic pump) to the line following the robot. This can be done by mounting the dispenser on the robot's chassis or by attaching it to a motor that is controlled by the robot. Make sure the dispenser is securely attached to the robot, so it does not come loose during operation.

Step 3: Upload the Code to the Arduino

The next step is to upload the code to the Arduino board. The code will control the movement of the line following the robot, the dispensing of the cold drink, and the measurement of the weight of the cold drink being dispensed. You can use the following simple code as a starting point.

Code:

#include <AFMotor.h> #include "HX711.h" const int LOADCELL_DOUT_PIN = 9;//servo2 const int LOADCELL_SCK_PIN = 10;//servo1 HX711 scale; long reading; #define LS A3 // left ir sensor #define RS A2 // right ir sensor //HC-SR04 Sensor connection const int trigPin = 13; const int echoPin = 2; int duration, distance; AF_DCMotor motor1(1);//water Pump AF_DCMotor motor2(2); AF_DCMotor motor3(3); void setup() { Serial.begin(9600); pinMode(LS, INPUT); pinMode(RS, INPUT); pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input motor1.setSpeed(255); motor2.setSpeed(255); motor3.setSpeed(255); scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN); delay(3000); } void Bar_tender_robot() { long duration, distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; Serial.print("Distance:"); Serial.print(distance); Serial.println(); Serial.print("RS: "); Serial.print(analogRead(RS)); Serial.print(" "); Serial.print("LS: "); Serial.println(analogRead(LS)); if(analogRead(LS)>500 & analogRead(RS)>500) // Move Forward { Forward(); motor1.run(RELEASE); //water pump off } if(analogRead(RS)>500 && analogRead(LS)<500) // Turn right { TurnRight(); motor1.run(RELEASE); } if(analogRead(RS)<500 && analogRead(LS)>500) // turn left { TurnLeft(); motor1.run(RELEASE); } if(analogRead(LS)<500 && analogRead(RS)<500) // stop { Backward(); motor1.run(RELEASE); } if(distance>0 & distance<20) { Stop(); delay(4000); reading = scale.read(); feeling_system(); motor1.run(RELEASE); delay(5000); } } void feeling_system() { if(reading>(-1000)&reading <(20000)) { motor1.run(FORWARD);//water pump ON delay(1500); Serial.print("HIGH:"); Serial.print(reading); Serial.println(); } if(reading>(38000) & reading<(4500)) { motor1.run(RELEASE); Serial.print("LOW:"); Serial.print(reading); Serial.println(); // reading = scale.read(); } if(reading>(0)&reading <(30000)) { motor1.run(RELEASE); Serial.print("LOW:"); Serial.print(reading); Serial.println(); } } void Forward() { Serial.println("Farward"); motor2.run(FORWARD); motor3.run(FORWARD); } void TurnRight() { Serial.println("Turn right"); motor2.run(RELEASE); motor3.run(FORWARD); } void TurnLeft() { Serial.println("Turn left"); motor2.run(FORWARD); motor3.run(RELEASE); } void Backward() { Serial.println("Stop"); motor2.run(FORWARD); motor3.run(BACKWARD); delay(2500); } void Stop() { motor2.run(RELEASE); motor3.run(RELEASE); } void loop() { reading = scale.read(); Serial.print("HX711 reading: "); Serial.println(reading); Serial.print("Load"); Serial.println(reading); Bar_tender_robot(); delay(300); }

This code will control the dispensing of the cold drink based on the weight being measured by the weight sensor. The dispenser will dispense the cold drink until the target weight is reached, at which point the dispensing will stop.

Step 4: Add the Line Following the Algorithm

To make the robot follow a line, you will need to add a line following algorithm to the code. You can use a variety of different line following algorithms, but one of the most popular is the PID (Proportional-Integral-Derivative) algorithm. The line following algorithm will control the movement of the robot along a line.

Step 5: Test the Robot

Finally, connect the power source to the Arduino board and test the robot. If everything is working properly, the line following

Video:-


Post a Comment

0 Comments