Make With Mouser IoT Design Contest - Blind People Tracker Device with AVRIoT Wx from Microchip [2/2]

TIme to continue tutorial from here
Modify firmware of the board,

First download MPLAB x IDE and XC8 compiler and install it.
download the pre programmed by factory for AVR-IoT AWS

Open MPLAB X IDE and open project that already download from the link above.

on the navigation window , click AVRIoT -> SourceFiles -> MCC_Generated_Files ->Application_manager.h

edit pre-programmed sendtocloud function
static void sendToCloud(void)
    static char json[PAYLOAD_SIZE];
    static char publishMqttTopic[PUBLISH_TOPIC_SIZE];
    int len = 0;   
    uint8_t sw0 = SW0_GetValue() != 0;

    memset((void*)publishMqttTopic, 0, sizeof(publishMqttTopic));
    sprintf(publishMqttTopic, "%s/sensors", cid);
    // This part runs every CFG_SEND_INTERVAL seconds
    if (shared_networking_params.haveAPConnection)
            len = sprintf(json,"%u",sw0);
    if (len >0)
        CLOUD_publishData((uint8_t*)publishMqttTopic ,(uint8_t*)json, len);       
        if (holdCount)
            ledParameterYellow.onTime = LED_BLIP;
            ledParameterYellow.offTime = LED_BLIP;
Connect board into PC and reprogram the board with edited file by clicking the make & program device button(red border)

after firmware of the AVR IoT board is updated..

Check AWS IoT core server to make sure whether is it work or not.

as you can see it works, when swtich button is pressed board will send 0 to the AWS Iot Core server and 1 if switch button is not pressed.

Our board is ready..

Let's continue build smartphone application

The concept here is , when board is pressed by blind people, it will send "0" data to AWS IoT Core server
This data will be subscribed by smartphone application that will be made.

So there are 2 smartphone application we will build.
First as gps sensor (Function is to replace broken gps sensor that i bought)
and second smartphone application for tracking the positiion..

Like I told you on the first thread of this tutorial
the concept is

Blind people bring Embedded device (switch button + microcontroller Wrapped by box) and also smartphone as WIFI Teathering connection.
We will use this smartphone also as our gps sensor. so when switch button is pressed, it will request to smartphone for sending gps location to the cloud.

the gps location will be accessed by other smartphone application. and we can track the location.

Without further ado lets start make 1st application

open app inventor 2 by click this link

start new project and follow component that I used.
There are
  1. Label1
  2. Label2
  3. UsrPahoMqttClient1
  4. LocationSensor1
  5. Clock1 - 3
  6. text to speech

program the application with this block

Now Build the application and download it by scan the Generated QR Code


Now let's run the application on our smartphone and check the AWS IoT Core server
is it correctly set up or not.

Open AWS IoT Core and click test and subscribe for {id}/sensors & {id}/location

You can see at {id}/sensor, when I pressed the button it will send "0" data.
and the smartphone application will response the "0" data by sending gps coordinate (Latitude & Longitude ) :

To make sure this coordinate is accurate, I will check it on google maps website

Yeayy..... the coordinate is accurate, when I make this app I am exactly on the red pin map.

I think we are done....
eitss... but wait we will make another app for tracker application


Same with previous step,
go to app inventor 2 and start new project and follow component that I used.
  1. Lable1
  2. Map1
  3. Marker1
  4. Button1
  5. Locationsensor1
  6. UrsPahoMqttClient1
  7. ActivityStarter1
  8. Clock1


after make the view like the picture i'ts time to program it with block
follow my blocks


Build the software application and download it.
and we are done..

Please watch the video for the demo

Blog entry information

Last update

More entries in Design Contest

Share this entry