Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
Hand tools and fabrication machines | ||||||
| ||||||
|
We came up with the idea during our last internship in collaboration with Udoo . A group of IT students from our school had previously created the project for this machine: They developed a voice a voice recognition system that delivers the desired product by pronouncing the name, for example chocolate, coffee, etc.
The voice control was very unreliable and we decided to add a different mode of selection for the final use. We put one big touchscreen display controlled by Udoo board on the front of the machine; also, we decided to control the whole machine at the μcontroller.
<_e_0uYN>
<_e_0uYN>
This simple diagram explains the operation of the pods distributor.
1. Wafer loading: the pod falls into the Thompson.
2. Servo ON: the servo-motor (piloted by Udoo) rotates 180°
3. Wafer release: the pod falls down the Thompson and, with a ramp, the pod reaches the user.
<_e_0uYN><_e_0uYN>
<_e_0uYN>Stay tuned for more!
#include "variant.h"
#include <stdio.h>
#include <adk.h>
// pompe
int pompa1 = 8;
int pompa2 = 9;
//motori
int motoreLatte = 5;
int motoreMixer = 4;
int motoreCacao = 3;
//elettrovalvole
int elettrovalvolaBianca = 6;
int elettrovalvolaNera = 7;
char descriptionName[] = "ArduinoADK_2"; // Accessory descriptor. It's how Arduino identifies itself to Android.
char modelName[] = "UDOO_ADK"; // your Arduino Accessory name (Need to be the same defined in the Android App)
char manufacturerName[] = "Aidilab"; // manufacturer (Need to be the same defined in the Android App)
// Make up anything you want for these
char versionNumber[] = "1.0"; // version (Need to be the same defined in the Android App)
char serialNumber[] = "1";
char url[] = "http://www.udoo.org"; // If there isn't any compatible app installed, Android suggest to visit this url
USBHost Usb;
ADK adk(&Usb, manufacturerName, modelName, descriptionName, versionNumber, url, serialNumber);
#define RCVSIZE 128
uint8_t buf[RCVSIZE];
uint32_t bytesRead = 0;
void setup()
{
Serial.begin(115200);
//motori
pinMode(motoreLatte,OUTPUT);
pinMode(motoreMixer,OUTPUT);
pinMode(motoreCacao,OUTPUT);
//pompe
pinMode(pompa1,OUTPUT);
pinMode(pompa2,OUTPUT);
//elettrovalvole
pinMode(elettrovalvolaBianca,OUTPUT);
pinMode(elettrovalvolaNera,OUTPUT);
delay(500);
Serial.println("UDOO ADK demo start...");
}
void loop()
{
// preparazione scheda relè e motori
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,HIGH);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
digitalWrite(motoreLatte,HIGH);
digitalWrite(motoreCacao,HIGH);
digitalWrite(motoreMixer,HIGH);
// inizio programma
Usb.Task();
if (adk.isReady()) {
adk.read(&bytesRead, RCVSIZE, buf);// read data into buf variable
if (bytesRead > 0) {
switch(parseCommand(buf[0])){
case 1: // CAFFE
//controllo elettrovalvole
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,HIGH);
//controllo pompe
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(20000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
break;
case 2: // CAFFE_LUNGO
//controllo elettrovalvole
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,HIGH);
//controllo pompe
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(30000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
break;
case 3: // CAPPUCCINO
//controllo elettrovalvole per parte di caffè
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,HIGH);
//controllo pompe per parte di caffè
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(20000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//controllo elettrovalvola per parte di latte
digitalWrite(elettrovalvolaNera,LOW);
digitalWrite(elettrovalvolaBianca,HIGH);
//accenzione motori per parte di latte
digitalWrite(motoreLatte,LOW);
//delay(2000);
digitalWrite(motoreMixer,LOW);
//controllo pompa per parte di latte
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(5000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spegnimento motori per parte di latte
digitalWrite(motoreLatte,HIGH);
digitalWrite(motoreMixer,HIGH);
break;
case 4: // LATTE
//controllo elettrovalvole
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,LOW);
//accenzione motori
digitalWrite(motoreLatte,LOW);
digitalWrite(motoreMixer,LOW);
//controllo pompe
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(5000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spegnimento motori per parte di latte
digitalWrite(motoreLatte,HIGH);
digitalWrite(motoreMixer,HIGH);
break;
case 5: // CIOCCOLATO
//controllo elettrovalvole
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,LOW);
//accenzione motori
digitalWrite(motoreCacao,LOW);
delay(2000);
digitalWrite(motoreMixer,LOW);
//controllo pompe
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(5000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spegnimento motori per parte di latte
digitalWrite(motoreCacao,HIGH);
digitalWrite(motoreMixer,HIGH);
break;
case 6: // CIOCCOLATO_LATTE
//controllo elettrovalvole
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,LOW);
//accenzione motori parte cacao
digitalWrite(motoreCacao,LOW);
delay(2000);
digitalWrite(motoreMixer,LOW);
//controllo pompe parte cacao
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(4000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spengimento motore parte cacao
digitalWrite(motoreCacao, HIGH);
//accenzioine motore parte latte
digitalWrite(motoreLatte,LOW);
delay(2000);
//controllo pompe parte latte
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(5000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spegnimento motori per parte di latte
digitalWrite(motoreLatte,HIGH);
digitalWrite(motoreMixer,HIGH);
break;
case 7: // MOCACCINO
//controllo elettrovalvole parte caffè
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,HIGH);
//controllo pompe parte caffè
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(20000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//controllo elettrovalvole parte latte e cacao
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,LOW);
//accenzione motori parte cacao
digitalWrite(motoreCacao,LOW);
delay(2000);
digitalWrite(motoreMixer,LOW);
//controllo pompe parte cacao
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(4000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spengimento motore parte cacao
digitalWrite(motoreCacao, HIGH);
//accenzioine motore parte latte
digitalWrite(motoreLatte,LOW);
delay(2000);
//controllo pompe parte latte
digitalWrite(pompa1,LOW);
digitalWrite(pompa2,LOW);
delay(5000);
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spegnimento motori per parte di latte
digitalWrite(motoreLatte,HIGH);
digitalWrite(motoreMixer,HIGH);
break;
default:
break;
}
}
} else {
//controllo elettrovalvole
digitalWrite(elettrovalvolaBianca,HIGH);
digitalWrite(elettrovalvolaNera,HIGH);
//controllo pompe
digitalWrite(pompa1,HIGH);
digitalWrite(pompa2,HIGH);
//spegnimento motori
digitalWrite(motoreLatte,HIGH);
digitalWrite(motoreCacao,HIGH);
digitalWrite(motoreMixer,HIGH);
}
delay(10);
}
// the characters sent to Arduino are interpreted as ASCII, we decrease 48 to return to ASCII range.
uint8_t parseCommand(uint8_t received) {
return received - 48;
}
Comments