Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

BLE basic setup for pressure sensor application
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BLE basic setup for pressure sensor application

by AutoRedialer on Wed Dec 04, 2019 7:25 pm

Hi everyone,

I've been working on a project where the main objective is to build a pressure sensing monitor and alarm system using a fluid pressure sensor, a buzzer, and wireless data acquisition system. I've so far managed to wire my pressure sensor, buzzer, and a SD-card data logger, but I can't read the values in real time without being connected to the Arduino serial monitor/plot. So now I think I'm ready to being implementing Bluetooth LE. Only problem is...I'm a complete newbie to Bluetooth, and I think I need help.

Objective: I want to set up my main board as a peripheral with my (iOS) phone as a client. I would like to be able to (1) read the data from my pressure sensor on a plot in NRF-Connect or other suitable app.

Main Questions: Is creating a custom GATT protocol the only way to proceed? If yes, how should I proceed?

Hardware: I'm using a Adafruit nrf52 Feather, a RTC and SD Datalogger Feather Wing, and a breakout board with a buzzer and a header for the pressure sensor to connect.

Software: Only the Arduino IDE with the relevant Adafruit libraries

What I've Tried: Basically I've tried looking at every example I could find and can't seem to figure out how I'm suppose to proceed. I've been crashing through bluetooth literature and trying to wrap my head around GATT Services and characteristics and how to apply it to my system. Do I need to create a custom GATT protocol? Is this the easiest way to work with Bluetooth?

Please, any help or mere insight into my objective would be greatly appreciated. Thank you.

AutoRedialer
 
Posts: 2
Joined: Wed Dec 04, 2019 7:24 pm

Re: BLE basic setup for pressure sensor application

by oesterle on Wed Dec 04, 2019 7:43 pm

Hi, AutoRedialer!

I'd check out Trevor Beaton's tutorial in the Adafruit Learning System:

The guide refers to Adafruit's other nRF51-based products, but you should be able to use the examples in the Arduino IDE when your board is selected. I think the one that will work with this guide is:
File > Examples > Examples for Adafruit Bluefruit Feather nRF52832 > Adafruit Bluefruit nRF52 Libraries > Peripheral > bleuart

Cheers,

Eric

oesterle
 
Posts: 763
Joined: Tue Sep 17, 2013 11:32 pm

Re: BLE basic setup for pressure sensor application

by PWK on Fri Dec 06, 2019 1:31 pm

Hi, AutoRedialer!

I have been working on a similiar project using a Bluefruit LE nrf52832 and a IR sensor. My project counts pulses from the sensor and sends them to my android phone using LE connect and the bleuart peripheral example. It runs off a LIPO battery , so the level of the battery percent remaining is also sent to the phone. I found the LE connect app easier to use than the NRF connect. LE connect also has a plotter option that I plan on using. I also read about creating a custom GATT protocol but that seemed way to complicated for my needs. So software wise I basically built my project around the bleuart peripheral example. Hope this helps.

Paul

PWK
 
Posts: 32
Joined: Wed Mar 06, 2019 9:08 am

Re: BLE basic setup for pressure sensor application

by AutoRedialer on Tue Dec 10, 2019 12:45 am

Thank you both for your responses. I'll look to starting with the bleuart example code.

PWK wrote:Hi, AutoRedialer!

I have been working on a similiar project using a Bluefruit LE nrf52832 and a IR sensor. My project counts pulses from the sensor and sends them to my android phone using LE connect and the bleuart peripheral example. It runs off a LIPO battery , so the level of the battery percent remaining is also sent to the phone. I found the LE connect app easier to use than the NRF connect. LE connect also has a plotter option that I plan on using. I also read about creating a custom GATT protocol but that seemed way to complicated for my needs. So software wise I basically built my project around the bleuart peripheral example. Hope this helps.

Paul


Hi Paul, would it be possible to share this sketch?

AutoRedialer
 
Posts: 2
Joined: Wed Dec 04, 2019 7:24 pm

Re: BLE basic setup for pressure sensor application

by PWK on Wed Dec 11, 2019 1:43 pm

Hi, AutoRedialer,

My sketch is very long and I think it would confuse you more than help you. My suggestion is take the Peripheral Bleuart example code, remove the existing void loop and add this one.
void loop()
{
bleuart.print(yourPressureDataVariable); bleuart.print ( " PSI");
bleuart.print ('\r');
delay(1000);
}
Then take your existing code you wrote for sending pressure data to serial monitor and add it to this sketch. Update the bleuart.print statement with yourPressureDataVariable.
Open the LE Connect app. , connect to Bluefruit 52, click on UART and you should see the pressure displayed. Once you are able to accomplish that step, then try to plot the data.

Paul

PWK
 
Posts: 32
Joined: Wed Mar 06, 2019 9:08 am

Re: BLE basic setup for pressure sensor application

by ATSa on Fri Jun 26, 2020 4:10 pm

Hi Autoredialer

How is your project coming along? Do you have any code to share?

Have been working on a similar datalogger project using a Adafruit Feather 32u4 Bluefruit, a TSL2591 sensor, a SEN0193 sensor, a DHT22 sensor, and a RTC/SD card shield/Adalogger Featherwing. The datalogger provides sensor data via serial monitor, SD card, and iPhone via the Adafruit Bluefruit LE Connect App.

Datalogger project code is located on github
https://github.com/AnchorageBot/YouTube/blob/master/BluFeatherDataloggerComplete

The Bluefruit LE Connect App Guide was pretty helpful
https://learn.adafruit.com/bluefruit-le-connect?view=all

ATSa
 
Posts: 13
Joined: Sun Mar 03, 2019 3:00 pm

Please be positive and constructive with your questions and comments.