%3CLINGO-SUB%20id%3D%22lingo-sub-1537559%22%20slang%3D%22en-US%22%3EBuild%20a%20Rover%20combining%20the%20best%20of%20Azure%20Sphere%20security%20with%20FreeRTOS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1537559%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%22build-a-rover-combining-the-best-of-azure-sphere-security-with-freertos%22%20id%3D%22toc-hId-497985678%22%20id%3D%22toc-hId-497985678%22%20id%3D%22toc-hId-497985678%22%3EBuild%20a%20Rover%20combining%20the%20best%20of%20Azure%20Sphere%20security%20with%20FreeRTOS%3C%2FH1%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FAzure-Sphere-Rover-Bot-FreeRTOS-with-Azure-IoT%2Fmaster%2Fresources%2Farchitecture-twitter.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22what-you-will-learn%22%20id%3D%22toc-hId-1188547152%22%20id%3D%22toc-hId-1188547152%22%20id%3D%22toc-hId-1188547152%22%3EWhat%20you%20will%20learn%3C%2FH2%3E%0A%3CP%3EYou%20will%20learn%20how%20to%20integrate%20a%20Real-time%20FreeRTOS%20application%20responsible%20for%20running%20a%20timing-sensitive%20ultrasonic%20distance%20sensor%20with%20the%20security%20and%20cloud%20connectivity%20of%20Azure%20Sphere.%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22julyot%22%20id%3D%22toc-hId--618907311%22%20id%3D%22toc-hId--618907311%22%20id%3D%22toc-hId--618907311%22%3E%23JulyOT%3C%2FH2%3E%0A%3CP%3EThis%20is%20part%20of%20the%20%23JulyOT%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fhashtag%2FJulyOT%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIoT%20Tech%20Community%3C%2FA%3E%20series%2C%20a%20collection%20of%20blog%20posts%2C%20hands-on-labs%2C%20and%20videos%20designed%20to%20demonstrate%20and%20teach%20developers%20how%20to%20build%20projects%20with%20Azure%20Internet%20of%20Things%20(IoT)%20services.%20Please%20also%20follow%20-ERR%3AREF-NOT-FOUND-%23JulyOT%20on%20Twitter.%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22source-code-and-learning-resources%22%20id%3D%22toc-hId-1868605522%22%20id%3D%22toc-hId-1868605522%22%20id%3D%22toc-hId-1868605522%22%3ESource%20code%20and%20learning%20resources%3C%2FH2%3E%0A%3CP%3ESource%20code%3A%20%3CA%20href%3D%22https%3A%2F%2Fgloveboxes.github.io%2FAzure-Sphere-Rover-Bot-FreeRTOS-with-Azure-IoT%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%20seeing%20eyed%20rover%20Real-time%20FreeRTOS%20sensors%20and%20Azure%20IoT%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3ELearning%20resources%3A%20-ERR%3AREF-NOT-FOUND-Azure%20Sphere%20Developer%20Learning%20Path.%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22learn-more-about-azure-sphere%22%20id%3D%22toc-hId-61151059%22%20id%3D%22toc-hId-61151059%22%20id%3D%22toc-hId-61151059%22%3ELearn%20more%20about%20Azure%20Sphere%3C%2FH2%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-au%2Fservices%2Fazure-sphere%2F%3FWT.mc_id%3Djulyot-rover-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%3C%2FA%3E%20is%20a%20comprehensive%20IoT%20security%20solution%20%E2%80%93%20including%20hardware%2C%20OS%2C%20and%20cloud%20components%20%E2%80%93%20to%20actively%20protect%20your%20devices%2C%20your%20business%2C%20and%20your%20customers.%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22application-architecture%22%20id%3D%22toc-hId--1746303404%22%20id%3D%22toc-hId--1746303404%22%20id%3D%22toc-hId--1746303404%22%3EApplication%20architecture%3C%2FH2%3E%0A%3CP%3EThe%20application%20running%20on%20the%20Azure%20Sphere%20consists%20of%20two%20parts.%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FAzure-Sphere-Rover-Bot-FreeRTOS-with-Azure-IoT%2Fmaster%2Fresources%2Fapplication-architecture.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22real-time-freertos-application%22%20id%3D%22toc-hId--1055741930%22%20id%3D%22toc-hId--1055741930%22%20id%3D%22toc-hId--1055741930%22%3EReal-time%20FreeRTOS%20Application%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EThe%20Real-time%20FreeRTOS%20application%20running%20on%20one%20of%20the%20M4%20cores%20that%20is%20responsible%20for%20running%20the%20timing-sensitive%20HC-SR04%20ultrasonic%20distance%20sensor.%3C%2FLI%3E%0A%3CLI%3EDistance%20is%20measured%20every%20100%20milliseconds%20so%20the%20rover%20can%20decide%20the%20best%20route.%3C%2FLI%3E%0A%3CLI%3EThe%20sensor%20requires%20precise%20microsecond%20timing%20to%20trigger%20the%20distance%20measurement%20process%2C%20so%20it%20is%20a%20perfect%20candidate%20for%20running%20on%20the%20Real-time%20core%20as%20a%20FreeRTOS%20Task.%3C%2FLI%3E%0A%3CLI%3EEvery%205%20seconds%20a%20FreeRTOS%20Task%20sends%20distance%20telemetry%20to%20the%20Azure%20Sphere%20A7%20High-level%20application.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20id%3D%22azure-iot-high-level-application%22%20id%3D%22toc-hId-1431770903%22%20id%3D%22toc-hId-1431770903%22%20id%3D%22toc-hId-1431770903%22%3EAzure%20IoT%20High-level%20Application%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EThe%20application%20running%20on%20the%20Azure%20Sphere%20A7%20High-level%20application%20core%20is%20responsible%20for%20less%20timing-sensitive%20tasks%20such%20as%20establishing%20WiFi%2FNetwork%20connectivity%2C%20negotiating%20security%20and%20connecting%20with%20Azure%20IoT%20Central%2C%20updating%20the%20device%20twin%20and%20send%20telemetry%20messages.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20id%3D%22extending%22%20id%3D%22toc-hId--375683560%22%20id%3D%22toc-hId--375683560%22%20id%3D%22toc-hId--375683560%22%3EExtending%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EI%20am%20thinking%20about%20extending%20this%20solution%20with%20a%20local%20TinyML%20module%20for%20smarter%20navigation.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22parts-list%22%20id%3D%22toc-hId--386186664%22%20id%3D%22toc-hId--386186664%22%20id%3D%22toc-hId--386186664%22%3EParts%20list%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3E1%20x%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2Fmt3620-for-azure-sphere%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESeeed%20Studio%20MT3620%20Mini%20Dev%20Board%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E1%20x%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FMT3620-Grove-Breakout-p-4043.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMT3620%20Grove%20Breakout%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E2%20x%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Ultrasonic-Distance-Sensor.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGrove%20-%20Ultrasonic%20Distance%20Sensor%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E1%20x%20H-Bridge%20driver.%20Seeed%20Studio%20have%20a%20%3CA%20href%3D%22https%3A%2F%2Fwiki.seeedstudio.com%2FGrove-I2C_Motor_Driver_V1.3%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGrove%20-%20I2C%20Motor%20Driver%3C%2FA%3E%2C%20or%20you%20can%20wire%20up%20your%20own%20H-Bridge%20connector%20to%20the%20Grove%20Breakout%20board.%3C%2FLI%3E%0A%3CLI%3E1%20x%20Rover%20chassis%2C%20motors%2C%20wheels%20etc%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FAzure-Sphere-Rover-Bot-FreeRTOS-with-Azure-IoT%2Fmaster%2Fresources%2FIMG_0172_cropped.jpg%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22azure-iot-central%22%20id%3D%22toc-hId--519871388%22%20id%3D%22toc-hId--519871388%22%20id%3D%22toc-hId--519871388%22%3EAzure%20IoT%20Central%3C%2FH2%3E%0A%3CP%3E-ERR%3AREF-NOT-FOUND-Azure%20IoT%20Central%20provides%20an%20easy%20way%20to%20connect%2C%20monitor%2C%20and%20manage%20your%20Internet%20of%20Things%20(IoT)%20assets%20at%20scale.%3C%2FP%3E%0A%3CP%3EI%20created%20a%20free%20trial%20of%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-gb%2Fservices%2Fiot-central%2F%3FWT.mc_id%3Djulyot-rover-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20IoT%20Central%3C%2FA%3E%20and%20in%20no%20time%20I%20had%20the%20rover%20distance%20sensor%20charted%20and%20available%20for%20deeper%20analysis.%20By%20the%20way%2C%20you%20can%20continue%20to%20connect%20two%20devices%20for%20free%20to%20IoT%20Central%20after%20the%20trial%20period%20expires.%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FAzure-Sphere-Rover-Bot-FreeRTOS-with-Azure-IoT%2Fmaster%2Fresources%2Fiot-central-distance-chart.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22extend-and-integrate-azure-iot-central-applications-with-other-cloud-services%22%20id%3D%22toc-hId-2096724164%22%20id%3D%22toc-hId-2096724164%22%20id%3D%22toc-hId-2096724164%22%3EExtend%20and%20integrate%20Azure%20IoT%20Central%20applications%20with%20other%20cloud%20services%3C%2FH3%3E%0A%3CP%3EAzure%20IoT%20Central%20is%20also%20extensible%20using%20rules%20and%20workflows.%20For%20more%20information%2C%20review%20-ERR%3AREF-NOT-FOUND-Use%20workflows%20to%20integrate%20your%20Azure%20IoT%20Central%20application%20with%20other%20cloud%20services%3C%2FP%3E%0A%3CHR%20%2F%3E%0A%3CH2%20id%3D%22how-to-build-the-solution%22%20id%3D%22toc-hId-160186982%22%20id%3D%22toc-hId-160186982%22%20id%3D%22toc-hId-160186982%22%3EHow%20to%20build%20the%20solution%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3ESet%20up%20your%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgloveboxes%2FAzure-Sphere-Learning-Path%2Ftree%2Fmaster%2Fzdocs_visual_studio_iot_central%2FLab_0_Introduction_and_Lab_Set_Up%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%20development%20environment%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EReview%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgloveboxes%2FAzure-Sphere-Learning-Path%2Ftree%2Fmaster%2Fzdocs_visual_studio_iot_central%2FLab_5_FreeRTOS_and_Inter-Core_Messaging%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIntegrate%20FreeRTOS%20Real-time%20room%20sensors%20with%20Azure%20IoT%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3ELearn%20how%20to%20connect%20and%20Azure%20Sphere%20to%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgloveboxes%2FAzure-Sphere-Learning-Path%2Ftree%2Fmaster%2Fzdocs_visual_studio_iot_central%2FLab_2_Send_Telemetry_to_Azure_IoT_Central%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20IoT%20Central%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgloveboxes%2FAzure-Sphere-Learning-Path%2Ftree%2Fmaster%2Fzdocs_vs_code_iot_hub%2FLab_2_Send_Telemetry_to_Azure_IoT_Hub%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20IoT%20Hub%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EThe%20IoT%20Central%20Device%20Template%20Capabilities%20Model%20JSON%20file%20for%20this%20solution%20is%20included%20in%20the%20%3CSTRONG%3Eiot_central%3C%2FSTRONG%3E%20directory%20of%20this%20repo.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CHR%20%2F%3E%0A%3CP%3EHave%20fun%20and%20stay%20safe%20and%20be%20sure%20to%20follow%20us%20on%20-ERR%3AREF-NOT-FOUND-%23JulyOT.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1537559%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3ELearn%20how%20to%20integrate%20a%20Real-time%20FreeRTOS%20application%20running%20a%20timing-sensitive%20ultrasonic%20distance%20sensor%20with%20Azure%20Sphere%20security%20and%20communications%26nbsp%3Band%20Azure%20IoT%20Central%20and%20IoT%20Hub.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22architecture-twitter.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207047i87362326E3A97BA9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22architecture-twitter.png%22%20alt%3D%22architecture-twitter.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1551487%22%20slang%3D%22en-US%22%3ERe%3A%20Build%20a%20Rover%20combining%20the%20best%20of%20Azure%20Sphere%20security%20with%20FreeRTOS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1551487%22%20slang%3D%22en-US%22%3E%3CP%3EVery%20cool%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F270890%22%20target%3D%22_blank%22%3E%40glovebox%3C%2FA%3E!%26nbsp%3B%20Thanks%20for%20sharing%2C%20I%20wish%20I%20had%20some%20time%20to%20play%20with%20this%20project.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Build a Rover combining the best of Azure Sphere security with FreeRTOS


What you will learn

You will learn how to integrate a Real-time FreeRTOS application responsible for running a timing-sensitive ultrasonic distance sensor with the security and cloud connectivity of Azure Sphere.


#JulyOT

This is part of the #JulyOT IoT Tech Community series, a collection of blog posts, hands-on-labs, and videos designed to demonstrate and teach developers how to build projects with Azure Internet of Things (IoT) services. Please also follow #JulyOT on Twitter.


Source code and learning resources

Source code: Azure Sphere seeing eyed rover Real-time FreeRTOS sensors and Azure IoT.

Learning resources: Azure Sphere Developer Learning Path.


Learn more about Azure Sphere

Azure Sphere is a comprehensive IoT security solution – including hardware, OS, and cloud components – to actively protect your devices, your business, and your customers.


Application architecture

The application running on the Azure Sphere consists of two parts.

Real-time FreeRTOS Application

  • The Real-time FreeRTOS application running on one of the M4 cores that is responsible for running the timing-sensitive HC-SR04 ultrasonic distance sensor.
  • Distance is measured every 100 milliseconds so the rover can decide the best route.
  • The sensor requires precise microsecond timing to trigger the distance measurement process, so it is a perfect candidate for running on the Real-time core as a FreeRTOS Task.
  • Every 5 seconds a FreeRTOS Task sends distance telemetry to the Azure Sphere A7 High-level application.

Azure IoT High-level Application

  • The application running on the Azure Sphere A7 High-level application core is responsible for less timing-sensitive tasks such as establishing WiFi/Network connectivity, negotiating security and connecting with Azure IoT Central, updating the device twin and send telemetry messages.

Extending

  • I am thinking about extending this solution with a local TinyML module for smarter navigation.

Parts list


Azure IoT Central

Azure IoT Central provides an easy way to connect, monitor, and manage your Internet of Things (IoT) assets at scale.

I created a free trial of Azure IoT Central and in no time I had the rover distance sensor charted and available for deeper analysis. By the way, you can continue to connect two devices for free to IoT Central after the trial period expires.

Extend and integrate Azure IoT Central applications with other cloud services

Azure IoT Central is also extensible using rules and workflows. For more information, review Use workflows to integrate your Azure IoT Central application with other cloud services


How to build the solution

  1. Set up your Azure Sphere development environment.
  2. Review Integrate FreeRTOS Real-time room sensors with Azure IoT.
  3. Learn how to connect and Azure Sphere to Azure IoT Central or Azure IoT Hub.
  4. The IoT Central Device Template Capabilities Model JSON file for this solution is included in the iot_central directory of this repo.

Have fun and stay safe and be sure to follow us on #JulyOT.

1 Comment
Senior Member

Very cool @glovebox!  Thanks for sharing, I wish I had some time to play with this project.