Components and supplies
LDR, 5 Mohm
Breadboard (generic)
LED (generic)
Jumper wires (generic)
Arduino UNO
Tactile Switch, Top Actuated
SG90 Micro-servo motor
Apps and platforms
Arduino IDE
Project description
Code
Coding
c_cpp
You can adjust the frequencies of ldr accordingly
1/* AN INDUSTRIAL OPERATIVE PROJECT OF QUALITY RECOGNITION OF PRODUCTS 2 Properties and main operative concepts:- 3 1) Uses the concept of reflection of light 4 2) The concepts is dark color reflects low and white reflects more 5 3) This programming and the levels of luminous intensity is specifically done for 'badam'. 6 4) The process of recognition is done in a closed chamber like PVC 7 -By Nikash & Yatin. */ 8#include<Servo.h> // specifies servo motor library 9Servo nikser; // naming servo motor as nikser 10void setup() { 11 pinMode(12, OUTPUT); // reflecting spectrum of light 'led' 12 pinMode(A0, INPUT); // input of ldr 13 Serial.begin(9600); 14 nikser.attach(9); // servo motor pin 15 pinMode(7, INPUT_PULLUP); // push button's output to start the recognition process 16 nikser.write(90); // setting up servo motor to its initial position 17} 18void loop() { 19 int command = digitalRead(7); // saves input of pushbutton in variable command to start the process 20 if (command == 0) { // condition when push button is pressed 21 digitalWrite(12, HIGH); // makes the spectrum light on 22 delay(1000); 23 int qualityrate = analogRead(A0); // reads the value of ldr 24 Serial.println(qualityrate); // prints the value(quality) in serial monitor 25 if (qualityrate < 30) { // if the ldr value is lower than 30, usually good badam reflects low 26 nikser.write(130); // servo moves the badam to left in 130degree which move the badam in a cup of 'good quality' 27 delay(1200); 28 nikser.write(90); // moves to the formal position 29 } 30 if (qualityrate > 30) { // if the ldr value is higher than 30, usually bad badam reflects high 31 nikser.write(50); // servo moves the badam to left in 50degree which move the badam in a cup of 'bad quality' 32 delay(1200); 33 nikser.write(90); //moves to the formal position 34 } 35 } 36} 37
Coding
c_cpp
You can adjust the frequencies of ldr accordingly
1/* AN INDUSTRIAL OPERATIVE PROJECT OF QUALITY RECOGNITION OF PRODUCTS 2 Properties and main operative concepts:- 3 1) Uses the concept of reflection of light 4 2) The concepts is dark color reflects low and white reflects more 5 3) This programming and the levels of luminous intensity is specifically done for 'badam'. 6 4) The process of recognition is done in a closed chamber like PVC 7 -By Nikash & Yatin. */ 8#include<Servo.h> // specifies servo motor library 9Servo nikser; // naming servo motor as nikser 10void setup() { 11 pinMode(12, OUTPUT); // reflecting spectrum of light 'led' 12 pinMode(A0, INPUT); // input of ldr 13 Serial.begin(9600); 14 nikser.attach(9); // servo motor pin 15 pinMode(7, INPUT_PULLUP); // push button's output to start the recognition process 16 nikser.write(90); // setting up servo motor to its initial position 17} 18void loop() { 19 int command = digitalRead(7); // saves input of pushbutton in variable command to start the process 20 if (command == 0) { // condition when push button is pressed 21 digitalWrite(12, HIGH); // makes the spectrum light on 22 delay(1000); 23 int qualityrate = analogRead(A0); // reads the value of ldr 24 Serial.println(qualityrate); // prints the value(quality) in serial monitor 25 if (qualityrate < 30) { // if the ldr value is lower than 30, usually good badam reflects low 26 nikser.write(130); // servo moves the badam to left in 130degree which move the badam in a cup of 'good quality' 27 delay(1200); 28 nikser.write(90); // moves to the formal position 29 } 30 if (qualityrate > 30) { // if the ldr value is higher than 30, usually bad badam reflects high 31 nikser.write(50); // servo moves the badam to left in 50degree which move the badam in a cup of 'bad quality' 32 delay(1200); 33 nikser.write(90); //moves to the formal position 34 } 35 } 36} 37
Downloadable files
Schematics
arrangement for wiring and testing area
Schematics
Comments
Only logged in users can leave comments