iOS

RadBeacon E: Five Beacons in One

By Tim Judkins

Introducing the NEW RadBeacon E Series

Radius Networks is the leading proximity beacon provider.  The short range, low power, Bluetooth Smart transmitters notify mobile devices when they come within range of a beacon. This micro-location proximity awareness can be leveraged to deliver a wide range of new innovative solutions, such as right-place, right-time customer notifications, precision indoor navigation, automatic ticketing, guided tours, and location-relevant offers and promotions.

The RadBeacon E Series is a family of fully stand-alone Bluetooth proximity beacons that supports iBeaconTM, AltBeaconTM, and EddystoneTM technology. The RadBeacon E is perfect for a wide range of applications such as mobile app engagement, asset tracking, location-based advertising, and more.

Fully Configurable Multi-Beacon Technology

Don't get stuck with IDs from your beacon vendor that might overlap with other deployments.  The RadBeacon E has 5 configurable beacon advertisements, so you can pick the identifiers you want for your project.  As the industry’s first multi-beacon, with concurrent support for all major industry-standard proximity technologies, the RadBeacon enables simultaneous proximity services across iOS, Android, and other emerging mobile environments. Configure it the way you want it using your mobile device with the free RadBeacon App for iOS or Android. Supported beacon proximity technologies include:

  • iBeacon

  • AltBeacon

  • Eddystone UID

  • Eddystone URL


Multiple Form Factors

The RedBeacon E is available in four form factors: E4, E8, Card, and Chip.  

RadBeacon E4

  • Rugged, weatherproof, and temperature-resistant

  • Great general purpose beacon in a small form factor that can be installed virtually anywhere

  • Transmission range up to 100 meters

  • 4 AA batteries (included) - up to 10 year battery life

  • Replaces the discontinued X4

  • FCC, IC & CE Certified

E8_web1.jpg

RadBeacon E8

  • Rugged, weatherproof, and temperature-resistant

  • The perfect beacon for long-term use

  • Transmission range up to 100 meters

  • External antenna

  • 8 D batteries (included) - Decades of battery life

  • FCC, IC & CE Certified

card_web2.jpg

RadBeacon Card

  • Wallet/ID card form factor

  • Great as temporary badges

  • Designed for use on-the-go with a built-in key chain hole

  • Transmission range up to 100 meters

  • Non-replaceable lithium battery - up to 2 year battery life

  • FCC, IC & CE Certified 

Chip_web2.jpg

RadBeacon Chip

  • Portable, lightweight, small in size, and easy to deploy

  • Ideal for short-term applications (asset tracking, facility access, etc.)

  • Transmission range up to 100 meters

  • Non-replaceable lithium battery - up to 9 month battery life

  • Replaces the RadBeacon Dot

  • FCC, IC & CE Certified

 

Learn more about the features of the RadBeacon E Series by visiting the Radius Networks website today: store.radiusnetworks.com.

How to Build a Bluetooth LE On/Off Power Switch

By Michael Harper

In 2017, I purchased my first travel trailer. Soon after, I was also looking to buy a navigation system and a backup camera for the tow vehicle. After some research, I settled on the Garmin RV770 LMT-S GPS and the compatible wireless BC 30 backup camera. The GPS installs on the inside of the tow vehicle’s windshield via suction cup. The backup camera, on the other hand, requires more permanent mounting on the back of the trailer as well as wiring into its 12V circuit. The GPS itself is extremely useful for routing, distance/time estimates, and warnings for upcoming hazards like steep grades and sharp turns. But whenever the backup camera is on (e.g. it has power to it), the GPS screen is entirely taken over by the backup camera. Without some sort of ability to turn the power to the backup camera on and off remotely, the setup is less-than-ideal. Some RVers have wired the backup camera to the running lights on the trailer. This also seems less-than-ideal as whenever the tow vehicle’s headlights were on (when it’s dark out, for example), the camera would also be on, defeating the utility of the GPS. There’s a pin on a 7-pin trailer connector that comes on when the tow vehicle is in reverse. Unfortunately, my travel trailer doesn’t have backup lights. To use this approach in order to make the camera come on only when in reverse, I would have to run a wire from the entire length of the trailer and figure out how to fish it into the location where I need it. If only there were a wireless way to turn the backup camera on and off….

Among my numerous responsibilities as a veteran engineer for Radius Networks, I have written a lot of code for communicating between mobile devices (primarily iOS and Android) and Bluetooth LE devices. Most recently, I wrote the iOS configuration app for the new Radius Networks RadBeacon E line of beacons. The app scans for Radius RadBeacon E devices, sets up a Bluetooth connection, and reads and writes values to and from the beacon’s Bluetooth characteristics. This straightforward approach is applicable to communicating with virtually any Bluetooth LE device, regardless of its function.

Having recently built a Bluetooth LE weather station using an Adafruit Feather 32u4 Bluefruit LE with a variety of environmental sensors, I figured I’d look for a BLE solution to my camera problem. That’s when I found the Adafruit Power Relay FeatherWing which looked like the perfect way to operate my camera from an Adafruit Feather nRF52832. Although my real-world problem is turning a camera on and off, the solution here simply turns a power relay on and off. That is, anything you can SAFELY connect up to this relay can be turned on and off.

You can do this, too.  Here’s everything you need to know:

Prerequisites

  • You need to be at least an intermediate level mobile and firmware developer. Basics of iOS and Arduino development will not be covered here, such as how to create a new project in Xcode or in the Arduino IDE.

  • Although the work here is on iOS/watchOS/tvOS, an experienced Android developer should be able to replicate the approach on Android without difficulty.

  • If you are interested in running the iOS/watchOS/tvOS code presented here in order to connect to your own Feather, you’ll need an actual iOS/watchOS/tvOS device since the simulators do not support Bluetooth.

  • If you want to build your own Feather + relay module, then you’ll need to be comfortable soldering as well as using the Arduino IDE to install firmware onto the Feather.

Materials

Assembling the Feather + FeatherWing

I chose to assemble the Feather with female headers on top of the board.

Screen Shot 2019-02-01 at 3.48.22 PM.png

I then soldered male headers underneath the FeatherWing relay board so they can be assembled as a compact unit.

Screen Shot 2019-02-11 at 8.09.18 PM.png

In order to tell the FeatherWing which pin to use as input to control the relay, you need to bridge the two pads next to the pin underneath the board with a spot of solder. I used A0.

Screen Shot 2019-02-01 at 3.53.27 PM.png

Programming the Feather

Arduino code for the Feather can be found here.

I used the Adafruit Feather nRF52 Bluefruit Library to configure the GATT service and characteristic I needed for controlling the relay. I configured the characteristic for read, write, and notify. Writing 0x01 to the characteristic results in digitalWrite of 0x01 to A0 which in turn closes the relay providing power to the backup camera. Similarly, writing 0x00 to the characteristic opens the relay. Here’s a handy table to explain it all:

Screen Shot 2019-02-01 at 3.55.23 PM.png





I also wasn’t happy with the behavior of the LEDs on the Feather, so I reprogrammed those. Now, whenever there is a Bluetooth connection, the blue LED is on solid. And whenever the board has power, the red LED flashes.

Writing the iOS App

Xcode project can be found here.

I encapsulated the Bluetooth LE conversation and functionality in a singleton class named Kevin (the name of the trailer). All of the peripheral discovery, connection, and conversation take place in that class. Since I expect there to be only one of these devices available, the app automatically connects to the first one it sees during the Bluetooth scan. Other than that, I simply wired up two buttons: one to connect or disconnect the Bluetooth connection, and another button for toggling the state of the relay once connected. Upon disconnecting from the Feather, the relay is automatically opened, turning power off to the backup camera.

Screen Shot 2019-02-01 at 3.57.00 PM.png

Running the App on watchOS and tvOS

By encapsulating the Bluetooth LE functionality, it became a straightforward process to create equivalent apps that run on watchOS and tvOS. You can see these two additional targets in the Xcode project.

Results

Here’s a video of the relay being controlled from the app on my Apple Watch. You can see the red LED come on when the relay is closed and go off when the relay is opened. You may also be able to hear the clicking sound of the relay closing and opening.

Where do you go from here?

Using this project as a starting point, here are a few ideas that might be fun to implement:

  • Add a tactile button so that the relay can be operated manually in addition to using BLE/an app.

  • Add “Hey, Siri” support so that you can say, “Hey, Siri, turn on the backup camera.”

Epilogue

I started this project using an Adafruit nRF52832 Feather. After all was said and done, the board was not connectable from my iPhone when I was outside the trailer, even when I cranked up the transmit power of the nRF52832 to its maximum of +4dBm. I ended up purchasing an Adafruit nRF52840 Feather which not only goes up to a transmit power of +8dBm but also supports Bluetooth 5 “extended range.” Turning the transmit power all the way up to +8dBm did the trick in this case, and I was able to connect to the Feather inside the trailer from my phone inside my tow vehicle no problem! In addition to the higher maximum transmit power and extended range support, the newer Adafruit nRF52840 Feather has a number of improvements over its predecessor. I’d definitely recommend using it over the Adafruit nRF52832 Feather.