Difference between revisions of "TrigBoard"

From Kevin Darrah Wiki
Jump to: navigation, search
Line 45: Line 45:
 
* Can "Mute" devices by toggling the Status switch in the dashboard
 
* Can "Mute" devices by toggling the Status switch in the dashboard
 
* Guest Devices by just scanning a QR code, then can enable/disable them as needed.  Like for home security, you could give to a family member while you're out on vacation.   
 
* Guest Devices by just scanning a QR code, then can enable/disable them as needed.  Like for home security, you could give to a family member while you're out on vacation.   
 +
* Great support and a lot of exciting development! 
 
* There are many more useful features in there as well... feel free to experiment!
 
* There are many more useful features in there as well... feel free to experiment!
  
Line 58: Line 59:
 
If you don't see a captive portal, you may need to open your browser and attempt to load a website.  Try to google something.  If you still don't see the portal, then you can try connecting directly to the board - in the browser, type in 192.168.4.1 in the address box.  That should connect you to the portal.  If you're still having problems, try disconnecting the battery from the board and allow the trigBoard SSID to fade away from the available networks on your computer.  Then plug the battery back in and try again.  Seems that on windows this may take more than one try.  I've also seen issues where the computer defaults to the ethernet connection when the WiFi network does not have an internet service.  If you think you're having this problem, just unplug the ethernet cable from your computer.   
 
If you don't see a captive portal, you may need to open your browser and attempt to load a website.  Try to google something.  If you still don't see the portal, then you can try connecting directly to the board - in the browser, type in 192.168.4.1 in the address box.  That should connect you to the portal.  If you're still having problems, try disconnecting the battery from the board and allow the trigBoard SSID to fade away from the available networks on your computer.  Then plug the battery back in and try again.  Seems that on windows this may take more than one try.  I've also seen issues where the computer defaults to the ethernet connection when the WiFi network does not have an internet service.  If you think you're having this problem, just unplug the ethernet cable from your computer.   
  
Click configure, and select the network that you trigBoard to use and enter in the password.  You'll now see where you want to enter in the private Push Safer key.  Then you can give the board a name, and a trigger message.  Once that's entered in, click Save and you're all done!  You should now get a push notification to your phone (when you installed the app, make sure you gave permission).   
+
Click configure, and select the network that you trigBoard to use and enter in the password.  You'll now see where you want to enter in the private Push Safer key.  Then you can give the board a name, and a trigger message.  Once that's entered in, click Save and you're all done!  Once you click save, watch the LED on the trigBoard.  It should start flashing quickly, indicating that the settings were saved and that it was able to connect to that network.  Then, to test, just press the wake button for about a second, or use the sensor switch inputIf all was set up properly, you should get a notification!
  
[[File:captivesetup.png|400px]]
+
[[File:configWifimanager.png|600px]]
 
 
Note - the free version of Pushbullet limits the maximum number of messages per month.  I have so many of these boards installed, that I upgraded... the monthly fee (at the time of writing this) was very reasonable. 
 
  
 
== Operation ==
 
== Operation ==
  
{{#evt:
+
Video coming soon
service=youtube
 
|id=https://youtu.be/37YZulkoMB0
 
|dimensions=560x315
 
}}
 
  
 
== Base Firmware ==
 
== Base Firmware ==
  
Note! the board is preloaded with the base firmware out-of-the-box, but if you want to develop/modify your own firmware, this section will go through the steps for getting the base code to compile.
+
Note! the board is preloaded with the base firmware out-of-the-box, but if you want to develop/modify your own firmware, this section will go through the steps for getting the base code to compile. Then you can develop your own code to run on the trigBoard!!
  
 
Base Firmware Downloads:
 
Base Firmware Downloads:
Line 80: Line 75:
 
  Changes: updated code slightly to work with latest version of libs and ESP core
 
  Changes: updated code slightly to work with latest version of libs and ESP core
 
  Tested on Arduino v1.8.7, ESP core v2.4.2, WiFi Manager v0.14.0, Arduino JSON v5.13.3
 
  Tested on Arduino v1.8.7, ESP core v2.4.2, WiFi Manager v0.14.0, Arduino JSON v5.13.3
 
[http://kevindarrah.com/micro/Pusher/trigBoardRelease_12_18_17.zip Released 12/18/17]
 
Tested on Arduino v1.8.3, ESP core v2.3.0, WiFi Manager v0.12.0, Arduino JSON v5.11.1
 
  
 
Base Firmware Developed on Arduino IDE - can download [https://www.arduino.cc/en/Main/Software Here] or [https://www.arduino.cc/en/Main/OldSoftwareReleases#previous Here for previous versions]
 
Base Firmware Developed on Arduino IDE - can download [https://www.arduino.cc/en/Main/Software Here] or [https://www.arduino.cc/en/Main/OldSoftwareReleases#previous Here for previous versions]
Line 99: Line 91:
  
 
[[File:trigHuzzahSettings.png|400px]]
 
[[File:trigHuzzahSettings.png|400px]]
 
These settings also work:
 
 
[[File:espsettingNodeMCU.png|400px]]
 
  
 
Next, you'll need to install the specific Arduino Libraries I'm using in the base code.  The first one is is the [https://github.com/tzapu/WiFiManager WiFi Manager by tzapu] - the easiest way to install the library is to go to Sketch>>Include Library>>Manage Libraries. Then type in WIFImanager.  Go ahead and install the library.
 
Next, you'll need to install the specific Arduino Libraries I'm using in the base code.  The first one is is the [https://github.com/tzapu/WiFiManager WiFi Manager by tzapu] - the easiest way to install the library is to go to Sketch>>Include Library>>Manage Libraries. Then type in WIFImanager.  Go ahead and install the library.
Line 111: Line 99:
  
 
[[File:ArduinoJSON.png|400px]]
 
[[File:ArduinoJSON.png|400px]]
 +
 +
We're also using the Push Safer library to keep things easy.  You can get that here: https://github.com/appzer/pushsafer-arduino-library
 +
[[File:pushsaferGit.png|400px]]
 +
 +
Download that zip file, then head over to the Arduino IDE, and add zip library:
 +
[[File:addZipLibrary.png|400px]]
  
 
Then that should be it - the other libraries are automatically installed with the ESP8266 board manager.   
 
Then that should be it - the other libraries are automatically installed with the ESP8266 board manager.   

Revision as of 12:58, 21 December 2018

...Back to Projects:

THIS PAGE IS BEING UPDATED TO REV 7 BOARD!!!!

TrigBoardfountain2.jpg

The trigBoard is an IoT project that does one thing - it pushes you a notification triggered by a digital input. Well, it's much more than that, but this is the inspiration. I wanted to design a WiFi board that essentially sleeps most of its life, but when that door switch, flood sensor, motion sensor, etc.. gets triggered, I just want a notification immediately on my phone. And that's about it... a perfect IoT device in the background doing its job.

Latest Release Version 7

TrigBoard overhead.jpg

Looking for Rev4? Go here TrigBoardV4

  • Simple IoT development board that was designed to trigger "Push Notifications" on a smart phone/tablet based on a trigger event.
  • Unique low-power front-end to enable sub 1uA sleep current - uses a pulse to trigger wake-up, so even if door/window/etc is opened, the same ultra low currents can be maintained. Compare to standard pull-up/down resistor based digital input designs with significantly higher leakage current.
  • The board will wake itself up once an hour to check the battery voltage - if running low, a push notification is sent to warn the user. This timer can be used to check other things as well - temperature changes, accelerometers, or other environmental sensors.
  • Based on ESP8266 WiFi Module (ESP-12S) - all source code is available for download and developed in the popular Arduino IDE.
  • Battery Input can be any Lithium Polymer 3.7V - standard micro JST connector jack is used (please double check polarity),any of these would work nicely.
  • Sensor input to trigger the "Wake Up" is a simple passive switch. Typically a standard magnetic door/window switch is used and the board can be configured to wake on the "opening" (Normally Closed) or "closure" (Normally Open) of the contact. Solder jumpers set this - Normally Closed is Default, so standard door/window switches wake the board up when opened.
  • Auto-Reset circuitry built-in, so now with an FTDI USB-Serial Converter, just click "upload" and the board starts programming. Note that this was designed to work with this The_USB_to_Serial_Converter:
  • Expansion pads broken out, so integration with custom projects is possible.
  • Dimensions only 0.8" x 1.6 " (20.32mm x 40.64mm)

TrigBoardV7diagram.png

Purchase trigBoard

Tindie-larges.png

Out of the Box Setup

The setup for getting the trigBoard installed is very easy. The base firmware that comes loaded on the board is ready to work with PushSafer. This makes it so easy to get up and running with the trigBoard. I switched from Pushbullet on the V4 board due to reliability and compatibility issues. Push Safer also has more attractive billing options. Instead of a monthly fee, now you just pay for the amount of notifications you want... when they run out, you just buy more. Best part is that they're super cheap.

PushSafer.png

  1. Push Safer Setup
    1. Go here: https://www.pushsafer.com and register.
    2. Download the mobile app for iOS or Android, and sign in. You can also setup push notifications for your computers as well by installing the browser plugins. You may even like getting the desktop notifications better.
    3. Go back to dashboard and copy your private key

PushSaferKey.png

Notable Push Safer Features:

  • Ability to send test messages from the dashboard
  • Can "Mute" devices by toggling the Status switch in the dashboard
  • Guest Devices by just scanning a QR code, then can enable/disable them as needed. Like for home security, you could give to a family member while you're out on vacation.
  • Great support and a lot of exciting development!
  • There are many more useful features in there as well... feel free to experiment!
  1. trigBoard Setup
    1. You will need a 3.7V Lithium Battery - fully charged will be 4.2V. The battery connects to the trigBoard using a standard micro-JST connector. Any of these would work. Battery estimator calculations coming soon, but I typically use a ~1000mAh battery on all my doors/windows... that yields very long battery life.
    2. Then for the sensor input, this can be a simple passive switch, but I use magnetic door/window sensors like these and then solder the wires to the JST connector. For the JST side, I go with these. It would be nice to find magnetic switches with the JST connectors already soldered on... Also, keep in mind that by default, the board is configured to "Wake" when the contact opens. This is the normally closed mode of operation. If it is desired to wake on a closure of the contact, then see the diagram above and desolder the NC solder jumpers and cut them open with a knife (on this board, I made the jumpers with tiny traces) and solder across the NO jumpers (make sure they are closed). That default NC configuration was chosen because the magnetic door/window sensors are closed when the magnet is in proximity, so the trigBoard wakes up when the door/window is opened.
    3. IMPORTANT - The trigBoard performs a calibration on the built-in timer on power-up. The sensor input must be closed when powered up, otherwise the 1hr timer will not be accurate. You basically just need to have the door/window closed before the battery is plugged in. Sensor should be closed if using NC jumpers, Open if NO jumpers.
    4. Before mounting the trigBoard in it's final location, a simple bench test is helpful to make sure everything is setup. With the battery and sensor plugged in, simply press the "Wake" button on the board. You should see the LED turn on, then turn off. This is normal, because the firmware checks to see if the WiFi settings are configured, and if not, it just goes back to sleep. To enter in the WiFi settings, you have to press and hold the "Wake" button until you see the LED flash, then let go. The LED should remain solid at this point. You now have 2 minutes to configure the trigBoard. From a computer (easier) or mobile device, go to your WiFi settings and search for available networks. Connect to the "trigBoard" network.
      1. A captive portal window should automatically pop up:

TrigBoardcaptive.png

If you don't see a captive portal, you may need to open your browser and attempt to load a website. Try to google something. If you still don't see the portal, then you can try connecting directly to the board - in the browser, type in 192.168.4.1 in the address box. That should connect you to the portal. If you're still having problems, try disconnecting the battery from the board and allow the trigBoard SSID to fade away from the available networks on your computer. Then plug the battery back in and try again. Seems that on windows this may take more than one try. I've also seen issues where the computer defaults to the ethernet connection when the WiFi network does not have an internet service. If you think you're having this problem, just unplug the ethernet cable from your computer.

Click configure, and select the network that you trigBoard to use and enter in the password. You'll now see where you want to enter in the private Push Safer key. Then you can give the board a name, and a trigger message. Once that's entered in, click Save and you're all done! Once you click save, watch the LED on the trigBoard. It should start flashing quickly, indicating that the settings were saved and that it was able to connect to that network. Then, to test, just press the wake button for about a second, or use the sensor switch input. If all was set up properly, you should get a notification!

ConfigWifimanager.png

Operation

Video coming soon

Base Firmware

Note! the board is preloaded with the base firmware out-of-the-box, but if you want to develop/modify your own firmware, this section will go through the steps for getting the base code to compile. Then you can develop your own code to run on the trigBoard!!

Base Firmware Downloads:

Released 10/08/18
Changes: updated code slightly to work with latest version of libs and ESP core
Tested on Arduino v1.8.7, ESP core v2.4.2, WiFi Manager v0.14.0, Arduino JSON v5.13.3

Base Firmware Developed on Arduino IDE - can download Here or Here for previous versions

Then you'll find that the code does not compile and that's because you need several libraries and the board manager installed. Here's what you need:

First, go to File>>Preferences and add this URL to to the "Additional Boards Manager URL". http://arduino.esp8266.com/stable/package_esp8266com_index.json

BoardsManagerURLnewCore.png

Now, the ESP8266 boards will be available for installation. Go to Tools>>Board>>Boards Manager... Search for ESP8266, and go ahead and click install.

ESP8266Install.png

After the boards are installed, you can select any of the ESP8266 boards out there from the Board Selection. For the trigBoard, I have been using the Adafruit Huzzah, here are my settings. Note that I always upload as fast as possible:

TrigHuzzahSettings.png

Next, you'll need to install the specific Arduino Libraries I'm using in the base code. The first one is is the WiFi Manager by tzapu - the easiest way to install the library is to go to Sketch>>Include Library>>Manage Libraries. Then type in WIFImanager. Go ahead and install the library.

WiFiManager.png

Do the same for the Arduino JSON library by Benoit Blanchon - can just search for JSON.

ArduinoJSON.png

We're also using the Push Safer library to keep things easy. You can get that here: https://github.com/appzer/pushsafer-arduino-library PushsaferGit.png

Download that zip file, then head over to the Arduino IDE, and add zip library: AddZipLibrary.png

Then that should be it - the other libraries are automatically installed with the ESP8266 board manager.

See the "Testing and Programming" section below for information on loading the code over a wired USB-Serial connection. The other option is to load code wirelessly "OTA - Over the Air". In the "trigBoard Operation" section this is shown.

Projects

WeatherBoard BME280 and LMT01 Weather Station

EPaperBoard E-Paper Display

CameraBoard Camera System with Arducam

Testing and Programming

Note that the USB-Serial Converter that I designed is known to work - other versions of it may not. Here is the wiki page for the USB-Serial Board: The_USB_to_Serial_Converter:

The sequence for for configuring the board into programming mode with the buttons is as follows:

TrigBoardButtonSequence.png

Note that it may take a few tries to get it to upload, so don't give up if it fails after a few tries, I personally load code onto every board that ships, so I know it's possible.

Tutorials

V4 Hardware Walkthrough

Sending to SLACK

Clear Sky Checker - openweathermap.org

CODE IS HERE: http://kevindarrah.com/micro/Pusher/trigBoardOpenWeather.zip

Add a Camera

Go to the CameraBoard page

Schematic

TrigBoardv4SCH.png

Disclaimer

I'm just a guy who designs boards, so I'll try my best to support you as much as I can and provide tutorials as I have time for. Every board that is sold has been functionally tested, so that they can be programmed, the sleep current is right, they can be woken up, the battery voltage measurement is "close", and active current is consistent with a working board. Also, these boards are for educational, hobbyists, DIYer, maker, and development use only. If you are interested in working this board into your product, please contact me for more information