Black and White Object sorting Robot

Published Sep 21, 2018
 0 hours to build
 Beginner

This project is for to detect and sort out black and white object in a particular box.

display image

Components Used

AK9753 IR sensor
AK9753 is a low power and compact IR (infrared) sensor module.
1
Arduino UNO
Arduino UNO
1
SG90 Servo Motor
Power Management IC Development Tools SG90 Servo
1
Description

Here I build a small application which detects and separate out black and white objects

This project is very useful in many industry for sorting out black and white objects separately. In this project I used Arduino, Servo motor, and IR Sensor.

Project Mechanism

Here I used IR sensor to detect color of object whether it is black or white. If object is white then reflects the IR rays and detect object is white and when object is black then there is no any reflection because black color not reflect any light rays.

It gives digital one or zero form of output to the Arduino board and from that rotate the servo motor left or right.

If object is black then rotate servo motor to right side 90 degree and object is white then rotate servo motor to the left side 90 degree.

Now connect Servo motor and IR Module to the Arduino board as shown in connection diagram.

Connection Diagram

Connection Diagram

Y-shaped Arm

Here I used foam material to build Y-shaped arm, you can use other type material also.

Now cut foam sheet as your object specification’s need and connect them as shown in figure below.

 

Now, connect this Y-shaped arm to the top of Servo motor, for connection I used double sided tape.

 

Next, connect the IR module to the body of Servo Motor sh shown in figure below.

 

 

The complete connection is shown like this,

Code

#include <Servo.h>
Servo myservo;  
#define sensor 7
int sensorstate;

void setup() {
 pinMode(sensor, INPUT);
 pinMode(13, OUTPUT);
 Serial.begin(9600);
 myservo.attach(9); 
 myservo.write(90);
 delay(1000);
}

void loop() {
 myservo.write(90);
 
 if(digitalRead(sensor) == HIGH){
   myservo.write(0);
   delay(500);
   myservo.write(90);
   delay(500);
   Serial.println("WHITE");
 }
 
 else if(digitalRead(sensor) == LOW){
   digitalWrite(13, HIGH);
   myservo.write(180);
   delay(500);
   myservo.write(90);
   delay(500);
   Serial.println("BLACK");
   digitalWrite(13, LOW);
 }
 delay(5000);
}

Downloads

Object_sourting_robot Download
Comments
Ad