element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Enchanted Objects
  • Challenges & Projects
  • Design Challenges
  • Enchanted Objects
  • More
  • Cancel
Enchanted Objects
Blog Enchanted Objects - Enchanted Clock #8 (Chrystals Update)
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dwinhold
  • Date Created: 17 Jun 2015 3:36 AM Date Created
  • Views 749 views
  • Likes 3 likes
  • Comments 4 comments
  • enchanted_objects
  • enchanted_clock
Related
Recommended

Enchanted Objects - Enchanted Clock #8 (Chrystals Update)

dwinhold
dwinhold
17 Jun 2015

Hi everyone, it is Chrystal with the update.

 

First of all, my Dad told me that the temperature will be voice controlled, AFTER I GOT IT WORKING!!! So I spent all day today (after school) and added it into the voice program, haha to him, it works. He has no idea yet as he is working on the wooden clock. Below is the Arduino script that is used for the whole voice control, my part is in red so it stands out. I drew a quick picture of how it works, I couldn't get a picture without him finding out... I will tell him after this is posted.

 

#include <SoftwareSerial.h>
#include "VoiceRecognitionV3.h"


VR myVR(2,3); 

uint8_t records[7];
uint8_t buf[64];

int led = 13;
int Hotter = 8;
int Colder = 9;

#define Light (0)
#define Dark (1)
#define Hot (2)
#define Cold (3)
#define Sleep (4)
#define Timer (5)
#define Stop (6)


void printSignature(uint8_t *buf, int len)
{
  int i;
  for(i=0; i<len; i++){
    if(buf[i]>0x19 && buf[i]<0x7F){
      Serial.write(buf[i]);
    }
    else{
      Serial.print("[");
      Serial.print(buf[i], HEX);
      Serial.print("]");
    }
  }
}


*/
void printVR(uint8_t *buf)
{
  Serial.println("VR Index\tGroup\tRecordNum\tSignature");

  Serial.print(buf[2], DEC);
  Serial.print("\t\t");

  if(buf[0] == 0xFF){
    Serial.print("NONE");
  }
  else if(buf[0]&0x80){
    Serial.print("UG ");
    Serial.print(buf[0]&(~0x80), DEC);
  }
  else{
    Serial.print("SG ");
    Serial.print(buf[0], DEC);
  }
  Serial.print("\t");

  Serial.print(buf[1], DEC);
  Serial.print("\t\t");
  if(buf[3]>0){
    printSignature(buf+4, buf[3]);
  }
  else{
    Serial.print("NONE");
  }
  Serial.println("\r\n");
}

void setup()
{

  myVR.begin(9600);
 
  Serial.begin(115200);
  Serial.println("Elechouse Voice Recognition V3 Module\r\nControl Clock");
 
  pinMode(led, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
   
  if(myVR.clear() == 0){
    Serial.println("Recognizer cleared.");
  }else{
    Serial.println("Not find VoiceRecognitionModule.");
    Serial.println("Please check connection and restart Arduino.");
    while(1);
  }
 
    if(myVR.load((uint8_t)Light) >= 0)
      {
        Serial.println("Light loaded");
      }
 
    if(myVR.load((uint8_t)Dark) >= 0)
      {
        Serial.println("Dark loaded");
      }
     
    if(myVR.load((uint8_t)Hot) >= 0)
      {
         Serial.println("Hot loaded");
      }
 
    if(myVR.load((uint8_t)Cold) >= 0)
      {
        Serial.println("Cold loaded");
     
     
    if(myVR.load((uint8_t)Sleep) >= 0)
      {
      Serial.println("Sleep loaded");
      }
 
    if(myVR.load((uint8_t)Timer) >= 0)
      {
        Serial.println("Timer loaded");
      }
     
    if(myVR.load((uint8_t)Stop) >= 0)
      {
        Serial.println("Stop loaded");
      }

}

 

void loop()
{
  int ret;
  ret = myVR.recognize(buf, 50);
  if(ret>0){
    switch(buf[1]){
      case Light:
        /** turn on LED */
        digitalWrite(7, LOW);
        digitalWrite(led, HIGH);
        break;
       
      case Dark:
        /** turn off LED*/
        digitalWrite(led, LOW);
        digitalWrite(7, LOW);
        break;
       
      case Hot:
        /** turn up temperature */
          digitalWrite(Hotter, HIGH);
          delay(1000);
          digitalWrite(Hotter, LOW);
        break;
       
      case Cold:
        /** turn down temperature*/       
          digitalWrite(Colder, HIGH);
          delay(1000);
          digitalWrite(Colder, LOW);       
        break;

 

     case Sleep:
        /** turn down lights */
        digitalWrite(led, LOW);
        digitalWrite(7, HIGH);
        break;
      case Timer:
        /** set 5 minute timer*/
        /** To be determined*/
        break;
      case Stop:
        /** Stop all*/
        digitalWrite(led, LOW);
        digitalWrite(7, LOW);
       
        break;   
      default:
        Serial.println("Record function undefined");
        break;
    }

    printVR(buf);
  }
}

 

As you can see I kind of copied what Dad was doing but I got it to work on my own!!

 

image

 

So how this works is when you say "Hot" the motor turns clockwise a bit upping the temperature (I need to calibrate this) and when you say "Cold" the motor turns counter clockwise and turns the temperature down. I feel this was a bit simple for what could have been thought up to use, but it works. I also added 2 LED lights, 1 red and 1 green/blue. The red light turns on (Briefly) when the temperature is raised and the green/blue turns on (Briefly) when the temperature is lowered. This is a visual way to know the command was recognised.

 

Thank you for reading,

 

Chrystal Winhold image

 

P.S. My picture is better then my Dad's!!!

  • Sign in to reply

Top Comments

  • Workshopshed
    Workshopshed over 10 years ago +1
    You might like these www.youtube.com/watch
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to Workshopshed

    I liked it very much !!!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago

    You might like these

     

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago

    Good and systematic approach !

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 10 years ago

    Great stuff

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube