Skip navigation
2012

In this project I use BitVoicer’s speech recognition features (http://www.bitsophia.com/BitVoicer.aspx), one Arduino board and one electret microphone (https://www.sparkfun.com/products/9964) to control a few LEDs.

 

The following fritzing schematic shows how I wired my Arduino board:

 

BitVoicerTest2_Fritz_800x600.jpg

 

I’m also adding a few pictures and a YouTube video of the project running.

 

 

BitVoicerTest2_1_800x600.jpg

 

BitVoicerTest2_2_800x600.jpg

Unfortunately, the sketch I wrote for my first post is no longer supported by the new version of BitVoicer. Here is the new sketch:

 

#include <BitVoicer11.h>


//Instantiates the BitVoicerSerial class
BitVoicerSerial bvSerial = BitVoicerSerial();


//Stores true if the Audio Streaming Calibration tool
//is running
boolean sampleTest = false;
//Stores the data type retrieved by getData()
byte dataType = 0;
//Sets up the pins and default variables
int pinR = 3;
int pinY = 5;
int pinG = 6;
int lightLevel = 0;


void setup()
{
  //Sets the analog reference to external (AREF pin)
  //WARNING!!! If anything is conected to the AREF pin,
  //this function MUST be called first. Otherwise, it will
  //damage the board.
  bvSerial.setAnalogReference(BV_EXTERNAL);
  //Sets up the microcontroller to perform faster analog reads
  //on the specified pin
  bvSerial.setAudioInput(0);
  //Starts serial communication at 115200 bps
  Serial.begin(115200);
  //Sets up the pinModes
  pinMode(pinR, OUTPUT);
  pinMode(pinY, OUTPUT);
  pinMode(pinG, OUTPUT);
}


void loop()
{
  //Captures audio and sends it to BitVoicer if the Audio
  //Streaming Calibration Tool is running
  if (sampleTest == true)
  {
    //The value passed to the function is the time
    //(in microseconds) that the function has to wait before
    //performing the reading. It is used to achieve about
    //8000 readings per second.
    bvSerial.processAudio(46);
  }

  //Captures audio and sends it to BitVoicer if the Speech
  //Recognition Engine is running
  if (bvSerial.engineRunning)
  {
    //The value passed to the function is the time
    //(in microseconds) that the function has to wait before
    //performing the reading. It is used to achieve about
    //8000 readings per second.
    bvSerial.processAudio(46);
  }
}


//This function runs every time serial data is available
//in the serial buffer after a loop
void serialEvent()
{
  //Reads the serial buffer and stores the received data type
  dataType = bvSerial.getData();

  //Changes the value of sampleTest if the received data was
  //the start/stop sampling command
  if (dataType == BV_COMMAND)
      sampleTest = bvSerial.cmdData;

  //Signals BitVoicer's Speech Recognition Engine to start
  //listening to audio streams after the engineRunning status
  //was received
  if (dataType == BV_STATUS && bvSerial.engineRunning == true)
    bvSerial.startStopListening();

  //Checks if the data type is the same as the one in the
  //Voice Schema
  if (dataType == BV_STR)
    setLEDs();
}


//Performs the LED changes according to the value in
//bvSerial.strData
void setLEDs()
{
  if (bvSerial.strData == "wake")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "sleep")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    delay(200);
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    delay(200);
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "RH")
  {
    digitalWrite(pinR, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "RL")
  {
    digitalWrite(pinR, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "YH")
  {
    digitalWrite(pinY, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "YL")
  {
    digitalWrite(pinY, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "GH")
  {
    digitalWrite(pinG, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "GL")
  {
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "ALLON")
  {
    digitalWrite(pinR, HIGH);
    digitalWrite(pinY, HIGH);
    digitalWrite(pinG, HIGH);
    lightLevel = 255;
  }
  else if (bvSerial.strData == "ALLOFF")
  {
    digitalWrite(pinR, LOW);
    digitalWrite(pinY, LOW);
    digitalWrite(pinG, LOW);
    lightLevel = 0;
  }
  else if (bvSerial.strData == "brighter")
  {
    if (lightLevel < 255)
    {
      lightLevel += 85;
      analogWrite(pinR, lightLevel);
      analogWrite(pinY, lightLevel);
      analogWrite(pinG, lightLevel);
    }
  }
  else if (bvSerial.strData == "darker")
  {
    if (lightLevel > 0)
    {
      lightLevel -= 85;
      analogWrite(pinR, lightLevel);
      analogWrite(pinY, lightLevel);
      analogWrite(pinG, lightLevel);
    }
  }
  else
  {
    bvSerial.startStopListening();
    bvSerial.sendToBV("ERROR:" + bvSerial.strData);
    bvSerial.startStopListening();
  }
}

 

The BitVoicer Voice Schema I used can be downloaded from: http://www.justbuss.xpg.com.br/BitVoicerTest2.zip (you need to have BitVoicer installed to be able open it).

 

 

Now I want to control a few things (lights and ceiling fan) at home. Suggestions on how to connect them to the Arduino are very welcome.

Dear fellows,

 

I want to share with you some info about a neat steeper driver board we designed, for driving two or four stepper motors (by stacking two boards) using Arduino UNO (& friends). This neat shield can be used for making pan and tilt mechanisms for cameras, small CNCs, 3D printers you name it.

This shield has a free downloadable example software (INO) and a video to demonstrate some of the capabilities. The driver chip used is L6470 from ST Microelectronics, a complex motion controller and microstepping driver, which may be a little bit discouraging, but after understanding how it works, and with the help of software examples it all starts to make sense. Schematics and a datasheet are availble also for download

Please watch the video, feel free to ask questions and leave feedback (I apologize for the bad sound, it was raining....)

 

 


And the most important ....Have fun!
Aurash

This shield can be sourced from amazon.co.uk or from altelectronics.co.uk - for 42 Eur (~ 35 Pounds Sterling)

L6470_dual_motor.jpg

Happy, prototyping

Aurash

Dear fellows,

 

We are proud to present a shield that we make, mainly for receiving FSK (and OOK) signals from sensors but not only. The shield comes with a duck antenna and demo examples. 

 

FSK signals at 433MHz are very commonly used by consumer electronics devices including weather stations, power consumption meters, security systems, and home automation controllers.
The RF transceiver used is RF12 from Hope Electronics, this means that the shield is using SPI.
The advantages of SPI are that it runs at a higher data rate, and it has separate input and output connections, so it can send and receive at the same time. It uses one additional line per device to select the active device, so more connections are required if you have many devices to connect. Most Arduino projects use SPI devices for high data rate applications such as Ethernet and memory cards, with just a single device attached.
Arduino releases (from release 0019) include a library that allows communication with SPI devices.

Manufacturer: Altelectronics
Manufacturer Part No: ARD-RF433-SHL

rf12_shield_front_big.pngRF_Shield.JPG

Schematics, and software libs are availble for download from out website
Please feel free to ask questions or give feeback if you wish,
Have Fun,
Aurash

Filter Blog

By date: By tag: