element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
IoT on Wheels Design Challenge
  • Challenges & Projects
  • Design Challenges
  • IoT on Wheels Design Challenge
  • More
  • Cancel
IoT on Wheels Design Challenge
Blog VeTAS - Blog #3: Setting Temperature Alert Logic and Coding
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shantimohan
  • Date Created: 10 Oct 2017 2:16 AM Date Created
  • Views 548 views
  • Likes 2 likes
  • Comments 1 comment
  • iot on wheels design challenge
  • temperature alert system
  • vetas
  • iot on wheels
Related
Recommended

VeTAS - Blog #3: Setting Temperature Alert Logic and Coding

shantimohan
shantimohan
10 Oct 2017

This is the 3rd blog post for the "IoT on Wheels Design Challenge"

 

Temperature Alert Logic:

  1. Related Parameters:

    1. Temperature Unit: This can take only two values, 0 for Celsius and 1 for Fahrenheit. Default value will be 1 (Fahrenheit).
    2. Temperature Threshold: If the sensed temperature is above this value, alert mechanism will be activated. Default value will be set to 85 F.
    3. Desired Telemetry Interval:This sets the how frequently the data is transmitted to cloud. This will be set as follows:
      1. 5 seconds: During setup of the device. That is when a new device is being setup to connect to cloud through the mobile app.
      2. 15 minutes: This will be the normal frequency at which the temperature data is transmitted to cloud. This long duration is considered to save data transmission fees as the device will have to connect to cloud through a cellular connection.
      3. 5 seconds for 15 minutes: When an alert occurs the temperature data will be transmitted to cloud every 5 seconds. Also an email and / or text message will be sent to the contact information stored. But this will occur only for 15 minutes or till some action is taken. For now I have no way of knowing that the driver has opened the windows or started fan / air-conditioning either manually or remotely. This logic may change once the system is adapted.
    4. Mobile number and / or Email address of Contact Person: The alert details will be sent to this contact.
    5. Wi-Fi Connection Details: SSID and password to connect through Wi-Fi. This Wi-Fi connection will be used to connect to the mobile app and / or transmit data to cloud when it is available. Currently the password stored will be in clear text but it will be encrypted in future adaptations.
    6. Azure IoT Hub Connection String: This is got from Azure when the device is registered with the IoT Hub. This also will be in clear text for now.

 

Coding for Generating a Temperature Alert:

  • Sensor Board Readings:

    1. The sensors of the Sensor Board are read in the function FillTheModelInstance(void) in the file AzureClient_mqtt_DM_TM.c.
    2. Besides Temperature & Humidity sensors there are also Accelerator and Gyroscope. All values are read in this function only.
    3. The temperature is read in Celsius. So if the Temperature Unit is set to Fahrenheit then the read value is converted to Fahrenheit as shown in the picture below.
    4. If the Temperature is above the TemperatureThreshold then the TemperatureAlert is set to True otherwise it is set to False. The value of this TemperatureAlert will be used by Azure to activate Alert functionality.

image

  • Send Sensor Data to Cloud (Azure):

    1. The temperature data is transmitted to Azure by the function SendSNSData_Original(void) in the file AzureClient_mqtt_DM_TM.c.
    2. The following picture shows the data being serialized and transmitted.
    3. The ellipses in the picture contains the code to actually transmit the data and error processing.
    4. A word about naming of the function. The actual function is SendSNSData(void). But to manage the different data transmit intervals, this name is used to manage that time interval. When the time is up for sending the data the function SendSNSData_Original(void) will be called. This interval management code is still being finalized.

 

image

 

A Glimpse of the Mobile App being developed (Android version is shown):

image

  • Sign in to reply
Parents
  • DAB
    DAB over 8 years ago

    Nice update.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 8 years ago

    Nice update.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube