Hello and thanks for stopping by!
I'm building a simple micro controller with bluetooth BLE project that has so many possibilities in its execution so I would appreciate your opinion on the best approach.
1st Goal: A bluetooth BLE enabled button is pressed, this activates a bluetooth enabled buzzer and LED light.
2nd Goal: A bluetooth BLE enabled buzzer and LED light are activated when the bluetooth enabled button is within a certain range. In other words activation by proximity without the need to press the button.
Hardware: I was thinking of using the esp32 (HuzzAH32) for the bluetooth enabled button as well as for the buzzer and LED light. The reason for this choice is because beyond the activation of the buzzer and LED light on pressing the button, after the 1st goal is achieved I would like to add interaction based on proximity of the button to other bluetooth devices; think a smart beacon like use case.
IDE: Arduino
Bluetooth profile: For the 1st Goal to be achieved the button would the "master" and the buzzer+LED the "slave" and the profile that I think would be ideal is the Hands Free Profile to make the bonding & pairing as simple as possible. I'm not quite sure yet as to how to go about choosing the best profile for the proximity activated use case.
Further Goals: Eventually I would like to port the design to a form and size that would allow the button to be about the size of a quarter coin (think arcade button size) and the buzzer with its LED light neatly packed in a little mint box size enclosure.
What do you think about this? Do you see any problems with my approach? What approach would you suggest? Do you suggest a different micro controller with bluetooth BLE?
Please let me know if you have any questions :)
Your opinion for Arduino & bluetooth BLE project
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- TheMantra514
- Posts: 2
- Joined: Sat Feb 06, 2016 2:09 am
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Your opinion for Arduino & bluetooth BLE project
That has technical problems on its own.TheMantra514 wrote:1st Goal: A bluetooth BLE enabled button is pressed, this activates a bluetooth enabled buzzer and LED light.
BLE really isn't a peer-to-peer communication protocol. It's designed to take tethered devices like keyboards and mice and replace the cable with a wireless data link.
Bluetooth devices are split into 'central' and 'peripheral' categories. Central devices initiate and control data connections, peripherals advertise their presence but otherwise wait for a central to tell them what to do. That arrangement puts most of the cost and complexity into the central, leaving peripherals free to be smaller, simpler, cheaper, etc.
In general, the software necessary to work as a central is too big to fit in a microcontroller. You pretty much need a full-scale computer like a RasPi.
It's vaguely possible to do that with BLE, but the range will vary a lot. It's basically the same problem is trying to make an LED that people can see from 10' away but not from 15' away. The underlying physics make it an extremely hard problem.TheMantra514 wrote:2nd Goal: A bluetooth BLE enabled buzzer and LED light are activated when the bluetooth enabled button is within a certain range. In other words activation by proximity without the need to press the button.
- TheMantra514
- Posts: 2
- Joined: Sat Feb 06, 2016 2:09 am
Re: Your opinion for Arduino & bluetooth BLE project
Hi Mike :)
Thank you for your reply!
Your comments are duly noted.
Taking into consideration the 'central' and 'peripheral' relationship between Bluetooth devices, I think it would be possible to use two Bluefruit nRF52 Feather to achieve my 1st and 2nd goals if one is the 'central' by using the BLEScanner class and the other is the 'peripheral' by using the BLEBeacon or BLEAdvertising class.
To achieve the 1st goal, FeatherA in 'central' mode would activate the buzzer and LED when it receives the advertisement packets sent by FeatherB in 'peripheral' mode, when FeatherB is activated at the press of a button.
The current FAQ’s for the Bluefruit nRF52 confirms that it can be used in ‘central’ mode: https://learn.adafruit.com/bluefruit-nr ... guide/faqs. I think that it should be possible to code a simple sketch that activates the buzzer and LED when specific packets are received.
To achieve the 2nd goal, FeatherA in 'central' mode would activate the buzzer and LED when it receives the advertisement packets sent by FeatherB in 'peripheral' mode. I think that the activation and even the deactivation of the buzzed and LED could be achieved by FeatherA depending on the proximity of FeatherB by using the RSSI value as an indicator of distance as in this example:
https://github.com/adafruit/Adafruit_nR ... _proximity
What do you think?
Thank you for your reply!
Your comments are duly noted.
Taking into consideration the 'central' and 'peripheral' relationship between Bluetooth devices, I think it would be possible to use two Bluefruit nRF52 Feather to achieve my 1st and 2nd goals if one is the 'central' by using the BLEScanner class and the other is the 'peripheral' by using the BLEBeacon or BLEAdvertising class.
To achieve the 1st goal, FeatherA in 'central' mode would activate the buzzer and LED when it receives the advertisement packets sent by FeatherB in 'peripheral' mode, when FeatherB is activated at the press of a button.
The current FAQ’s for the Bluefruit nRF52 confirms that it can be used in ‘central’ mode: https://learn.adafruit.com/bluefruit-nr ... guide/faqs. I think that it should be possible to code a simple sketch that activates the buzzer and LED when specific packets are received.
To achieve the 2nd goal, FeatherA in 'central' mode would activate the buzzer and LED when it receives the advertisement packets sent by FeatherB in 'peripheral' mode. I think that the activation and even the deactivation of the buzzed and LED could be achieved by FeatherA depending on the proximity of FeatherB by using the RSSI value as an indicator of distance as in this example:
https://github.com/adafruit/Adafruit_nR ... _proximity
What do you think?
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Your opinion for Arduino & bluetooth BLE project
The nRF52 is the only board we carry that's capable of operating as a BLE central, so yeah, that's pretty much your only choice if you want to use BLE.
Fair warning in advance: the nRF52 is still a new board, the firmware is under active development right now, and BLE central mode is low on the priority list. There's a demo sketch that shows how to establish a central/peripheral connection with another device, but that's it. Anything beyond that will have to be your own research.
Regarding the RSSI proximity detection code, you can use signal strength as a rough proxy measurement of distance, but the word 'accuracy' barely applies. If you get the same RSSI values with less than +/-5 feet of position error, the system will be working unusually well.
Fair warning in advance: the nRF52 is still a new board, the firmware is under active development right now, and BLE central mode is low on the priority list. There's a demo sketch that shows how to establish a central/peripheral connection with another device, but that's it. Anything beyond that will have to be your own research.
Regarding the RSSI proximity detection code, you can use signal strength as a rough proxy measurement of distance, but the word 'accuracy' barely applies. If you get the same RSSI values with less than +/-5 feet of position error, the system will be working unusually well.
- richardf
- Posts: 45
- Joined: Tue Feb 14, 2012 4:35 pm
Re: Your opinion for Arduino & bluetooth BLE project
I have a few of the nrf51 ble-friends and a few of these feather nrf52.
I need to use Nordics tools for Ble Mesh.
I am trying to determine the relationship between the Nordic tools and the Adafruit libraries.
nordic offers nrf51 and nrf52 development kits.
Would I be able to upload the Ble Mesh from Nordic into these nrf51 and nrf52 Adafruit products?
If not, is that something that Adafruit would have to do (and thus I would have to wait and use the Nordic nrf51 and nrf52 dev kits?
If so, can you briefly describe how?
thanks,
Richard Ferraro
I need to use Nordics tools for Ble Mesh.
I am trying to determine the relationship between the Nordic tools and the Adafruit libraries.
nordic offers nrf51 and nrf52 development kits.
Would I be able to upload the Ble Mesh from Nordic into these nrf51 and nrf52 Adafruit products?
If not, is that something that Adafruit would have to do (and thus I would have to wait and use the Nordic nrf51 and nrf52 dev kits?
If so, can you briefly describe how?
thanks,
Richard Ferraro
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Your opinion for Arduino & bluetooth BLE project
I'm afraid we have no idea. We haven't used that code, and don't use the Nordic SDK.
I'm sure it's possible to load the code onto the nRF52 if you program it through a JTAG pod, but we don't support that kind of programming. Again, that's more in Nordic's realm than ours.
I'm sure it's possible to load the code onto the nRF52 if you program it through a JTAG pod, but we don't support that kind of programming. Again, that's more in Nordic's realm than ours.
- southernskeptic
- Posts: 22
- Joined: Sun Jan 12, 2014 6:42 pm
Re: Your opinion for Arduino & bluetooth BLE project
I'm currently working on a project https://github.com/mmstone/KayakNav which I had hoped I could use BLE, establishing one node as a peripheral (microcontroller and sensors) and the other node as a central, pulling data requests from the peripheral and using that sensor data to provide feedback to the user - who in this case will be blind.
While I understand that BLE is not a peer-to-peer communications solution, using BLE for this project makes it possible that the current HW being used for the central node (with nRF52) can someday be replaced with a smartphone app. The peripheral system (with sensors) has been built and communicates seamlessly with the Bluefruit iOS app, using the UART feature, which is very nice!
However, after looking at the FAQ and reviewing the FORUM, it appears the Bluefruit BLE devices are really meant to be used as peripheral devices - with the exception of the nRF52 - and that is still 'experimental'. Searching github, I found a recent posting https://github.com/OllieBck/BLE_Central_AdafruitNRF52 that appears to provide more central device functionality and will give this sketch a fair go to see if I can get the central device to connect with the peripheral and work for this project.
Fallback plan is to use LoRA or WiFi (ESP8266) for wireless comm.
Any help or advice on how to get the nRF52 working as a central device is greatly appreciated.
Thanks again for all your great products, documentation, customer service and support.
While I understand that BLE is not a peer-to-peer communications solution, using BLE for this project makes it possible that the current HW being used for the central node (with nRF52) can someday be replaced with a smartphone app. The peripheral system (with sensors) has been built and communicates seamlessly with the Bluefruit iOS app, using the UART feature, which is very nice!
However, after looking at the FAQ and reviewing the FORUM, it appears the Bluefruit BLE devices are really meant to be used as peripheral devices - with the exception of the nRF52 - and that is still 'experimental'. Searching github, I found a recent posting https://github.com/OllieBck/BLE_Central_AdafruitNRF52 that appears to provide more central device functionality and will give this sketch a fair go to see if I can get the central device to connect with the peripheral and work for this project.
Fallback plan is to use LoRA or WiFi (ESP8266) for wireless comm.
Any help or advice on how to get the nRF52 working as a central device is greatly appreciated.
Thanks again for all your great products, documentation, customer service and support.
- bigwheels
- Posts: 13
- Joined: Sun Dec 17, 2017 11:30 pm
Re: Your opinion for Arduino & bluetooth BLE project
I have the nRF52 set up as a peripheral, with a smartphone as my central.
When I was programming the nRF52 to work as a peripheral, I read a lot of the documentation on the nRF52, and skimmed the pages on the nRF52 as a central. See the following examples: https://github.com/adafruit/Adafruit_nR ... es/Central
If you plan on someday replacing the nRF52 with a smartphone, why not start out with a smartphone as the central? There is a ton of documentation on creating apps for iOS and Android, so lots of helpful resources available in the event you encounter any roadblocks.
When I was programming the nRF52 to work as a peripheral, I read a lot of the documentation on the nRF52, and skimmed the pages on the nRF52 as a central. See the following examples: https://github.com/adafruit/Adafruit_nR ... es/Central
If you plan on someday replacing the nRF52 with a smartphone, why not start out with a smartphone as the central? There is a ton of documentation on creating apps for iOS and Android, so lots of helpful resources available in the event you encounter any roadblocks.
Please be positive and constructive with your questions and comments.