Skip to content

vmanthena/iotcore-smart-device

 
 

Repository files navigation

Smart IoT Device

This repo is a companion application for a video series from Visual Studio Toolbox! Check out the videos for how to get started with Windows IoT Core if you'd like to see this device in action and want more information.

We’ll create a Smart IoT Device application for deployment to your Windows 10 IoT Core device. This application has the following features:

  1. Waving in front of the proximity sensor will cause the application to recognize your face and greet you by name in the application UI. This is made possible by Microsoft Cognitive Services.
  2. The temperature of the room will be displayed on screen on the app's UI.
  3. The temperature will be reported to Azure IoT Hub and displayed in Azure IoT Central.

This is a headed sample. To better understand what headed mode is and how to configure your device to be headed, follow the instructions here.

Also, be aware that the GPIO APIs are only available on Windows 10 IoT Core, so this sample cannot run on your desktop.

Connect the components to your Windows IoT device

You’ll need a few components:

Setting up your breadboard

BME280

  • 3V pin to Cobbler's 3V pin
  • GND to Cobbler's GND pin
  • SCK to Cobbler's SCK pin
  • SDI to Cobbler's SDL pin

VCNL4010

  • 3V pin to Cobbler's 3V pin
  • GND to Cobbler's GND pin
  • SCK to Cobbler's SCK pin
  • SDI to Cobbler's SDL pin
  • INT to Cobbler's GPIO 16 pin

breadboard diagram

Don't forget to also plug in your Lifecam via USB directly to the Pi!

Create your Azure Services

  1. Create a Face API subscription key
  2. Train the Face API to recognize your face
  3. Create an Azure IoT Central application (or Azure IoT Hub directly if you'd prefer not to use IoT Central)
  4. Create a device via either Azure IoT Central, or Azure IoT Hub. Note down the device id and the connection string for that device.

The credentials needed are listed as empty string variables in Constants/CredentialsConstants.cs. Fill these in with your own created via the steps above.

Deploy your app

  1. With the application open in Visual Studio, set the architecture in the toolbar dropdown. As you’re building for Raspberry Pi 2 or 3, select ARM.

  2. Next, in the Visual Studio toolbar, click on the Local Machine dropdown and select Remote Machine

    RemoteMachine Target

  3. At this point, Visual Studio will present the Remote Connections dialog. If you previously used PowerShell to set a unique name for your device, you can enter it here (in this example, we’re using my-device). Otherwise, use the IP address of your Windows IoT Core device. After entering the device name/IP select Universal for Windows Authentication, then click Select.

    Remote Machine Debugging

  4. You can verify or modify these values by navigating to the project properties (select Properties in the Solution Explorer) and choosing the Debug tab on the left:

    Project Properties Debug Tab

When everything is set up, you should be able to press F5 from Visual Studio. If there are any missing packages that you did not install during setup, Visual Studio may prompt you to acquire those now. The SmartHomeDevice app will deploy and start on the Windows IoT device.

Congratulations! You controlled some advanced devices on your Windows IoT device.

Additional resources

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%