Virtual Breadboard (VBB) is a circuit modelling and virtualization application that I have been developing literally forever. (since 1999). VBB/VBB4Arduino 'Classic' serves the self education makers market but technology changes so fast it's expensive to maintain.
Hence for the last several years I have been migrating the 'Classic' (WinForm) version to the Universal Windows Platform (UWP). The goal is create a modern App and cloud platform suitable for integrating with the wealth of emerging IoT cloud services so as to build a more robust business model.
Many benefits flow from participating in the UWP ecosystem including access to Microsoft Windows Store, IoT Core for Raspberry Pi, Windows 10 S low cost education and home controllers and of course cloud services such as Alexa become a natural fit.Rolling your own Alexa Infrastructure
Sure you can roll your own Alexa solutions and there are many projects here on hackster that can help you do just that. However despite the excellent materials available it's not totally trivial to implement and especially maintain your own Alexa infrastructure.
Many VBB users are Arduino enthusiasts and my sense is implementing and hosting Alexa is beyond what they can invest into a casual project.
Enter the Virtual Breadboard Skill for Alexa!
Microsoft Visual Studio revolutionised programming by hiding the complexity of the underlying infrastructure. VBB aspires to do the same for IoT and Alexa is a perfect showcase of the type of cloud service integrations made possible by the modern UWP App version of VBB.
To orientate you for the rest of the project write up I encourage you to follow this short top level video which in 5 minutes you will:
- Logon to your Alexa Account and link the Virtual Breadboard Skill
- Logon on Virtual Breadboard and create a Switch Endpoint
- Publish the Switch Endpoint and discover it as an Alexa device
- Use the Alexa Skill Simulator to control the virtual switch you just created
So far we have captured the Alexa commands as a virtual signal in the VBB Sandbox. To create smart home applications we need to get out of the sandbox and the Edge:Bit is just the thing!
These days Open Source Hardware (OSWH) has become commoditized such that there are a multitude of manufacturers of interchangeable hardware modules efficiently serving all regions of the world. The obvious benefit is low cost but also there has emerged a degree of interface standardisation.
Edge:Bit is a Smart USB Interface to standardised OSHW modules.
The idea is to attach a Edge:Bit to OSWH modules as a 'backpack' and register the module to match up with it's VBB Component 'Avatar'. In this way the module becomes plug-and-play and it can be auto-detected and placed or resolved in the virtual circuit.
The Edge:bit is the perfect companion widget to the Virtual Breadboard Alexa Skill and with a bit of luck the plan is to launch it on Kickstarter with a bit of help from one of the Hackster Kickstarter packages!Going Wireless
The Edge:Bit shown in the video's is only a prototype. The production version will have more of the standardised connector options and also a variant supporting transparent pass-thru via HS-12 433Mhz modules making wireless configurations effortless to deploy.
This will be detailed in the Edge:Bit Kickstarter but for now I want to demonstrate another highly effective and even lower cost wireless option - Infrared.
We are all very familiar with Infrared. It's the tried and trusted technology behind the TV, DVD, etc and so on. It's also very low cost, flexible and perfect for an Arduino class end-point device to handle.Arduino Infrared Receiver Alexa Endpoint
The final step for this project is to move the Relay to a remote location controlled by an Arduino endpoint. The Alexa commands will be issued over a Infrared transmitter module via Edge:Bit to complete a very practical remote control application. Scaling to almost any number of endpoints is made easy by linking additional Alexa controls to unique infrared commands. Let's dig in.All Virtual Test
One of the advantages of having access to a virtualization platform like Virtual Breadboard is you can test out entire applications completely virtually.
In the following 5 minute tutorial we will create and test a virtualized version of the smart home application. Specifically we will:
- Review the Arduino Infrared remote control code in the Arduino IDE
- Fork the previous Virtual Breadboard Application into the Arduino project
- Add a Virtual Arduino and Infrared encoder components
- Rewire so the Alexa.PowerControl switch activates the Infrared encoders
- Run the virtual application and export and load the Arduino HEX
- Test the application with Alexa.PowerControl switch and Alexa EchoSim voice.
Now that we know our Arduino endpoint application code works the next step is to hook up the real thing.
The nice thing about working with Edge:Bit is once your done with your virtual prototype you can unclip the Edge:Bit and use the OSHW module live.
Refering the to Arduino UNO Remote Relay Controller Schematic
- Hook up the Relay module to the Arduino instead of
- Hook up a Infrared receiver module to the Arduino
Now in the following 2.5 minute tutorial we reconfigure the virtual test application to work as the real deal. Specifically we will:
- Upload the Arduino firmware using the Arduino IDE
- Remove the unused virtual Arduino and relay
- Plug-and-play an Edge:Bit with an Infra-red transmitter
- Re-route the Alexa.PowerController Button to the Infra-red transmitter
- Test the application with Alexa.PowerControl switch and Alexa EchoSim voice.
The really nice thing about what Amazon have done here with the Smart Home API is create something of standard way to describe device capabilities. It takes an extra effort to understand and adopt the standards but when you do the magic of interoperability starts kicking in.
In the following 40 second demo (bonus!) I discuss
- Controlling VBB with the Alexa App
- Controlling VBB with your Web Browser
- Controlling VBB with the future VBB Smart Home App
It's been a really big personal investment to migrate from the Classic version of Virtual Breadboard to the Universal Windows Platform. The App is quite different than Classic and understandably many of my users still don't quite know what to make of it all. Now that I am getting to the end of catching up with the Classic version I can get on with new things like this Alexa integration and hopefully.. well.. the lights will start coming on!
But wait there's more.. here are some other upcoming benefits of the UWP move.Window IoT Core
It's really amazing to me that I am able to run the core of the Virtual Breadboard runtime on a $25 device. Together with the Edge:Bit and Edge:bit-433Mhz-wireless the Raspberry Pi with Windows IoT core is going to make a fantastic Alexa powered Smart Home controller.Windows 10 S
Virtual Breadboard has roots in Education which is where Microsoft is targeting Windows 10 S. For testing Virtual Breadboard I purchased a Windows 10 S laptop with touch screen for an amazing price. During this Alexa project I realise that these touch screen laptops would also make a fantastic full featured Smart Home controllers out of the Box.The Cloud
Finally, and to finish up working with UWP makes it much easier to work with the current state of the art services and API's. Following the Architecture diagram below Virtual Breadboard cloud services are based on Azure with SignalR for the real-time notifications. This is all made possible by being a modern application - an admittedly huge challenge in such as fast moving industry.
Shout out to Microsoft how have sponsored me as a BizSpark startup business for the last couple of yearsPostScript:
My Virtual Breadboard Skill was certified and available in the Alexa store today (Friday 23rd). Just in time! I have lambda support for the US (North Virginia) and European regions (Ireland).
Virtual Breadboard App ( 1.1.17) is also now published in the Microsoft App Store with the Alexa.PowerController Button so you should have everything you need to follow the above Alexa Skill Basics video tutorial.
Virtual Breadboard App ( 1.1.18) will be updated this coming week which features some additional needed components. So depending on when you read this write up you might have to wait a couple of days to be able to follow the above Alexa Virtual Arduino Controlled Relay video tutorial.
To follow the other video tutorials your going to need an Edge:Bit and for that your going to have to wait for the Kickstarter and maybe even back me. Hint Hint!