{"id":1380,"date":"2014-10-17T00:00:02","date_gmt":"2014-10-17T07:00:02","guid":{"rendered":"http:\/\/192.168.3.4\/?p=1380"},"modified":"2018-01-09T06:49:51","modified_gmt":"2018-01-09T14:49:51","slug":"sensor-connectivity-with-bluetooth-le","status":"publish","type":"post","link":"https:\/\/www.cloudacm.com\/?p=1380","title":{"rendered":"Control with Bluetooth LE"},"content":{"rendered":"<p><strong>Introduction &#8211; there is more than one way to get bits from point to point<\/strong><\/p>\n<p>Connecting devices using wired connections can be too complex or costly.\u00a0 The agility of some systems is compromised when hard wiring the components.\u00a0 Modifying becomes labor intensive.\u00a0 This is problematic for systems that are used for research or development.\u00a0 Wireless technology has advanced recently with the release of Bluetooth Low Energy.<\/p>\n<p>Bluetooth LE has brought about a simpler way to connect and control devices. \u00a0Earlier versions of bluetooth were notoriously difficult to pair. \u00a0BLE has made it much easier. \u00a0Also, the LE in the name stands for low energy. \u00a0The longer operation means energy conscience projects that use wireless are feasible now.<\/p>\n<p><strong>Purpose &#8211; when doing it any other way is difficult<\/strong><\/p>\n<p>The project scope\u00a0of wiring the sensor helmet has prompted me to rethink how the sensors will interconnect with the data logging circuitry. \u00a0Although this project has been a lingering legacy, I would like to use BLE for use in a more practical way.<\/p>\n<p>The lighting control on my bike only controls the headlamp currently. \u00a0The helmet light still requires me to remove my hand from the handle bar grips to change modes. \u00a0This is dangerous. \u00a0Using BLE technology will allow me to control both headlights. \u00a0It would also allow me more control and tracking options. \u00a0This project is a good fit for entry into the world of BLE systems.<\/p>\n<p>In this segment, I will propose the use of a platform still in development called <a href=\"http:\/\/bleduino.cc\/\" target=\"_blank\">BLEduino<\/a>.\u00a0 The reasons why were that much of the work has been done by the development group.\u00a0 This will allow me to present the project without getting entagled in the gross specifics.<\/p>\n<p><strong>Detail &#8211; getting it done the way its suppose to<\/strong><\/p>\n<p>The BLEduino website has the title, &#8220;wireless made easy&#8221;.\u00a0 It is the work and dedication of a group called <a href=\"http:\/\/www.kytelabs.com\/\" target=\"_blank\">Kytelabs<\/a> based out of San Juan, Puerto Rico. \u00a0Here is the reason they live up to the title, documentation. \u00a0They have provided a clean starting point for information <a href=\"http:\/\/bleduino.cc\/start\/\" target=\"_blank\">here<\/a>. \u00a0It&#8217;s for this reason I&#8217;ve decided to use it as a development platform, even though the hardware is currently unavailable.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2014\/10\/BLEduino.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1418\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2014\/10\/BLEduino.png\" alt=\"BLEduino\" width=\"294\" height=\"171\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2014\/10\/BLEduino.png 294w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2014\/10\/BLEduino-100x58.png 100w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2014\/10\/BLEduino-150x87.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2014\/10\/BLEduino-200x116.png 200w\" sizes=\"auto, (max-width: 294px) 100vw, 294px\" \/><\/a><\/p>\n<p>In this example we will want to control the headlight on a helmet using the push button on the handlebars. \u00a0This will require that we use 2 BLEduino devices and a smart phone, which will be an iPhone in this example. \u00a0The really interesting aspect of the BLEduino, is how the communications is setup. \u00a0The iPhone will be acting as a communications hub between the 2 BLEduino devices. \u00a0Here&#8217;s how each of these three components will operate.<\/p>\n<p>The bike BLEduino will be hardwired to the handlebar push button and the bike Dinotte headlight. \u00a0Locating it\u00a0with the battery pack, in the rear cargo bag will protect it from the elements. \u00a0It will then relay the push button state to the bike&#8217;s <a href=\"http:\/\/www.dinottelighting.com\/LED_bike_lights\/400l-plus-headlight.htm\" target=\"_blank\">Dinotte 400L PLUS headlight<\/a>. \u00a0Operating the\u00a0Dinotte headlight is specific on how the button is pressed. \u00a0This is predefined by Dinotte manufacturing. \u00a0Here is an overview of the operation:<\/p>\n<ul>\n<li>2 quick button press and releases turns on the headlight<\/li>\n<li>a press and hold turns the headlight off<\/li>\n<li>while on, 2 quick button press and releases changes the headlight operating mode between\u00a0steady and flash<\/li>\n<li>while on, a single\u00a0button press cycles through 3 operating modes.<\/li>\n<li>the steady operating modes\u00a0go from low, normal, and high<\/li>\n<li>the flash operating modes go from slow pulse, fast pulse, and strobe<\/li>\n<\/ul>\n<p>Since the handlebar push button is the central control point, it will also need to link to the helmet headlight. \u00a0I&#8217;m considering using a <a href=\"http:\/\/bike.duque.net\/dinotte-200l-vs-3w.htm\" target=\"_blank\">Dinotte 200L headlight<\/a>, since it has the same operating characteristics as the 400L. \u00a0However, this may \u00a0be over budget for this project. \u00a0My other option is using a modified <a href=\"https:\/\/www.ridepdw.com\/goods\/lights\/spaceship-3\" target=\"_blank\">PDW Spaceship 3<\/a>. \u00a0These are forgiving lights to work with. \u00a0Here is were the challenge of the project comes into place.<\/p>\n<p>Using the Dinotte lets me have seamless control, but will cost more. \u00a0Using the PDW will cost less, but I&#8217;ll need to use complex control logic to match the operating modes of both headlights. \u00a0Modifications shouldn&#8217;t be a factor, <a href=\"http:\/\/www.candlepowerforums.com\/vb\/showthread.php?210005-Dinotte-5W-mod\" target=\"_blank\">I found this post<\/a> detailing a\u00a0Dinotte headlight. \u00a0This could be a deciding factor especially with the possibility to incorporate a 850nm\u00a0<a href=\"http:\/\/www.powerleds.com\/data\/1wirstar.html\" target=\"_blank\">IR LED <\/a>in the Dinotte.<br \/>\n<iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/LRj8whKmN1M\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe>I&#8217;m not sure if either choice will work to stifle Google Glass, but having a modifiable options is going to be essential.<\/p>\n<p>The BLEduino on the helmet will be mounted inside the battery compartment. \u00a0This just makes the most sense. \u00a0It will simplify the headlight modifications and still provide the same functionality.<\/p>\n<p>The BLE communications hub will be the iPhone, mounted on the handlebars. \u00a0The only concern is that both of the BLEduino devices are rear facing, while the iphone is in front of the rider. \u00a0Reliable signal noise levels will be needed in order to operate the system with confidence. \u00a0The alternative is to use move the iPhone back, or provide another communications hub.<\/p>\n<p>The code to operate the system will be simple if both headlights are Dinotte. \u00a0All that will need to be done is pass push button states to output pins, this is super easy code. \u00a0The helmet BLEduino will just match the pin states from what it reads from the BLE hub.<\/p>\n<p><strong>Relations &#8211; how this can be a big deal<\/strong><\/p>\n<p>Since the phone is a central component, it is possible to monitor and log the lighting conditions. \u00a0One idea that comes to mind is creating a heat map\u00a0of the light levels used during a ride. \u00a0Another use would be providing more reliable run time estimates based out planned routes<\/p>\n<p>The run time of the Dinotte headlights are provided by the manufacture, as well as from third party tests. \u00a0The results are a best guess and usually focus on running the light in one mode continuously. \u00a0Having a heat map allows trip planners to plot a route and get estimated use from historical readings.<\/p>\n<p>Using the <a href=\"https:\/\/www.adafruit.com\/products\/1549\" target=\"_blank\">Ada Fruit USB Power Gauge Mini-Kit<\/a> would allow a detailed use of power by the headlights. \u00a0This kit has a serial out of text that details volt, amp, and watt usage. \u00a0It also has the an analog output to that will measure the voltage drop across a shunt resistor. \u00a0For the cost of a lunch, <a href=\"https:\/\/learn.adafruit.com\/adafruit-usb-power-gauge-mini-kit?view=all\" target=\"_blank\">it can enhance the data<\/a> in ways not possible before.<\/p>\n<p><strong>Summary &#8211; no tangled wires<\/strong><\/p>\n<p>Either way, having the ability to control the headlights without sacrificing safety is key. \u00a0I really enjoy the ability to change lighting as I need it. \u00a0Extending this to the helmet headlight is now possible with wireless BLE.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction &#8211; there is more than one way to get bits from point to point Connecting devices using wired connections can be too complex or costly.\u00a0 The agility of some systems is compromised when hard wiring the components.\u00a0 Modifying becomes labor intensive.\u00a0 This is problematic for systems that are used for research or development.\u00a0 Wireless technology has advanced recently with the release of Bluetooth Low Energy. Bluetooth LE has brought about a simpler way to connect and control devices. \u00a0Earlier&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.cloudacm.com\/?p=1380\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,7,5,6,3],"tags":[],"class_list":["post-1380","post","type-post","status-publish","format-standard","hentry","category-android","category-arduino","category-iphone","category-raspberry-pi","category-rd"],"_links":{"self":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/1380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1380"}],"version-history":[{"count":29,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/1380\/revisions"}],"predecessor-version":[{"id":1430,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/1380\/revisions\/1430"}],"wp:attachment":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}