Shop OBEX P1 Docs P2 Docs Learn Events
Speaking, Voice recognizing Home Automation System — Parallax Forums

Speaking, Voice recognizing Home Automation System

xanatosxanatos Posts: 1,120
edited 2011-10-09 14:24 in BASIC Stamp
Well, I finally put my project together. It understands whatever commands you set the Say-It module up to use, and speaks to you with various prompts, responses, etc., and, of course, it turns stuff on & off. The motivation for this was the number of times that we have gone to bed only to realize that the hoses were still on going up to the gardens, and I was wishing I had a Star-Trek style home automation system where I could say, "Computer... Outside Water Off" - and it would turn it off! Well, now I have the basic model. The PC Board making starts after the sockets for the V-Stamp arrive. This program nearly fills the entire stamp, I have about two words of space left - but it works like a charm. If there is sufficient interest, I could consider making it into a "completed project" once I can provide PC Board layouts, etc.

Here is a video of it responding to commands for time, temperature, day-of-week and turning "outside water" on and off: http://www.youtube.com/watch?v=CB62tH4OHE8

It also responds to (currently) 15 other commands such as "Outside Water On". "Outside Water Off", "Security Lighting On", "Security Lighting Off", etc. I included a photocell to sense light levels so it can ask me if I want a light on when I come home and it's dark, and other oddities like that... At this point, the base hardware and program are all set and everything works happily together, just needs adjusting as the system evolves.

It uses:

1 - BS2sx
1 - Say-It module
1 - V-Stamp (http://www.rcsys.com/)
1 - ADC0831
1 - DS1302 & crystal
1 - Photocell, any type that will work with RCTIME
2 - 74HC595 Shift Register to control 16 outputs
2 - ULN2308 Darlington drivers (or any transistor/optoisolator you like)
8 - Crydom D2440 (or whatever you like) Solid State Relays
Misc small resistors, caps, etc.

A few stills here as well as the above linked video. This was a lot of fun, and only took about three days worth of playing to put together and test. The hardest part was merging and de-duplicating code from the Say-It GUI with the code I developed for the rest of the system.

I love Basic Stamps!!!

Dave
1000 x 750 - 244K
1000 x 750 - 199K
1000 x 750 - 161K
1000 x 750 - 227K
1000 x 750 - 211K
«13

Comments

  • RiJoRiRiJoRi Posts: 157
    edited 2011-05-06 05:58
    Very interesting!
    Just out of curiosity, are you looking to go commercial with this? I know Home Automation is very hot right now, especially when integrated with security systems.

    --Rich
  • LeonLeon Posts: 7,620
    edited 2011-05-06 06:07
    Home automation has been the holy grail of microcontroller hobbyists for as long as they have been around!
  • xanatosxanatos Posts: 1,120
    edited 2011-05-06 10:00
    I run a small one-man show called Xanatronics where I design custom microcontroller applications for anyone who wants to write me a check... so I'm always interested in commercially viable projects! :-) Do you have anything in mind? This project has really been, for me personally, an attempt to replicate the functionality that was suggested on the old Star Trek: TNG series. I always loved the idea of just addressing the computer, telling it what you wanted it to do in plain language, and having it do it!

    I'm tweaking program code today to make some more space as I'd like to use the PINK servers I have hanging around to interface the system to the web so I can control stuff while I'm away through my iPod Touch or laptop, and I want to add some RF remote capabilities via XBee Pro XSCs to allow my wife to switch different hoses on/off while she works in the gardens. So I'm really going to see just how much control can be squeezed out of a single BS2sx before I have to go to a dual-stamp system. I'm really grateful for shift registers and bidirectional i/o on the stamp because I have used EVERY pin on the stamp, and yet I can control many, many things with those 74HC595s and 74HC195s to read back the status of stuff.

    I have already made a lot of changes to the code I uploaded yesterday... this is addictive beyond all reason! :-) New video: http://www.youtube.com/watch?v=CB62tH4OHE8

    Dave
  • graffixgraffix Posts: 389
    edited 2011-05-06 10:31
    Very nice project !!!
  • davejamesdavejames Posts: 4,047
    edited 2011-05-06 13:28
    Dave - very cool!

    May I suggest posting this in a blog? Then you could show us the "bits & pieces" without worrying about the requirements of the Completed Projects area.

    I'd love to see more about this.

    Regards,

    DJ

    ...wait a minute! You did all of that in just 3 days?!?!?!?!?!? I am such a SLUG!!!
  • xanatosxanatos Posts: 1,120
    edited 2011-05-06 14:08
    DJ, if it's any consolation, I actually bought the Say-It module over a year ago, I spent a total of about two hours glancing over it quickly, and it sat in my to-do drawer for that whole time after that! Same for the V-Stamp. I have far more parts and ideas than completed projects! Taking a break today to complete the wiring of some 100 watt solar panels I bought about 8 years ago and am just today getting around to installing! Feel better? :-)

    Dave
  • davejamesdavejames Posts: 4,047
    edited 2011-05-06 15:06
    ...why - yes I do! :smile:

    Thanks!
  • xanatosxanatos Posts: 1,120
    edited 2011-05-06 17:41
    Happy to help! :-) And... the solar panels are now powering my addition! (well, the solar-charged batteries and the inverter are at the moment dointg the work... but the next sunny day!!! )

    Dave
  • xanatosxanatos Posts: 1,120
    edited 2011-05-07 16:04
    Updating code - this is about 3 rev levels behind what I am working with, but I know this code is rock solid at this stage. Most functions are present, including the 74HC595 driver stuff, and much more efficient speech subroutine/EEPROM DATA lines - more function, less memory space!

    This version also speaks a command complete confirmation for the various tasks, such as "Command complete, water off."

    Still only occupying a single slot on the BS2sx. Working with external EEPROM and multiple slots next.

    I also hooked it to a good quality wireless stereo speaker system instead of the onboard speaker I've been using - voice quality even better, booms out quite clearly.

    Also adding a number of security functions including voice authorization required routines, and setting the time & date by voice routines.

    There are so many other things I should be doing now... :-)

    Dave
  • graffixgraffix Posts: 389
    edited 2011-05-08 08:51
    Your thoughts on parallaxs relay board for this project?I was thinking on their solid state relays for the lower control voltage.
  • xanatosxanatos Posts: 1,120
    edited 2011-05-08 13:15
    I would think that to be fine... I'm driving the 74HC595 with the stamp, and there are lines for that. I'm a "roll-your-own" kind of guy on this stuff, so I have already got an 8 position SS Relay panel built using 8 40 amp Crydom SS Relays to control the 20 amp circuits in my house, or whatever... I have 14 of them left over from a place I used to work that trashed a bunch of equipment with these in them... Glad they're finally getting some use.

    I looked at the schematic for the PRB and it's nice... My circuit & program would certainly work well with it.

    Dave
  • davejamesdavejames Posts: 4,047
    edited 2011-05-12 10:53
    xanatos wrote: »
    Happy to help! :-) And... the solar panels are now powering my addition! (well, the solar-charged batteries and the inverter are at the moment dointg the work... but the next sunny day!!! )

    Maybe via PM or another thread, but I'd like to know more about this.
  • xanatosxanatos Posts: 1,120
    edited 2011-05-14 18:02
    For those that are following this - just a quick update on where I'm at...

    I have redistributed the program into three slots. The main slot runs the Speech Recognition and most of the administrative functions of the program. Slot 1 runs the Speech Generation routines. Having this in its own slot gave me a HUGE amount more EEPROM in which to store canned phrases. Currently I have 40 in there and only use about 20... Slot 2 runs the output control. It is the smallest routine going - prints on a single page - but controls 32 output lines.

    Slot 0 listens for the Wake Up keyphrase "Computer", and after playing the sound effect with FREQOUT (reverse engineered from the actual Star Trek sound in mp3), listens for commands and sets various SCRAM locations, then handing control off to either slot 1 for speech-only responses, or slot 2 for relay wiggling, which then hands control to slot 1 for speaking responses related to the status of the relay and command completed messages, etc., then it returns control to slot 0 to keep listening.

    It works fantastically... video forthcoming.

    I will be at the MIT Technology Flea Market in Cambridge, MA tomorrow (Sunday, 5/15) getting some hardware for this project, and will be starting the PC Board design and fabrication this coming week. I hope to have this on a board by this time next week!

    Anyone else know about the MIT Flea? You would not BELIEVE the incredible electronics goodies and oddities you can get there. Every kind of part known to man, and several that seem to remain unknown to all - even the sellers! More info: http://www.mitflea.com/

    More soon!

    Dave
  • xanatosxanatos Posts: 1,120
    edited 2011-05-17 17:21
    Update: Valve received!

    I received my Asco 8210 Solenoid Valve today from Grainger. First - I was amazed at how fast I got it - I did not order overnight shipping, but I got it LESS THAN 24 HOURS from the time I ordered it!

    Anyway - four pictures attached showing the solenoid valve and the connections I am making for master shutoff and bypass.

    This is the item that will be operated by the "Outside Water On/Off" command. It runs on 24 VAC (options included 12vdc, 12vac, 24vac, 120vac...). It looks like a very high quality item, and the folks at my local water department (who just happened to spend the day in front of my house yesterday when the street water main ruptured!) say Asco valves are fantastic.

    The valve cost $136.00.

    The project is nearing completion!

    Dave
    1000 x 750 - 118K
    1000 x 750 - 209K
    1000 x 750 - 138K
    1000 x 750 - 175K
    v2.JPG 118.4K
    v4.JPG 208.7K
    v3.JPG 137.8K
    v1.JPG 174.9K
  • davejamesdavejames Posts: 4,047
    edited 2011-05-18 08:58
    ...just viewed the updated video - too cool!

    DJ
  • xanatosxanatos Posts: 1,120
    edited 2011-05-18 10:21
    Full Solenoid Valve Assembly with support plumbing, including manual bypass, manual shutoff and pulsation dampener/shock arrestor. Note the use of unions to allow everything to be soldered together without having to "lock" the solenoid in place - it can be swiveled and tightened when soldering installation is complete. Additional unions allow entire unit with all support hardware to be installed/removed as a unit (in case I ever want to relocate it). See the picture for details with labels. Pic BEFORE soldering... I solder clean, but not THIS clean! :-)

    Dave
    1024 x 768 - 240K
    v5.jpg 239.8K
  • xanatosxanatos Posts: 1,120
    edited 2011-05-21 17:06
    Cutting, polishing, soldering and cleaning 28 pipe connections was no easy task.... here is the finished product, ready for installation, posing between the low voltage and high voltage relay panels....

    More soon!

    v9.jpg
    v8.jpg
    1024 x 768 - 121K
    1024 x 768 - 184K
    1024 x 768 - 90K
    v10.jpg 120.6K
    v8.jpg 183.6K
    v9.jpg 89.7K
  • xanatosxanatos Posts: 1,120
    edited 2011-05-29 15:42
    Pressure tested and electrically tested the solenoid valve assembly section today - all good! No leaks and the valve works perfectly! Been busy doing work for which I actually get paid for the past week or so... hope to make some more progress shortly.
  • ercoerco Posts: 20,256
    edited 2011-05-29 18:06
    Great idea & execution! Those Asco Red Hat valves are pricey. Might there be a $15 sprinkler valve at Home Despot that you can use?
  • xanatosxanatos Posts: 1,120
    edited 2011-05-30 05:08
    Hi Erco,

    Actually I checked those out at my local Home Despot (thought I was the only one who called them that :-) ) but since this item is for actual installation in my interior home plumbing, I wanted something truly solid and reliable. When I do the exterior garden hose selector, I can use the sprinkler valves, but this master shutoff needed the Asco in order for me to feel it was a quality job :-)

    Pouring here today, so maybe I can get the PC Board exposed/etched today!
  • xanatosxanatos Posts: 1,120
    edited 2011-06-05 18:10
    Haven't been able to update this thread much since Wednesday evening when an F3 tornado virtually wiped my hometown of Monson, MA off the map... I'll post some pictures soon. I'm only a mile from the center of the worst damage. Next Basic Stamp project: Tornado detector!

    Dave
  • davejamesdavejames Posts: 4,047
    edited 2011-06-05 19:43
    ....OMG!

    You and yours ok?
  • xanatosxanatos Posts: 1,120
    edited 2011-06-08 09:25
    Taking a few moments from the cleanup/recovery efforts to share a few photos. My house was untouched, my daughter's house got her porch crushed and a big dent in her west roof, and most of the 30 trees in her yard are down... but we are all fine. Monson, as a town, has suffered catastrophic, permanent damage, with only 27% of the buildings in the town being assessed as habitable. Many historic buildings either came down already, or will need to soon. The tornado was officially an F3. My heart goes out to those of you who live in areas where you have this threat as a reality for several months every year... we never thought we'd see this here!

    More photos later, and hopefully soon, the automation system will finally get a PC board and get wired up, followed by videos.

    I hope this message finds you all well and safe out there!

    Dave
    960 x 720 - 332K
    960 x 720 - 297K
  • davejamesdavejames Posts: 4,047
    edited 2011-06-08 10:02
    ...thanks for the update Dave.

    At the moment, I have no words other than I'm very glad you and yours are safe.

    Dave
  • xanatosxanatos Posts: 1,120
    edited 2011-06-14 15:29
    OK... I have finally found the time to get the PC Board designed and completed. Pictures say it all.

    Items to note:

    The BS2sx is sandwiched UNDERNEATH the V-Stamp to conserve board space. The top of the components on the BS2sx clears the bottom of the components on the V-Stamp by 1mm!

    There is a long breakout header that allows access to most all pins on both the V and B stamps; but I have also included a small header specifically for the Say-It module to reside for local testing/demo.

    The output from this board are the three lines that drive the 74LS595 shift registers. That will be a separate board.

    The white 4-pin header immediately below the 5V regulator is the programming header (I rolled my own to conserve space - no need for big 9-pin D connectors...)

    More to follow soon. Tornado cleanup is running well, and ahead of schedule - mainly because we didn't rely on FEMA or MEMA and just did most everything ourselves, rather than waiting for the slow wheels of government to creak our way! :-) They mean well, but they just aren't as nimble as a small town with determination and spirit is!

    Dave
    1000 x 750 - 104K
    1000 x 750 - 80K
    1000 x 750 - 177K
    1000 x 750 - 176K
    1000 x 750 - 159K
    1000 x 750 - 191K
    1000 x 750 - 152K
    1000 x 750 - 211K
  • davejamesdavejames Posts: 4,047
    edited 2011-06-15 09:17
    ...very kleeeeeeeeeeeen!

    Did you layout & etch the board yourself?
  • xanatosxanatos Posts: 1,120
    edited 2011-06-15 10:20
    Created layout in photoshop... Haven't yet mastered DipTrace - or more specifically creating the non- standard items to go into DipTrace, like V and B stamps!

    Etched & drilled myself.... Fun. More later today.

    Thanks for the compliment!

    Dave
  • xanatosxanatos Posts: 1,120
    edited 2011-06-16 09:07
    Video of system on it's proper PC Board, and with the system acknowledgement tone functioning after the wake-up command.

    http://www.youtube.com/watch?v=_QjyA20mHbI&feature=youtube_gdata_player

    More soon,

    Dave
  • xanatosxanatos Posts: 1,120
    edited 2011-06-17 15:47
    PC Board layout - note that most discrete components (resistors, caps, etc) are surface mount and located on the foil-side of the board.

    Schematic soon...

    Dave
    1024 x 1051 - 123K
  • xanatosxanatos Posts: 1,120
    edited 2011-06-18 18:17
    Here's the code for the project so far. Three slots used on the BS2sx.

    I'm now setting up a new program for the SayIt modules. I'm amazed at the versatility of these things, even with their limitations (speaker dependent on the user-programmed commands; very susceptible to ambient noise - the TV is always "waking up" the module and occasionally turning something on...) but by the same token, it can be programmed to switch command banks via voice commands, and even to have two different users by programming it with the default "Wake Up" command and a second one in a different user's voice that switches to command banks programmed in that user's voice, but with identical command sets to the regular user's voice. My only wish for these would be a way to make the user programmed commands to be Speaker Independent.

    Anyway, here's the code as of a few days ago. Note that the initialization routine for the V-Stamp now makes the unit sound like Majel Barret (the voice of the computer system in Star Trek!) I'm such a geek...

    Dave
Sign In or Register to comment.