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
Forget Me Not Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Forget Me Not Design Challenge
  • More
  • Cancel
Forget Me Not Design Challenge
Blog Forget Me Not - IQU
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dougw
  • Date Created: 24 Oct 2014 7:26 AM Date Created
  • Views 593 views
  • Likes 1 like
  • Comments 0 comments
  • forget_me_not
  • raspberry
  • window
  • pi
  • doorbell
  • iqu
  • mailbox
  • enocean
  • Design
  • magnetic-sensor
  • smart
  • challenge
  • ir-sensor
  • stm-320
  • door-lock
  • picam
  • stm-332
  • plug-in-switch
  • coffee-maker
Related
Recommended

Forget Me Not - IQU

dougw
dougw
24 Oct 2014

IQU is an entry in the Forget-Me-Not design challenge aimed at demonstrating Enocean sensors and how easy they are to use.

The project intro is here.

I have found the Enocean sensors to be most impressive in wireless sensing, smaller than I expected and powered only by small power scavenging devices.

There is a lot of software available to monitor these sensors, but this project demonstrates how easy it is to program your own applications to use these sensors. The sensors essentially send wireless messages to a host receiver that converts them into serial port messages, so any program that can handle serial port data can listen to sensor messages.

My application program simply displays a house image where the sensors status is an overlay graphic on the appropriate feature of the house. Here is an image of the house with no sensor indicators:

image

Here is a picture of the house showing all sensor indicating: rain, window open, door unlocked, coffee maker on, mail in the mailbox. This method of showing sensor status is intended to be very simple and intuitive.

image

The house sensor status image may also be accessed by a smart phone - shown in a couple of the videos below.

There are videos showing these sensors in action here:

Custom house sensing application written in VB6

Smart Window Video

The project also explored the use of a Raspberry Pi and Pi-Cam as a smart doorbell to view people approaching the house

I made a video explaining how to use Cadsoft Eagle to make a PCB to power a small video display

Conclusion

This project was simply outstanding from the point of view of sponsors supplying a phenomenal kit of materials and instrumentation. We all owe deep gratitude to the sponsors. The challenge subject was very interesting and topical, and there were some spectacular entries with extensive effort. I had difficulties in getting parts I wanted, but I learned a lot and had a great time exploring the technology in my project. I hope the entries from all the contestants have provided inspiration to other readers. I found everything in the supplied kit to be extremely useful and easy to use.

 

Just to illustrate how easy it was to make the Visual Basic application for this project the source code is shown here:

 

' Wireless Home Program

' written by Doug Wong

' 2014

'_______________________________________________________________________________

'

'This program monitors wireless Enocean sensors using an Enocean USB300 Gateway

'and indicates status on an image of a house

'The following sensors are supported:

'Enocean STM320U wireless switch sensor monitoring a window

'Enocean STM330U wireless switch sensor monitoring rain

'Enocean STM330U wireless switch monitoring a doorlock

'Enocean STM330U wireless switch monitoring a mailbox

'Enocean PTM210 wireless self-powered switch monitoring a coffee maker

'_______________________________________________________________________________

Public InBuff As String        ' serial data received from the USB300

Public HouseNum As Integer      ' house image number

 

Private Sub ClearHouse_Click()  ' initiallize the screen to show a house with no sensors detected

    house(HouseNum).Visible = False ' turn off the house image while setting it up

    HouseNum = 0                    ' set house image number to 0

    HNum.Text = "0" ' indicate house number in a text box (invisible except during debugging)

    house(HouseNum).Visible = True  ' show house 0

End Sub

 

Private Sub Form_Load()            ' initiallize the comm port for the USB300 Gateway

  MSComm.CommPort = 4              ' set the comm port number to the number allocated by Windows to the USB300 Gateway

  MSComm.PortOpen = True          ' open the comm port

End Sub

 

Private Sub MSComm_OnComm()                    ' event driven comm port receive routine

    Dim InBuffer As String                      ' buffer to store received characters

    DoEvents                                    ' allow CPU to carry out background tasks

      If MSComm.CommEvent = comEvReceive Then  ' create InBuff string of received characters

          Do While MSComm.InBufferCount > 0    '

            InBuffer = MSComm.Input

          Loop

          InBuff = InBuff & InBuffer

      End If

    Timer1.Enabled = True    ' restart timer1 - if timer 1 times out it means no characters                    ' were received for 1 second indicating a full message has been received

End Sub           

 

Private Sub Timer1_Timer() ' timeout on timer1 occurs when a full message has been received

                                                          ' - time to determine what the message means

    Dim LineNumber, i, ButtonNum, Hdigits, ReedNum As Integer

    Dim ASCnum, DevNum, SideNum, InFID, OutFID, HouseN As String

Timer1.Enabled = False                                ' turn off timer1

                              ' it is not needed again until this message has been handled

    OutFID = "D:\A_work\projects\contests\iqu\web\house.jpg"

                        'set directory where the sensor status (house) image will be stored

    For i = 1 To Len(InBuff)      ' cycle through the message saving several key characters

        ASCnum = Right("00" & Asc(Mid(InBuff, i, 1)), 3) ' get the next character

                                            ' pad with 0's to make debugging table uniform

        If i = 8 Then SideNum = Val(ASCnum)  ' the 8th character indicates which self-powered

                                            ' button caused the message

        If i = 9 Then ReedNum = Val(ASCnum)  ' the 9th character indicates if a reed switch

                                            ' closure caused the message

        If i = 11 Then ButtonNum = Val(ASCnum)  ' 11th byte is collected but not used yet

        If i = 13 Then DevNum = ASCnum          ' the 13th character indicates which type of

                                                ' device caused the message

        LineText = LineText & "  " & ASCnum  ' collect ASCII values of characters

                                            ' for debugging

    Next i

    TLine = LineText                    ' show message as ASCII values for debugging

    InBuff = ""                        ' empty the receive buffer

    house(HouseNum).Visible = False    ' turn house off while updating

    If DevNum = 138 Then                ' rain

        If ReedNum = 0 Then ' momentarily show red dot - indicate a rain message was received

            Sensor(0).BackColor = vbRed

            HouseNum = HouseNum Or 8    ' add rain to the house status number (set "bit 4")

            Timer2.Enabled = True      ' timer2 turns the dot off after a couple of seconds

        Else

            HouseNum = HouseNum And 23 ' remove rain from house status number (reset bit 4)

        End If

    End If

    If DevNum = 129 Then      ' doorlock (if 13th byte is 129 it is a doorlock message)

        If ReedNum = 0 Then    ' momentarily show red dot - a doorlock message was received

            Sensor(1).BackColor = vbRed

            HouseNum = HouseNum Or 2  ' add doorlock to the house status number (set "bit 2")

            Timer2.Enabled = True    ' timer2 turns indicator dot off after a second

        Else

            HouseNum = HouseNum And 29 'remove doorlock from house status number(reset bit2)

        End If

    End If

    If DevNum = 131 Then        ' mail (if 13th byte is 131 it is a mail message)

        If ReedNum = 248 Then ' momentarily show red dot -indicate a mail message received

            Sensor(2).BackColor = vbRed

            HouseNum = HouseNum Or 4  ' add doorlock to the house status number (set "bit 3")

            Timer2.Enabled = True      ' timer2 turns the dot off after a couple of seconds

        Else

            HouseNum = HouseNum And 27  ' remove mail from house status number (reset bit 3)

        End If

    End If

    If DevNum = 128 Then    ' window (if 13th byte is 128 it is a window message)

        If SideNum = 8 Then  ' momentarily show blue dot - a window message was received

            Sensor(3).BackColor = vbBlue

            HouseNum = HouseNum Or 16  ' add window to the house status number (set "bit 5")

            Timer2.Enabled = True      ' timer2 turns the dot off after a couple of seconds

        Else

            HouseNum = HouseNum And 15  'remove window from house status number(reset bit5)

        End If

    End If

    If DevNum = 176 Then      ' coffee (if 13th byte is 176 it is a coffee message)

        If SideNum = 48 Then  ' show blue dot to indicate a coffee on message was received

            Sensor(4).BackColor = vbBlue

            HouseNum = HouseNum Or 1    ' add coffee to house status number (reset bit 1)

        End If

        If SideNum = 16 Then

            Sensor(4).BackColor = vbWhite

            HouseNum = HouseNum And 30  ' remove coffee from house status number(reset bit1)

        End If

    End If

    house(HouseNum).Visible = True      ' show house with active sensor indicators

    If HouseNum > 9 Then Hdigits = 2 Else Hdigits = 1  ' start converting house number to

                                                            ' text for file name

    HouseN = Right("0" + Right(Str(HouseNum), Hdigits), 2)  ' house numbers go from 00 to 31

    InFID = "D:\A_work\projects\contests\IQU\houses\house" + HouseN + ".jpg" ' make file name

    FileCopy InFID, OutFID  ' replace house file with new image showing current sensor status

    HNum.Text = Str(HouseNum)                              ' place house number in text box

End Sub

 

Private Sub Timer2_Timer() ' timer 2 - when it is time to turn off a message indicator dot

    Dim j As Integer

    Timer2.Enabled = False ' turn off timer 2 - not needed until another message is received

    For j = 0 To 3                      ' turn off all indicator dots

        Sensor(j).BackColor = vbWhite

    Next j

End Sub

  • Sign in to reply
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