element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
In the Air Design Challenge
  • Challenges & Projects
  • Design Challenges
  • In the Air Design Challenge
  • More
  • Cancel
In the Air Design Challenge
Blog [AirCare] InTheAir - Week 18: Finalizing Things
  • 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: fvan
  • Date Created: 26 Feb 2015 9:36 PM Date Created
  • Views 679 views
  • Likes 2 likes
  • Comments 2 comments
  • eclipse_iot
  • mqtt
  • openhab
  • beaglebone_black
  • internet_of_things
  • in_the_air
  • texas_instruments
  • iot_sensor_nodes
  • cc3200
  • launchpad
Related
Recommended

[AirCare] InTheAir - Week 18: Finalizing Things

fvan
fvan
26 Feb 2015

Previous posts for this project:

  • [AirCare] InTheAir - Project Description
  • [AirCare] InTheAir - Week 1: Getting a Launchpad to Blink
  • [AirCare] InTheAir - Week 2: Preparing the Beaglebone Black
  • [AirCare] InTheAir - Week 3: Fuel Tank Testing
  • [AirCare] InTheAir - Week 4: Using the CC3200
  • [AirCare] InTheAir - Week 5: openHAB and MQTT
  • [AirCare] InTheAir - Week 6: Accessing Fuel Tank's Data
  • [AirCare] InTheAir - Week 7: Dust sensor
  • [AirCare] InTheAir - Week 8: MSP430FR5969 with Energia14
  • [AirCare] InTheAir - Week 11: CC3200, Energia and analogRead()
  • [AirCare] InTheAir - Week 12: Automatically starting some things
  • [AirCare] InTheAir - Week 13: GP2Y10 BoosterPack
  • [AirCare] InTheAir - Week 14: Ordering Parts and PCBs
  • [AirCare] InTheAir - Week 16: CNC Milling
  • [AirCare] InTheAir - Week 16 bis: Fan Control with MSP430FR5969
  • [AirCare] InTheAir - Week 17: Surface Mount Soldering

 

  • Introduction
  • Boosterpack
  • OpenHAB
  • Enclosures
  • Conclusion

 

Introduction

 

I needed to work on a few things before tomorrow's final summary post and challenge deadline. Here's a quick overview.

 

Boosterpack

 

The little boosterpack I soldered last week works! I am able to make more stable measurements using the CC3200's ADC. The Energia sketch was updated to make the conversion back to the actual voltage and then convert it to dust concentration (mg/m3) based on the graph provided in the dust sensor's datasheet.

 

imageimage

 

OpenHAB

 

I've also been working on the OpenHAB config to get all monitored parameters nicely categorized and organized. A debug menu has also been foreseen, providing additional values for troubleshooting purposes.

 

Here are some code snippets to better understand how I've created my openHAB configs.

 

The items file contains the monitored parameters of a remote sensor using MQTT. In the item definition below, you'll see how every item takes the value from a specific MQTT topic. The item file can easily be expanded with new items for extra parameters or extra remote sensors.

 

Group All

String livingroom "Living Room" <sofa>
String office "Office" <office>
String bedroom1 "Bedroom #1" <bedroom>
String bedroom2 "Bedroom #2" <bedroom>

Number FT_Voltage_Period "Chart Period"
Number FT_TimeToEmpty_Period "Chart Period"
Number FT_StateOfCharge_Period "Chart Period"
Number FT_Temperature_Period "Chart Period"
Number DS_Density_Period "Chart Period"
Number DS_Voltage_Period "Chart Period"

Number FT_Voltage "Battery Voltage [%d mV]" (All) {mqtt="<[eclipseIot:cc3200-fvan/voltage:state:default]"}
Number FT_TimeToEmpty "Battery Time to empty [%d min]" (All) {mqtt="<[eclipseIot:cc3200-fvan/tte:state:default]"}
Number FT_StateOfCharge "Battery [%d %%]" <battery> (All) {mqtt="<[eclipseIot:cc3200-fvan/soc:state:default]"}
Number FT_Temperature "Temperature [%d <C2><B0>C] "<temperature> (All) {mqtt="<[eclipseIot:cc3200-fvan/temp:state:default]"}
Number DS_Density "Dust [%.2f mg/m<C2><B3>]" <dust> (All) {mqtt="<[eclipseIot:cc3200-fvan/ddens:state:default]"}
Number DS_Voltage "Dust Voltage [%.2f V]" (All) {mqtt="<[eclipseIot:cc3200-fvan/dvolt:state:default]"}

String Launchpad "Launchpad [%s]" (All) {serial="/dev/ttyO0"}
Switch Socket "Filter" <socket>

 

 

The sitemap structures all the data in the web interface. I opted for a view per room, with every room containing all the monitored parameters. Just like the items file, the sitemap can easily be expanded to contain more rooms.

 

Frame {
        Text item=livingroom {
                Frame {
                        Text item=FT_Temperature valuecolor=[>35="red",>25="orange",>15="green",<15="blue"] {
                                Switch item=FT_Temperature_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
                                Chart item=FT_Temperature period=h refresh=6000 visibility=[FT_Temperature_Period==0, FT_Temperature_Period=="Uninitialized"]
                                Chart item=FT_Temperature period=D refresh=30000 visibility=[FT_Temperature_Period==1]
                                Chart item=FT_Temperature period=W refresh=30000 visibility=[FT_Temperature_Period==2]
                        }
                        Text item=DS_Density {
                                Switch item=DS_Density_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
                                Chart item=DS_Density period=h refresh=6000 visibility=[DS_Density_Period==0, DS_Density_Period=="Uninitialized"]
                                Chart item=DS_Density period=D refresh=30000 visibility=[DS_Density_Period==1]
                                Chart item=DS_Density period=W refresh=30000 visibility=[DS_Density_Period==2]
                        }
                        Text item=FT_StateOfCharge valuecolor=[>79="green",>29="orange",<30="red"] {
                                Switch item=FT_StateOfCharge_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"]
                                Chart item=FT_StateOfCharge period=h refresh=6000 visibility=[FT_StateOfCharge_Period==0, FT_StateOfCharge_Period=="Uninitialized"]
                                Chart item=FT_StateOfCharge period=D refresh=30000 visibility=[FT_StateOfCharge_Period==1]
                                Chart item=FT_StateOfCharge period=W refresh=30000 visibility=[FT_StateOfCharge_Period==2]
                        }
                        Switch item=Socket
                }
                Frame {
                        Text label="Debug" icon="debug" {
                         ...
                         }
               }
     }
}

 

 

The rules files contains some logic to trigger actions depending certain values. For example, when the socket's state is set to ON or OFF a specific value is sent to the MSP430FR5969 Launchpad in order to control the fan with filter. Turning the socket ON or OFF is based on the measured dust concentration.

 

rule "Fan Control"
when
     Item Socket changed
then
      if(Socket.state == ON) {
                sendCommand (Launchpad , "#A")
        } else {
        sendCommand (Launchpad , "#U")
        }
end

rule "Dust Filtering"
when
        Item DS_Density changed
then
        if(DS_Density.state > 0.1) {
                sendCommand (Socket, ON)
        }
        else if(DS_Density.state < 0.05) {
                sendCommand (Socket, OFF)
        }
end

 

 

The events log shows that the fan is triggered to filter when the dust density reached a value higher than 0.1mg/m3.

 

2015-02-26 21:38:30 - DS_Voltage state updated to 3.534719
2015-02-26 21:38:30 - DS_Density state updated to 0.489120
2015-02-26 21:38:32 - Socket received command ON
2015-02-26 21:38:33 - Launchpad received command #A

 

The other way around works as well. When the dust density has reached a normal level again, the filtering system is stopped.

 

2015-02-26 21:40:10 - DS_Voltage state updated to 0.780146
2015-02-26 21:40:10 - DS_Density state updated to 0.030024
2015-02-26 21:40:10 - Socket received command OFF
2015-02-26 21:40:10 - Launchpad received command #U

 

imageimage

 

Enclosures

 

Finally, I've been making progress on the enclosures for both the control unit and the remote sensor. I milled additional "layers" for the control unit, which when combined, result in an enclosure capable of holding all the electronics involved.

imageimage

 

For the remote sensor, I've been running into some issues with my printer. Because the enclosure is too big for my current print platform, I split the part in two. Printing the first part went well and the result was as expected. Things started to go wrong when printing the second part. For some reason, the printer's X-axis is skipping frequently. Why this didn't happen with the first print is a mystery. I've been troubleshooting the issue, but with time running out, alternatives might need to be found. On the bright side, I now know my printer is capable of handling huge bridges without support material, which is rather nice image

 

imageimage

The final enclosures will be revealed in tomorrow's final summary post (because I'm still working on them).

 

Conclusion

 

We're about to enter the last day of the challenge! The solution works, but there are still a few details I'd like to take care of before the final submission. See you tomorrow!

  • Sign in to reply

Top Comments

  • amgalbu
    amgalbu over 10 years ago +1
    Enclosures are really nice!!
  • fvan
    fvan over 10 years ago in reply to amgalbu

    Almost! Once they're finished, they should be even nicer image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • amgalbu
    amgalbu over 10 years ago

    Enclosures are really nice!!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
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