Author Topic: Voice control and Arduino  (Read 9158 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Voice control and Arduino
« on: October 07, 2013, 05:59:33 PM »
I am thinking about getting my feet wet with Arduino.  It seems like there is ample opportunity to have fun with this and no doubt there will be cool ways to use it with VoxCommando.

http://www.arduino.cc/

I am a bit overwhelmed by all the options and different versions of Arduino boards and accessories available out there and was wondering if there was anyone around here that has some first hand experience with the platform.

It seems that the basic arduino itself is not really enough to get started.  So finding a good starter kit is one option.

I am also curious about the Arduino Yun.  This looks like it can function as a regular arduino but also has support for linux, and ethernet and wifi and has more memory.  Seems this could open up the options quite a bit. Or would this be overkill or make starting out too difficult for a newbie?  http://arduino.cc/en/Main/ArduinoBoardYun

I would also like to know what I would need to purchase / do in order to be able to control

- A light switch (on off)
- A light switch (dim)  Is this possible?
- Any old device that can be plugged into a power outlet (on off).

Thoughts anyone?  I realise there are many other places I could post where I would be SURE to find an arduino user, but I was hoping to start out in my comfort zone, with people I trust a bit more... :)

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: Voice control and Arduino
« Reply #1 on: October 08, 2013, 04:12:46 PM »
Hey James, I have some experience with Arduino, but not very much.
I started with the Arduinio Uno because it is cheap. But I guess you can start with any board you want. Personally I would choose a board with an USB-Port.

To get started you definitely should buy a breadboard! I think some LEDs, sensors (for example light or motion), resistors and eventually transistors should be enough to play around.

1. I suppose you don't mean a light that is powered by the arduino or another low voltage supplier? 110V? or 220V? If so, I think you need a relais.

2. Should be possible. the analog outputs can supply 0V to 5V, so you could use this voltge to control the voltage. but i don't know what you need to do this.

3. Should not be any difference to an light switch, as long as you have high voltage. if you have low voltage, it could work with an transistor.

But what do you think are the advantages of the control with an arduino over normal rf/ir sockets/switches? How do you plan to communicate between your pc/vc and arduino?
I plan to do it the other way round and use the arduino with some sensors to trigger events in eventghost...

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #2 on: October 08, 2013, 04:32:57 PM »
Hi Dave,

Thanks for your feedback.

I'm not sure about advantages.  I just wanted to mess around with it a bit to see what was possible.  I don't know how I will communicate between VC and the arduino.  It is one of the things I want to find out.  I assume I can send signals to the arduino via the usb cable somehow?   If I can make things on the pc happen based on events (arduino sensors) or turn an led on to show what mode VC is in (red led, green led, yellow led) or whatever I'll be pleased.

If I can also find a way to control a light switch without spending too much money, I'll do it.  Mostly this is just to see what is possible.  Maybe it could open up some inexpensive home automation options.  Z-Wave is great but costs about $70 every time I want to add a new switch.  Also, there are some places where I tried to put a zwave switch and it would not fit because it was too big.  If I just need to put a relay in there and can figure out the wiring, maybe that will work.

One advantage I could imagine with arduino for controlling leds is that I think it would be faster than an RF switch.  Maybe I could get it to do some cool cylon effect or make fancy Christmas light displays.

Mostly the idea is to learn how it works and hopefully have some fun, and maybe open up some new options for myself and other VC users.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Voice control and Arduino
« Reply #3 on: October 09, 2013, 06:59:24 AM »
Hey James, this video lessons looks pretty good for beginners

http://www.youtube.com/watch?v=cC_IuczAWFw&list=PL1F04356F38260E79

but I'm sure you've found some similar things  ;)
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #4 on: October 09, 2013, 01:55:16 PM »
Yes.  I think those videos are a very good starting point!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #5 on: October 09, 2013, 03:50:08 PM »
This also seems like an excellent series, and I think maybe I like them better.  The 6th one specifically shows how to communicate sending messages from pc to arduino and back again using serial.  Looks relatively easy! :D

&index=1
« Last Edit: October 09, 2013, 04:11:10 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #6 on: October 18, 2013, 07:25:17 PM »
So far so good!

gOIGQ

I have also figured out how to tell VC the temperature and the current light levels, but trying to do many things at once on the Arduino is a bit of a challenge!

I'm still not sure if it is worth the effort using arduino to control lights running on 120 Volts.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Voice control and Arduino
« Reply #7 on: October 18, 2013, 08:33:34 PM »
Wow, big steps forward. Is there anything to solder on the Arduiono (wires, LED's)?
I think it is possible to trigger a relay which is connected to lights.
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #8 on: October 18, 2013, 09:59:19 PM »
No.  No soldering yet.  Everything is just plugged into the arduino or the breadboard directly with pins or wires.

I have used some posts and an IDE ribbon cable so that I can move the LCD display away from the board if I want when trying to mount it in the HTPC "cabinet".

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #9 on: October 18, 2013, 10:23:58 PM »
Here is the "sketch".  Which is the code used to program the Arduino.

It still needs a lot of work.

Code: [Select]
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

String data="";
const int lf = 10;
const int green = 13;
const int yellow = 7;
const int red = 8;
String artist="";
String song="";

void setup() {
  pinMode(green,OUTPUT);
  pinMode(yellow,OUTPUT);
  pinMode(red,OUTPUT);
  // set up the number of columns and rows on the LCD
  lcd.begin(16, 2);
  Serial.begin(9600);
  data.reserve(80);
 
  lcd.print("Waiting for...");
  // set the cursor to column 0, line 1
  // line 1 is the second row, since counting begins with 0
  lcd.setCursor(0, 1);
  // print to the second line
  lcd.print("serial input");
 
}

void loop() {
 
   
 
  delay(250);
  }

void serialEvent() {
  data="";
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // add it to the data:

    if (inChar == (char)10)
    {break;}
    data += inChar;
  }
  if (data=="Mode: On")
  {
    digitalWrite(green,HIGH);
    digitalWrite(yellow,LOW);
    digitalWrite(red,LOW);
  }
  else if (data=="Mode: Standby")
  {
    digitalWrite(green,LOW);
    digitalWrite(yellow,HIGH);
    digitalWrite(red,LOW);
   }
   else if (data=="Mode: Off")
   {
     digitalWrite(green,LOW);
     digitalWrite(yellow,LOW);
     digitalWrite(red,HIGH);
   }
   else if (data.startsWith ("artist:"))
   {
     artist = data.substring(7);
     lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(song);
    lcd.setCursor(0, 1);
    lcd.print("A: "+artist);
   }
   else if (data.startsWith ("song:"))
   {
     song = data.substring(5);
     lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(song);
    lcd.setCursor(0, 1);
    lcd.print("A: "+artist);
  }
  else
  {
    lcd.clear();
    lcd.print(data);
  }
  data="";
}

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #10 on: October 19, 2013, 10:29:28 PM »
The next phase.



I will be auctioning off the paper plate later on in the evening...

Vangelis

  • $upporter
  • Jr. Member
  • *****
  • Posts: 34
  • Karma: 0
    • View Profile
Re: Voice control and Arduino
« Reply #11 on: October 21, 2013, 07:21:42 AM »
..maybe for a further revision you could use an LCD Display with RGB backlight and have this as the VC status?

Vangelis

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Voice control and Arduino
« Reply #12 on: October 21, 2013, 10:17:33 AM »
Yes, that would be cool.  At the moment I am trying to see what I can do with the parts that came in my starter set though.