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
Bluetooth Unleashed Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Bluetooth Unleashed Design Challenge
  • More
  • Cancel
Bluetooth Unleashed Design Challenge
Blog Bluetooth Challenge - Home Security System - Final Post
  • 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: kedwards@swbell.net
  • Date Created: 20 Jul 2018 11:40 PM Date Created
  • Views 1895 views
  • Likes 9 likes
  • Comments 6 comments
Related
Recommended

Bluetooth Challenge - Home Security System - Final Post

kedwards@swbell.net
kedwards@swbell.net
20 Jul 2018

Hello everyone,

 

This is the final post. Which is good. Now that the project is complete I can think of enough enhancements to keep me busy for another 11 weeks.

 

Goal of this project was to see if I could use Bluetooth technology to implement a home security system. I originally wanted to use Bluetooth BLE for the project. When I saw all of the coding required and the steep learning curve I decided to go with legacy Bluetooth. Considering the small footprint that my HSS application covers there is no real disadvantage for me using legacy Bluetooth modules.

 

Even without Bluetooth BLE I accomplished my goal. I was able to create a network of switches and sensors to monitor and control devices in my house using Bluetooth modules. The application can:

  • Turn lights and appliances on and off.
  • Monitor for CO and Natural Gas leaks.
  • Detect movement within the house.
  • Provides outside camera surveillance.
  • Open and close the garage door.

 

I do have one problem to solve. The video from the cameras are jerky. However, it is not the fault of the cameras, its app, or the BeagleBone black. The problem is my Internet service. I do not have enough upload bandwidth. I have considered upgrading my Internet service but could not cost justify it since the current service was good enough. Now I finally have a good reason to upgrade to a faster speed.

 

Developing and implementing this project in eleven weeks was very challenging. But well worth it. I learned a lot. Although I have developed a lot of web pages and have supported application web servers, I have never created a web server before. Also, I never developed a web page that I could modify without doing a get or post. I think I have done more soldering the past couple of weeks than I have done my entire life.

I did learn a little about Bluetooth BLE and a whole lot about legacy Bluetooth. I learned how difficult it is to use gas sensors. This was the first time I ever implemented a relay. Also, it is the first time I built a circuit using a transistor.

 

The rest of this post covers a demo video, the final hardware list, a list of the software used, the major problems I encountered, what went right during development, and future enhancements. Also, you find the code on GitHub athttps://github.com/kedwards999/BluetoothChallengehttps://github.com/kedwards999/BluetoothChallenge.

 

Congratulations to all of you who finished the Challenge!!!

 

Quote of the Moment –

 

We do these things not because they are easy but because they are hard

     -- John F Kennedy - 35th President of the United States

 

 

 

Previous Bluetooth Challenge Home Security System Posts

 

Bluetooth Challenge - Home Security System - Blog Post I

Bluetooth Challenge - Home Security System - Blog Post II

Bluetooth Challenge - Home Security System - Blog Post III

Bluetooth Challenge - Home Security System - Blog Post IV

Bluetooth Challenge - Home Security System - Blog Post V

Bluetooth Challenge - Home Security System - Blog Post VI

Bluetooth Challenge - Home Security System - Blog Post VII

Bluetooth Challenge - Home Security System - Blog Post VIII

Bluetooth Challenge - Home Security System - Blog Post IX

Bluetooth Challenge - Home Security System - Blog Post X

 

 

Demo

 

 

 

Figure 1 shows what the screen looks like when I have two cameras connected. Since my Internet bandwidth is too low to handle two cameras. I will turn off the Backyard for the demo.

 

 

image

   Figure 1.

 

My video editing skills are null and void so I ended up with 4 separate file for the demo.

 

Video 1 contains the demo for the smart plugs, which control a light and a fan. Note that there is a delay from the time I press the button to manipulate the switch and when the switch activates. The delay is caused by the mechanical relay.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Video 1.

 

 

 

 

Video 2 demonstrates how to open and close the garage door.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Video 2.

 

 

Video 3 demonstrates how the motion sensor works.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Video 3

 

Video 4 Demonstrates how the camera works. The video taken by the camera is jerky due to my Internet service as low bandwidth. Also, notice that the person's face is too dark to identify because it is in the shadows. This camera does not adjust when the background is bright and the object of interest is in the shadows.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Video 4.

 

 

Hardware List

 

Quantity

Device Name

Manufacturer

Part/Model Number

1

BeagleBone Black Wireless

Texas Instruments

BBBWL-SC-562BBBWL-SC-562

7

Pro Trinket - 5V 16MHz

Adafruit

2000

7

HC-05 Bluetooth Module

DSD Tech

HC-05

2

Enclosed High-power Power Relay

Digital Loggers

IoT

1

Emic 2 Text-to-Speech Module

Parallax

#30016

1

Speaker

iHome

iM60

2

Home camera/1080P/WiFi camera/Security camera system

Siepem

G7001Y-WR

1

½” Brass Electric Solenoid Value 12 VDC Normally Open

US Solid

USS2-00078

1

5v Relay Module

Tolako

BJ-DT0Y-001

1

PIR Sensor

Parallax

 

1

MQ-4 Gas Sensor

WINGONEER

JT0796

1

MQ7 Carbon Monoxide Detection Sensor

WINGONEER

JT0794

1

HC-SR04 Ultrasonic Sensor

Sparkfun

SEN-13959

1

Garage Door Remote

Chamberlain

953EV-P

7

Solderless Breadboards

Michael josh

LYSB01DDI54II-ELECTRNCS

7+

To power devices: USB plugs, micro USB to USB cables, AC/DC Adapters. Whatever I had laying around the house.

Different Manufacturers

 

 

 

 

Software

 

  • Arduino Sketch (C++)
  • CSS
  • Bluetoothctl
  • Filezilla
  • HTML
  • jquery-3.3.1
  • javascript
  • nodejs
  • PyBluez
  • pyserial
  • Python 2.7

 

 

 

Problems

 

I planned on using a Bluetooth mesh network. I went on the assumption that I could find a public API for building out a mesh network. I was wrong. I did not find an API. Everyone selling devices that used Bluetooth mesh used a proprietary protocol. Therefore, I could not acquire off-the-shelf Bluetooth enabled devices and connect them to my network. So, I used legacy Bluetooth modules (HC-05). Fortunately, I found a central location in my house that I could place the BeagleBone Black so that all Bluetooth modules could reach the BeagleBone Black in a single hop.

 

I ran out of space on the eMMC so I had to install a version of Linux on a micro SD card and boot from the SD card. It took several attempts for me to find a Debian image that was compatible with all of the software I was using. Then I had to reload the required software onto the new image.

 

I had problems accessing the UARTs on the new image. After a few days I finally figured out the changes I need to make to the /boot/uEnv.txt file.

 

I was going to connect the cameras using Bluetooth but decided against it after reading articles that suggested using Wi-Fi because Bluetooth was too slow. I had problems with the first set of cameras I acquired. I decided on buying different cameras. The new cameras contain more features than the old ones, so it worked out better in the long run.

 

The first smart plug I acquired contained proprietary protocols so I could not connect it to my network. It required me to use the smart plug’s mobile app to use it. I found a High-power Power Relay that was designed to hookup to an Arduino, so I used the Power Relay instead of the smart plug.

 

 

 

What Went Right

 

Other than running out of space (which was my fault) the BeagleBone Black Wireless worked great. I never had any problems with the Wi-Fi or Bluetooth modules. It had enough horsepower to run the HSS application. It never crashed even when I had it running over a week without re-booting.

 

I have no complaints about the Adafruit Pro Trinket either. All seven of them have been working flawlessly.

 

All of the HC-05 Bluetooth module have been working with out a problem. Not to mention, HC-05 is easy to configure.

 

I like the High-power Power Relays. The models I bought have an “always on” plug. I can use that plug to plugin the power source for the Pro Trinket instead of using a battery for a power source.

 

I found that I could power the Adafruit Pro Trinket with a USB charger or any AC/DC adapter that I had laying around. There was no need for me to use batteries or buy additional adapters to power my devices.

 

 

 

Future Enhancements

 

I have a satellite service hooked up to my TV. I noticed during testing that if I power off the set top box the system resets itself, which takes a about 10 minutes. Also, when the TV is powered off it does not automatically display a channel when it is powered back on. Therefore, I think the best approach is to use an IR transmitter to send signals to the TV/set top box. I have used IR for controlling mobile robots and it is not hard to setup.

 

If you noticed in my pictures all of the components are just setting on an open breadboard. I need to build cases for them to protect the components from damage. Also, I need to replace some of the long jumper wires with short wires.

 

Currently, the cameras are controlled by a separate app from the hss devices. I would like to be able to start the camera app from my web page so that I have only one user entry point for the hss application.

 

I used legacy Bluetooth instead of Bluetooth BLE. It worked. I did not have to contend with Bluetooth devices making multiple hops to get to the BeagleBone Black, which made the coding simpler and required less hardware. However, to make the application more robust, at some point I should switch to Bluetooth BLE.

 

I need to encrypt the Bluetooth data to prevent hackers from gaining access to the network. I also should add a log on feature to gain access to the web page.

 

If a Bluetooth device is not open when the hss controller starts the controller program will abort. I should make is more robust by spawning a thread which waits for the Bluetooth device to come online instead of aborting the hss controller.

  • Sign in to reply

Top Comments

  • mcb1
    mcb1 over 7 years ago +2
    Lots of learning and new areas. It's sometimes good to stretch our boundaries, but doing so without adding stress can be difficult. You may be able to find some HC05 units that have an external antenna…
  • genebren
    genebren over 7 years ago +1
    Well done! Everything seems to be working well (given the problems/issues that you had to work around). I found your development to be interesting and inspiring. I have considered building up my own home…
  • aspork42
    aspork42 over 7 years ago +1
    Great job! You built a complete system in just 11 weeks - controller, multiple devices/endpoints - not a small feat! Loved following your posts!
  • kedwards@swbell.net
    kedwards@swbell.net over 7 years ago in reply to genebren

    Hi Gene,

     

    I'm glad you liked my project. If you have any questions or want to bounce some ideas off me for your home security project feel free to contact me.

     

    Thanks,

     

    Keith

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kedwards@swbell.net
    kedwards@swbell.net over 7 years ago in reply to mcb1

    Hi Mark,

     

    During testing I had the Beaglebone on one end of the house and the garage door sensor on the other end. I was surprised that I was still able to operate the garage door with the two units so far apart. I was thinking of adding code to do multiple hops if I needed to. I did not want to add to the complexity of the code if I did not have to. I like your idea though. Extending the range of the Bluetooth modules with an antenna seems a lot easier. If I run into problems in the future I will try that before adding code.

     

    I will check out your link and see if that helps with my bandwidth problem.

     

    Thanks for the tips,

     

    Keith

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kedwards@swbell.net
    kedwards@swbell.net over 7 years ago in reply to aspork42

    Thanks James

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • aspork42
    aspork42 over 7 years ago

    Great job! You built a complete system in just 11 weeks - controller, multiple devices/endpoints - not a small feat! Loved following your posts!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 7 years ago

    Well done!  Everything seems to be working well (given the problems/issues that you had to work around).  I found your development to be interesting and inspiring.  I have considered building up my own home security system, with the goal of utilizing all the existing (wired) sensors and then adding some additional controls/sensors similar to what you have done.

    Thanks for sharing the ideas/thoughts/implementations!

    Gene

    • 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