Things used in this project

Hardware components:
S975 g000 2100 c2 3
UDOO QUAD
brain of dooUcoffee
×1
Udoo vk 7t 1 1
UDOO 7" Touch LCD for UDOO NEO, DUAL and QUAD
×1
Software apps and online services:
Logo things yummo7uv2y
Google Developers Android Things
Hand tools and fabrication machines:
Lasercutter
Laser cutter (generic)
3drag
3D Printer (generic)

Schematics

Operating Summary
DooUcoffee basic operating
Schema a blocchi1 mbchhdtp3j
Thompson Wafer dispenser
This simple diagram explains the operation of the distributor waffles,
Thompson dyagram aqutxfdmp8
Motor Board
board to control the milk and chocolate despenser engines
Controllo motori xbdchxmusq
Relays Board
board to control the relays for the mechanical organs
Scheda rele wosegbvghx

Code

Demo!C/C++
udoo demo code for Dooucoffee
#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;
}

Credits

Dd317d98 2d48 42fd b068 26bfc63a32df qdyv4tzbn6
Roberto Galletti

Roberto 2oyears Students, Elettronics e Robotics at Sarrocchi in Siena :)

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Home Automation Control Panel
Advanced
  • 11,256
  • 55

Work in progress

A touchscreen control panel for home IOT devices. Arduino, Raspberry Pi, RFM69, mqtt and more.

DroniXcar
Advanced
  • 4,332
  • 30

Work in progress

RC car powered by UDOO and Android. With this project we won the Droidcon IT 2015 Hackaton.

DroniXcar

Team Dronix - Alter Ego

UDOO-RC-CAR
Advanced
  • 2,601
  • 20

Full instructions

Xbox Controller Controlled RC-car

SFAC
Advanced
  • 318
  • 4

Work in progress

A Smart T-shirt designed for athlete and bikers.

Knock Knock Who? Exactly
Advanced
  • 2,535
  • 20

Full instructions

Real-time background analysis of the person at your door.

Geduino
Advanced
  • 698
  • 9

Work in progress

Geduino is an open source platform designed for Autonomous Robot application.

Add projectSign up / Login
Respect project