Mrehan Elshehawy
Published

Smart storage drawer

Make your storage drawer work with voice recognition.

BeginnerFull instructions provided6,168
Smart storage drawer

Things used in this project

Hardware components

3 mm LED: Red
3 mm LED: Red
You will need as many as your drawers. I made 9 drawers so I used 9 LEDs
×9
Jumper wires (generic)
Jumper wires (generic)
×1
Arduino UNO
Arduino UNO
×1
1Sheeld
1Sheeld
×1
resistor 150 0hm
×9
Ribbon cable
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

Thingiverse

http://www.thingiverse.com/thing:1239522.

Schematics

smart storage drawer schematics

Code

Smart storage drawer

Arduino
#define CUSTOM_SETTINGS
#define INCLUDE_VOICE_RECOGNIZER_SHIELD
#define INCLUDE_TERMINAL_SHIELD

#include <OneSheeld.h>

int i = 0;

/*defining the words that will be used*/
/*I named each drawer with the components on it */
const char w[] = "wires";
const char c[] = "capacitors";
const char s[] = "switches";
const char r[] = "resistor";
const char l[] = "led";
const char n[] = "connectors";
const char h[] = "heat sink";
const char f[] = "fuses";
const char a[] = "arduino";


/* defining the pins with the first three letters of each word*/
int wir = 5;
int cap = 6;
int swi = 7;
int res = 8;
int led = 9;
int con = 10;
int hea = 11;
int fus = 12;
int ard = 13;

void setup()
{
  OneSheeld.begin();
  VoiceRecognition.setOnError(error);
  VoiceRecognition.start();


  /*setting the pins that we will use to be output not input*/
  pinMode(wir, OUTPUT);
  pinMode(cap, OUTPUT);
  pinMode(swi, OUTPUT);
  pinMode(res, OUTPUT);
  pinMode(led, OUTPUT);
  pinMode(con, OUTPUT);
  pinMode(hea, OUTPUT);
  pinMode(fus, OUTPUT);
  pinMode(13, OUTPUT);

  /*setting the intial value of the pins*/
  digitalWrite(wir, LOW);
  digitalWrite(cap, LOW);
  digitalWrite(swi, LOW);
  digitalWrite(res, LOW);
  digitalWrite(led, LOW);
  digitalWrite(con, LOW);
  digitalWrite(hea, LOW);
  digitalWrite(fus, LOW);
  digitalWrite(13, LOW);
}

void loop ()
{
  if (VoiceRecognition.isNewCommandReceived())
  {
    if (!strcmp(w, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(wir, HIGH);
        delay(300);
        digitalWrite(wir, LOW);
        delay(300);
      }
    }
    else if (!strcmp(c, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(cap, HIGH);
        delay(300);
        digitalWrite(cap, LOW);
        delay(300);
      }
    }
    else if (!strcmp(s, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(swi, HIGH);
        delay(300);
        digitalWrite(swi, LOW);
        delay(300);
      }
    }
    else if (!strcmp(r, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(res, HIGH);
        delay(300);
        digitalWrite(res, LOW);
        delay(300);
      }
    }
    else if (!strcmp(l, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(led, HIGH);
        delay(300);
        digitalWrite(led, LOW);
        delay(300);
      }
    }
    else if (!strcmp(n, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(con, HIGH);
        delay(300);
        digitalWrite(con, LOW);
        delay(300);
      }
    }
    else if (!strcmp(h, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(hea, HIGH);
        delay(300);
        digitalWrite(hea, LOW);
        delay(300);
      }
    }
    else if (!strcmp(f, VoiceRecognition.getLastCommand()))
    {
      for (i = 0; i < 4; i++) {
        digitalWrite(fus, HIGH);
        delay(300);
        digitalWrite(fus, LOW);
        delay(300);
      }
    }
    else if (!strcmp(a, VoiceRecognition.getLastCommand()))
    {
      Terminal.println("Arduino");
      for (i = 0; i < 4; i++) {
        digitalWrite(ard, HIGH);
        delay(300);
        digitalWrite(ard, LOW);
        delay(300);
      }
    }
  }
}

void error(byte errorData)
{
  switch (errorData)
  {
    case NETWORK_TIMEOUT_ERROR:
      Terminal.println("Network timeout");
      break;
    case NETWORK_ERROR:
      Terminal.println("Network Error");
      break;
    case AUDIO_ERROR:
      Terminal.println("Audio error");
      break;
    case SERVER_ERROR:
      Terminal.println("No Server");
      break;
    case SPEECH_TIMEOUT_ERROR:
      Terminal.println("Speech timeout");
      break;
    case NO_MATCH_ERROR:
      Terminal.println("No match");
      break;
    case RECOGNIZER_BUSY_ERROR:
      Terminal.println("Busy");
      break;
  }
}

Credits

Mrehan Elshehawy

Mrehan Elshehawy

1 project • 3 followers
A girl who is in love with Robotics and leds

Comments