This is a very simple program which uses voice control (using System.Speech.Recognition) to turn light diode on/off (conected to Arduino board). In this example Command pattern is implemented. Program consists of 2 parts:
In order to use this application properly, one needs to have microcontroller which will handle the message sent through the port COM3. Easiest way to achieve this is by using Arduino. Your Arduino is set to use pin 13, and will get high or low voltage on that pin according to your given commands. It is suggested to use diode as a light emitter which will make changes in voltage visual. For more details about adjusting Arduino, look under the Installation. After setting up Arduino, you should upload code to it from above mentioned arduino files. Beside Arduino files you need to download exe files provided in winrar file, or to clone the application.
The Arduino setup is very basic, all you need is one Diode and connect its + side to the pin 13, and - to the Gnd (ground). You can pin Diode directly in the Arduino pins (13 and Gnd), or use the breadboard, such as shown on the images below. Next step is to upload the Arduino code to the board. If you don'd have Arduino IDE, you need to install it from this site. Main program is to be started by opening its exe file, or by starting its project through Visual studio and building it.
Run the program. Read the instructions provided in the console after starting the program. Use any of the commands mentioned in the instructions and Voice command list (see below). Depending on your command diode should Turn On/Off:
Turn On | Turn Off |
---|---|
![]() |
![]() |
Voice command list:
"Light On", "Lights On"
"Light Off", "Lights Off"
"Turn On", "Turn Light On", "Turn Lights On"
"Turn Off", "Turn Light Off", "Turn Lights Off"
"Exit", "Close"
These commands are self explanatory, therefore no further details about testing are provided.
Version 1.0.0. Due to the simplicity of the project no detailed versioning information is provided.
Miloš Vulikić
This is freeware, so feel free to share and use it.
Idea of making this program is to learn more about Command pattern, Accessing Arduino or external platforms through C#, and learning about Voice Recognition library.
- Extending Grammar list
- Extending Commands that can be executed
- Scaling Arduino project from very basic to basic/moderate/advanced level
- Creating GUI