Document the group project and your individual contribution
Individual Contribution - Embedded Programming
Individually i was supposed to develop a program that integrates all the stuff like communication using bluotooth module and with hardware. Hence i started with testing servo motors, to do so i used examples from arduino ide by going to file>examples>servo, i tried both examples available in the ide.
Next it was the lcd test, to do so i had to map image one connections with image two as the lcd we used had different connections. First i leanred about what connections a normal lcd needs to operate as following.
Below shown are the pins of the lcd we used from its datasheet. I just simply mapped these pins with above commonly used lcd pins and made the all the connections, that was it.
After that i just added the last part of communication from Ali Raza, and finalized the program as following.
String data;
int barcode = 0; //variable to store data received
void setup() {
//Serial.begin(9600);
Serial1.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
pinMode(m1, OUTPUT);
pinMode(m2, OUTPUT);
pinMode(m3, OUTPUT);
pinMode(m4, OUTPUT);
pinMode(m5, OUTPUT);
pinMode(m6, OUTPUT);
lcd.print("hello, Welcome to FAB Lab Khairpur!");
lcd.setCursor(0, 1);
lcd.print("Maneged by Sukkur IBA Univeristy!");
}
//----------------------------start of the main program----------------------------
void loop() {
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(350);
}
if(Serial1.available()) { // If anything comes in Serial1 (pins 0 & 1)
lcd.clear();
data = Serial1.readString();
barcode = data.toInt();
Serial.println(barcode);
}
//------------------------------Lays-------------------------------
if(barcode == 120) {
Serial.println(barcode);
analogWrite(m1, 230);
delay(2000);
analogWrite(m1, 0);
delay(50);
barcode = 0;
lcd.clear();
lcd.print("You have chose Lays of Worth Rs.20");
lcd.setCursor(0, 1);
lcd.print("Thank you for Shopping With us. Good Day!");
}
//------------------------------Biscuits-------------------------------
else if(barcode == 220) {
//Serial.write(Serial1.read());
analogWrite(m2, 230);
delay(1500);
analogWrite(m2, 0);
delay(50);
barcode = 0;
lcd.clear();
lcd.print("You have chose Biscuits of Worth Rs.20");
lcd.setCursor(0, 1);
lcd.print("Thank you for Shopping With us. Good Day!");
}
//------------------------------Chocklets-------------------------------
else if(barcode == 320) {
analogWrite(m3, 230);
delay(1500);
analogWrite(m3, 0);
delay(50);
barcode = 0;
lcd.clear();
lcd.print("You have chose Galaxy of Worth Rs.30");
lcd.setCursor(0, 1);
lcd.print("Thank you for Shopping With us. Good Day!");
}
lc d.clear();
lcd.print ("You have chose KitKat of Worth Rs.20");
lcd.setCursor (0, 1);
lcd.print("Thank yo u for Shopping With us. Good Day!");
}
//------------------------------Chocklets-------------------------------
else if(barcode == 630){
analogWrite(m6, 230);
delay(1500);
analogWrite(m 6, 0);
delay(50);
barcode = 0;
lcd.clear();
lcd.print("You have chose Perk Chocklets of Worth Rs.30");
lcd.setCursor(0, 1);
lcd.print("Thank you for Shopping With us. Good Day!");
}
else{
analogWrite(m1, 0);
delay(500);
analogWrite(m2, 0);
delay(500);
analogWrite(m3, 0);
delay(500);
analogWrite(m4, 0);
delay(500);
analogWrite(m5, 0);
delay(500);
analogWrite(m6, 0);
delay(500);
lcd.clear();
//lcd.print("Sorry, Incorrect choise.");
//lcd.setCursor(0, 1);
//lcd.print("Please see the barcode menu if you need anything else. Thank you!");
}
//}
//----------------------------end of the main program----------------------------
}
Wireless and Mobile Application
In order to promote cashless payment in Pakistan we are adding e-payment feature in this vending machine. There are many problems regarding cash payment at food shops especialy in pakistan which are routinley observed and can be solved by adding this feature to made vending machine for example a user which does not have money in cash and wanted to buy an item, he may be in trouble to have that unless he find an atm machine near the shop. Furthermore if any user has cash which can not be changed by shopkeeper then he may be unable to buy that easily. Additionally, this machine could best be utilized in schools , colleges and universities where we have long lines of students with shortage of time awaiting to buy the snacks, candies and juices. So by installing this type of machine will not only reduce the tension of keeping change but also will save time and solve the issues of big lines waiting to buy single chocolate or ice cream. Now a days there is alot usage of smartphones in pakistan and it's increasing day by day so by taking that advantage we are using an especial type of application which shall be in user's cellphone that will read the barcode of specific item written outside of machine. For example If I need to buy the chocolate I will open the application and read that particular barcode of chocolate after that app will ask you to confirm the item you want to buy so if confirmed I will have my item. The method of transaction will be especial type of sim card issued by Jazz, a telecom operator available in pakistan. Initially the user has to credit his account in advance so that whenever he buy any item for example candy or chocolate he will be debited by that much amount and informed through a sms. In this machine we have weeded vinyl made barcodes which shall be scanned before purchasing any item. Vinyl made barcodes are shown in figure below.
Barcodes of items placed inside machine
Sticking barcodes
To see complete operation of mmachine you can follow this video, also you can visit this group documentation.
Future Work
Increased Capacity
Installment of machine at university cafeterias
Increased Security
Getting access from telecom operators
Click here to get all design files.. Happy Machining!