
Voice Control Of Electronic Device
As I have been on furlough this is a learning exercise as to how to control a device via a web page.#
Voice control is a common requirement for many – and many commercial devices are now available via Alexa or other such service – and these work well on web pages – can they be used somehow?
Any kind of microprocessor or embedded controller needs some kind of user input, such as “up” “down” or “on” off” for certain functions, a web site, when hosted by the device, would be accessible on any web browser on any device. A web page also allows for data reporting (position of an encoder, temperature or other sensor output) and data entry (position to move to, set point for a heater and so on).
This project shows how it is possible to operate a device via a web page on a web browser, in this case 2 LED’s. We also demonstrate that it is possible to use the web page by voice – which then makes the embedded device voice controlled. This is free and open for anyone to try, please contact me if you have a project in mind and need some advice.
I have investigated how to host a webserver on an embedded device in order to operate devices connected to it.
Any web enabled computer (Android, Windows, Apple etc) would be able to access the site and operate the devices so connected.
As a bonus many web sites offer assistive access, including voice control, and I wished to see if I could access and then operate devices by voice alone. The micro computer tested is shown in the picture with the yellow network connection. A wireless connection would work the same way.
The solution
Many programmable devices from platforms such as Arduino or MBED, have network connection options (via wired or wireless) and can be coded to host a webserver. Many devices come with template programs for this.
Once you are connected it is possible to post a page to any web browser. The page is coded in HTML, a script based language, which is possible to save and manage using micro code. The HTML script,once sent to the browser, sets up buttons for the user. An example web site is shown in the main image and the script that makes the web page is shown below. The web page itself will open on any web browser on a phone or other device. Buttons can be made larger and so on, and other controls can be added, such as sliders, data output and data entry. These might show sensor information, or allow the user to enter set points, such a position, speed, temperature and so on.
In addition, if you install the extension “Handsfree for web” in Google Chrome (https://www.handsfreeforweb.com/en/), you have the ability to operate the buttons by voice. The extension has a very good help page which tells you all about it. When you say “Click Button” the possible click options are numbered. Then say the number and that clicks the button. The embedded device collects the message which goes back to it and operates whatever function is coded.
<html><body>
<h1>To toggle an LED, start Handsfree for Web and then Say ‘Click Button’</h1><p> <form name =”aform1” method = GET form action = Buttons_1><p><input type =”submit” role=”button” value =”LED 1“> </form><br><p><p> <form name=”aform2” method= GET form action = Buttons_2><p><input type=”submit” value=”LED 2” role=”button“> </form> <br><p></body></html></ |
The benefit
Any person with suitable coding skills will be able to make their embedded device voice operated without additional software coding or cost, if they choose to offer a web interface.
It does not require significant processor power as the voice processing is done by the web servers of course, and you also have a control interface that will work on any computer or phone without installing software on those devices.
Please feel free to contact me if you wish more details. My example is running on an M4 processor coded using MCUXpresso, a professional platform, however, this could easily be made to work for Arduino or MBED and so on.
- Skills involved:
- Issues Addressed:
- Activities Helped:
- Location:
- Solution:
If you live in the UK, you should contact your local Remap group: https://www.remap.org.uk/contact-remap/.
If you live outside the UK, it is unlikely we can help. If you can find an organisation local to you (for example a technical school, hobbyist engineer, men’s shed, or similar) who might be able to make it for you, then we would be happy to assist.
Hello
I am an occupational Therapist and I am currently working three adult siblings who all have a neurological condition, and hand function limited. They are able to use Alexa to call a carer at night and that is being used throughout the house. The difficulty that concerns them most is operating their bed controls, they have to sleep with the controls in their hand so that they are able to move the bed, which they need to do several times per night to change their position. Would it be possible to operate their beds via voice control??
I am also contacting EAT for their advice also, in the past they have been unable to assist but technology is advancing at a rapid pace.
Thank you