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
    About the element14 Community
  • 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
Bluetooth Unleashed Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Bluetooth Unleashed Design Challenge
  • More
  • Cancel
Bluetooth Unleashed Design Challenge
Blog BT_Sentry : Notifications
  • 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: mcb1
  • Date Created: 11 Jul 2018 6:32 AM Date Created
  • Views 2160 views
  • Likes 7 likes
  • Comments 13 comments
  • bluetooth
  • forget-me-not
  • openhab
  • receiver
  • esp8266
  • holiday_of_lights
  • mac
  • rfm6
Related
Recommended

BT_Sentry : Notifications

mcb1
mcb1
11 Jul 2018

This is the 10th of my Blogs for the Bluetooth Unleashed Design Challenge

 

 

The other posts are here :-

BT_Sentry Introduction
BT_Sentry : Zero Emission Detection
BT_Sentry : Data Transmission
BT_Sentry : Sentry Power
BT_Sentry : Raspberry Pi
BT_Sentry : Bluetooth Options
BT_Sentry : Software
BT_Sentry : Bluetooth Sniffing 
BT_Sentry : OpenHAB

 

Concept

The idea is to detect the bluetooth transmitted from the vehicle and signal other Home Automation functions.

If the vehicle is known then it can open the garage door, and inform the home owner that xx is home.

 

Hardware

The detection point needs to be at the start of the driveway, and because there is no power source, this will need to be low power with solar charging.

The PSOC range seems a very good fit, but because of the timeline and my need to upskill, the inital design will be Arduino based and some form of RF transmitter/transceiver.

 

Adding a vehicle detection loop or beam is necessary to ensure those vehicles without bluetooth will also trigger the system.

 

 

Notifications

During the plan, I eluded to providing notifications.

image

 

In my application I wrote :-

If the system doesn't recognise the vehicle, it can :-

  • trigger a survelliance camera to record video and take snapshots.
  • turn on the outside lights
  • inform the houseowner that they have visitors
  • Send a notification to a smartphone

This system also can record when someone visited and for how long, which may prove useful if they have been up to no good.

 

For informing the houseowner, I've been doing some thinking about something that is suitable, and easily conveys what is required.

 

I intially had a plan to use another RaspberryPi and touchscreen to bring up a message.

While this was a possibility, the location within the house needed to be a comprimise, and would not always be useful.

(A bit like the cordless phone that lives on the charger ... and you aren't near the charger)

 

 

As I thought more, I looked at our Internet of Holidays Suppliment Internet of Holiday Lights RoadTest Plus (suppliment)

In that Jan Cumps and fvan created a "I'm home" style indication using MQTT.

 

You can read about it here

[Christmas Wreath of Things] Internet of Holiday Lights: part 10 - Secret IoT Team Up

[Christmas Tree] Internet of Holiday Lights - Special Feature

 

It became an open invitation, but I suspect things have moved on, and no-one is subscribing.

Internet of Holiday Lights: Join the secret IoT Service - open for all

 

MQTT and a small micro just might solve my issue.

 

It was interesting to read the design principles for MQTT.

https://github.com/mqtt/mqtt.github.io/wiki/Design-Principles

 

 

 

 

 

 

ESP8266 or ESP12

This approach using MQTT would suit having multiple indicators around the house, and could even be portable if you wanted.

By using an ESP device, the need for an ethernet connection disappears.

 

 

Hence I searched for ESP8266 and MQTT.

https://techtutorialsx.com/2017/04/09/esp8266-connecting-to-mqtt-broker/

https://www.esp8266.com/viewtopic.php?f=29&t=8746

 

 

The ESP8266 requires the PubSubClient library which can be downloaded from here :-

https://github.com/knolleary/pubsubclient/archive/master.zip

 

 

We've seen a few examples of NodeRED and MQTT, but it seemed an overkill to have to install it just to send a message.

https://randomnerdtutorials.com/esp8266-and-node-red-with-mqtt/

 

 

In the meantime I've had a play with ESP8266 and neopixels.

I found this very good post https://www.hackster.io/thearduinoguy/esp8266-neopixel-ring-clock-a9cc74

 

With a bit of tweaking and a 12 neopixel ring, it makes a very useful object.

 

/* Sketch to run a ESP3266 driven by time.
    This displays on a 12 x neopixel ring
    The colors of the 'hands' are:
    RED = Hours
    GREEN = Minutes
    BLUE = Seconds
    
    credit to https://www.hackster.io/thearduinoguy/esp8266-neopixel-ring-clock-a9cc74   
    TimeClient.h can be obtained from https://github.com/squix78/esp8266-weather-station
    Extract the TimeClient.h and TimeClient.cpp files and add them into the sketch folder (hence the "TimeClient.h")

    Mark Beckett
 */


#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#include "TimeClient.h"

#define PIN D5
int ledsInString = 12;
long lastUpdate = millis();
long lastSecond = millis();

String hours, minutes, seconds;
int currentSecond, currentMinute, currentHour;


char ssid[] = "your SSID";  //  your network SSID (name)
char pass[] = "your password";       // your network password or simply "" if there is none

const float UTC_OFFSET = 12;
TimeClient timeClient(UTC_OFFSET);

Adafruit_NeoPixel strip = Adafruit_NeoPixel(ledsInString, PIN);

void setup()
{
  Serial.begin(115200);
  Serial.println();
  Serial.println();

  strip.begin();
  strip.setBrightness(128);
  strip.show();

  // We start by connecting to a WiFi network
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, pass);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");

  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
  timeClient.updateTime();
  updateTime() ;
  lastUpdate = millis();
  lastSecond = millis();
}

void loop()
{
  if ((millis() - lastUpdate) > 1800000) updateTime();

  if ((millis() - lastSecond) > 1000)
  {

    strip.setPixelColor((currentHour * 1), 0, 0, 0);
    strip.setPixelColor((currentMinute / 5), 0, 0, 0);
    strip.setPixelColor((currentSecond / 5), 0, 0, 0);

    strip.show();
    lastSecond = millis();
    currentSecond++;
    if (currentSecond > 59)
    { currentSecond = 0;
      currentMinute++;
      if (currentMinute > 59) {
        currentMinute = 1;
        currentHour++;
        if (currentHour > 12) currentHour = 0;
      }
    }
    String currentTime = String(currentHour) + ':' + String(currentMinute) + ':' + String(currentSecond);
    Serial.println(currentTime);

    strip.setPixelColor((currentHour * 1), 255, 0, 0);
    strip.setPixelColor((currentMinute / 5), 0, 255, 0);
    strip.setPixelColor((currentSecond / 5), 0, 0, 255);
    strip.show();
  }
}

void updateTime() 
{
  hours = timeClient.getHours();
  minutes = timeClient.getMinutes();
  seconds = timeClient.getSeconds();
  currentHour = hours.toInt();
  if (currentHour >= 12) currentHour = currentHour - 12;
  currentMinute = minutes.toInt();
  currentSecond = seconds.toInt();
  lastUpdate = millis();
}

 

Contrary to popular belief, you can drive the neopixels directly from the 3v3 GPIO of the ESP8266.

I did have to download the latest library from Adafruit.

https://github.com/adafruit/Adafruit_NeoPixel

 

I swapped the order that the pixels are driven so the second hand has priority and overrides the minutes or hours.

image

The time is currently 17:35 and 0 seconds.

 

I guess at some stage a different colour when they illuminate the same pixel might be nice, but in the meantime it works.

 

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

 

The ultimate clock would be the 60 ring neopixel and it's very tempting to do some online shopping .... image

 

My intention is to change the display to all green or all red to warn of impending visitors.

in the meantime the clock display gives some assurance that it's connected and working.

 

 

 

 

 

MQTT Server

Luckily you can run your own server on the Raspberry Pi, which means any messages can be kept within the home network.

 

I found this article which explained the process and how to do some testing.

https://diyprojects.io/mqtt-mosquitto-communicating-connected-objects-iot/

 

I also found this which IMO was much easier to run and install.

It even included a very simple test using the localhost rather than the internet.

https://www.raspberrypi.org/forums/viewtopic.php?t=125532

 

 

 

So now that I seem to have a local Mosquitto running, I'm ready to do some coding on the ESP device.

 

 

 

 

 

 

 

 

Smartphone

My quest to send a SMS to a smartphone has been less than ideal. image

 

We don't run our phones with data, or even WiFi on. We'll turn it on as required, and then turn it off again.

 

There are many reasons, but battery useage is one aspect, and besides I have a phone to ring people, although texting is the other option.

The last thing I need is beeping, burping and all the other noises whenever someone liked a post on FB, or the temperature changed, or some other trivial event.

 

Hence my quest was for a means of sending an SMS to a phone or phones.

 

While there are plenty of free services around, it seems the New Zealand Telcos have blocked any messages that originate outside New Zealand.

I guess it reduces spam, but I suspect it is more to ensure their own service has to be used.

image

Telecom runs eTXT, and while the monthly charge might be reasonable, the setup fee is a rip-off.

 

image

Vodfone had a great affordable service, but clearly that had to change.

 

image

And clearly it did. Again the monthly fee bordering on reasonable, but the setup fee is a rip-off.

 

I did find one service in New Zealand, signed up  and tried it out.

All that effort to find out that it relied on advertising revenue, and it hadn't had any, so it couldn't/wouldn't send the SMS.

GREAT ... worse than that, there is no way to unregister.! image

 

 

While I have no issues with the per text charging, for this project these prices are just not sustainable.

 

 

I could purchase a mobile, get a SIM card and send them without all this cost.

image

I do have a TStick that is designed for data, and I'm wondering if you can use it to send texts?.

 

 

 

Regardless of that, I've decided that I will not be doing this aspect of my proposal.

Image result for minion sad

 

It does not mean that it wouldn't suit someone else.

I looked at had different methods, apps or ways to send the SMS on some of the sites, and they all seem t be different.

You could even scrap the page to gather the information and use one of those free services.

 

If I posted details it could be misleading, and I can't prove it works.

Hence I'll raise it during the summary.

 

 

Mark

  • Sign in to reply

Top Comments

  • mcb1
    mcb1 over 7 years ago in reply to ntewinkel +2
    then noticed I have 16 pixels on the one I have Funny you should say that ... I was playing with the other suggestion about the sketch self adjusting for numbers of pixels, and it wasn't going right. Strangely…
  • ntewinkel
    ntewinkel over 7 years ago in reply to mcb1 +2
    > the sketch self adjusting for numbers of pixels That's cool... and confusing I think we'll just have to go with your idea of 60 neopixels. I was thinking one way to deal with the doubled up second/minute…
  • mcb1
    mcb1 over 7 years ago in reply to ntewinkel +2
    Did you just solder them right onto the little bits that stick out at the top? Yes. I decided sideways to make it easier and less vertical, howver either would work. Top tip. Cut the strip to length, tin…
  • mcb1
    mcb1 over 7 years ago in reply to DAB

    touching the cloud is not without hidden costs.

    I have to agree.

    Hopefully most of this can stay within a home network, and therefore leakage to the world is minimised.

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

    then noticed I have 16 pixels on the one I have

    Funny you should say that ...

    I was playing with the other suggestion about the sketch self adjusting for numbers of pixels, and it wasn't going right.

    Strangely Adafruit don't specify zero or one, and which direction and I kept looking but coldn't see it.

     

    After a while I went back to the normal way and wondered why it jumped a whole bunch .... then the penny dropped it was a 16 pixel ring.

    image

     

     

    ESP Witty? with the pins sticking out sideways?

    I needed to have access to the pins while it was plugged into the serial, so soldered some extras on.

     

    For the text messaging

    I noted that some providers overseas do that, but not ours ...image

     

    cheers

    mark

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 7 years ago

    Nice update.

     

    I have found that touching the cloud is not without hidden costs.

    Absolutely nothing is for free for very long.

     

    DAB

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

    This is becoming quite the big project!

     

    I was thinking of trying that neopixel ring clock, but then noticed I have 16 pixels on the one I have image

     

    What is that magic you added to your ESP Witty? with the pins sticking out sideways?

     

    For the text messaging, I found out that my cell provider allows me to email to my cell phone number and it comes through as a text message - I built a pump monitoring system this way. It sends me text messages regularly (blog posts to hopefully follow soonish). It's basically the same thing as that hummingbird feeder temperature monitor I had set up, with minor modifications.

    The text messaging works by sending email to <phonenumber>@something.provider.com (I don't recall off the top of my head, but also shouldn't be publicly posting the real thing anyways hah!)

     

    Cheers,

    -Nico

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

    Great update on your design challenge project.  I really like all the information you are providing to assist others in a similar project.  I know for me there is a lot to learn if I choose to get started in some of there wireless protocols.

    Thanks for the info and good luck on your project!

    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 © 2026 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