Vbb4arduino Virtual Breadboard For Arduino



Effortlessly roll your own smart home applications with drag-and-drop Alexa 'aware' controls in the Virtual Breadboard Microsoft Store App.

  • 6,973 views
  • 0 comments
  • 14 respects

Virtual Breadboard (VBB) is a circuit modelling and virtualization application that I have been developing literally forever. VBB/VBB4Arduino 'Classic' serves the self education makers market but technology changes so fast it's expensive to maintain. Nov 30, 2019 VBB4Arduino Virtual Breadboard for Arduino is a learning 'app' version of VBB designed to help you take the first steps in the exciting world of physical computing with the Arduino microcontroller and ‘Breadboard’ based electronic circuit models.

Components and supplies

Arduino UNO
×1
Seeed Grove - Infrared Emitter
×1
Seeed Grove - Relay
×1
Virtual Breadboard Edge:Bit
×1
Seeed Grove - Infrared Receiver
×1

Apps and online services

About this project

Vbb4arduino Virtual Breadboard For Arduino Microcontroller

Virtual Breadboard

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!

Virtual Breadboard meets 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
Alexa meets Virtual Breadboard - Helicopter View ( 5 mins )

Getting out of the Sandbox with Edge:Bit

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.

Getting out the Sandbox with Edge:Bit ( 2mins 20s)

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.
Create and Test Alexa voice control a Virtual Smart Home Controller (5 mins)

Getting Real

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
Virtual
  • 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.
Completing the Alexa controlled remote relay ( 2.5mins )

Not just about 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
Web and App Control

Windows Universal Platform 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.

Shoutout to Microsoft how have sponsored me as a BizSpark startupbusiness for the last couple of years

PostScript:

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 Relayvideo 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!

Code

An Arduino Infrared receiver application to remotely control a relay which can be connected to LAMP or anything else

Schematics

The virtual breadboard layout of a Alexa endpoint, Infrared encoder and virtual arduino infrared decoder application driving a remote relay
A deployable home controller configuration which passes through Alexa commands to a real Arduino Infrared receiver that is controlling a relay
Schematic for configuring the real Arduino Uno with the IR and Relay modules

Submitted to Contest

$6,000 cash + Kickstarter Coaching Session + Trophy

The Alexa and Arduino Smart Home Challenge

Author

James Caska
  • 4 projects
  • 27 followers

Published on

February 27, 2018
Write a comment

Members who respect this project

and 6 others

See similar projects

Virtual Breadboard Download


you might like

Table of contents

Write a comment

The Arduino IDE is a simplified build system for the gcc compiler. If you are very new to Arduino you might not be familiar with the idea that the output of the Arduino IDE is a HEX file. The HEX file itself is just a hexadecimal encoded version of the raw binary instruction set program that the microcontroller will actually run.

With a real arduino the HEX is transparently sent over a serial port to the microcontroller to self program so normally you don't see the HEX file. In VBB though we pass the HEX directly to the virtual microcontroller as a File and then VBB decodes the file and executes the binary so we need access the HEX file itself.

Setup the Board

VBB only virtualises the ATMega328p microcontroller so you need to make sure the correct board is setup in the Arduino IDE to generate the correct HEX. You should choose the Arduino/Genuino Uno board

Vbb4arduino Virtual Breadboard For Arduino

Vbb4arduino Virtual Breadboard For Arduino Ide

To show the Sketch Folder:

  • Select the Menu Tools ⇒ Board ⇒ Arduino/Genuino Uno

Export the HEX

With the correct board selected it is easy to generate the HEX file from the Arduino IDE.

To generate the HEX file:

  • Select the Menu Sketch⇒ Export compiled Binary

Vbb4arduino – Virtual Breadboard For Arduino

Locating the HEX

Vbb4arduino - Virtual Breadboard For Arduino Download

Once compiled the HEX file should now appear in the Sketch folder. The file we will work with ends with ._standard.hex