For an university project I need to get data from a sensor connected to an arduino board through Bluetooth. I have an Arduino Uno and a Grove-BLE dual model v1. I’m brand new in BLE communication and I don’t understand how can I retrieve data from my sensor. Could you please help me with this project ?
Thanks in advance
You will have to tell us a lot more about this sensor if you wish to receive help. Can you provide a link to the device’s data sheet?
How is the Grove BLE Dual Module V1 connected to the Arduino? Why did you choose this device to communicate with your sensor and the Arduino?
Sure, it’s an infrared CO2 sensor, here’s the link to the data sheet :
For the Grove BLE Dual Module, I didn’t really choose this device, it’s the one my supervisor provided for this project. Since it’s a Grove module, I’ve connected it to the arduino through the Grove Base shield. The CO2 sensor is also connected through this shield.
If you need further information, please do ask, as i’m new in arduino I don’t know what information would be useful to you.
I do not understand the arrangement of your project and you will need to explain more.
The Winsen MH-Z16 gas sensor has either Serial UART or PWM output and can read directly by the Arduino. Some of these sensors also have an analog voltage output as well. There is no Bluetooth involved in reading this sensor.
What is the role of the BLE module? That Grove dual module also supports standard bluetooth which is more simple to use than BLE. Why do you want to use BLE instead of classic bluetooth since the module supports both?
You say that this is a university project. What level? Do you have any support from a professor or teaching assistant?
Yeah, I was quite unclear about this project, sorry.
The goal is to monitor the evolution of CO2 concentration in classrooms.
At first, there was no BLE device, I just connected the sensor to the arduino, and send the data to my computer through USB cable (Serial monitor ?). All worked fine but that was not very handy, since the arduino had to be physically connected to the computer in order to save the data for later analysis.
So my supervisor gave me the Grove dual module. His idea was to send data on a smartphone via bluetooth, without needing the computer. I’m stuck here cause I don’t know how to use the BLE module to send data to my smartphone.
Also, I want to use BLE instead of classic bluetooth cause the final step for this project will be to use Phyphox app to control all that stuff. I already have some experience with Phyphox so this last step should not be very complicated, but this app supports only BLE and not classic bluetooth.
I hope this explication is better.
I’m a 3rd year student and I don’t usually use arduino. I don’t really have any support, as I have no access to the lab due to lockdown. I can mail my supervisor but he has no knowledge in Arduino either, pandemic force both of us to test new ways of doing our measurements
PS : English is not my native language, sorry if I made some mistakes, I hope it’s still understandable. Thanks a lot for your help, tell me if I need to explain more.
I do not have a Grove module, and without the specific hardware I don’t think I can help you.
There is a section in the linked document to communicate with an iPhone using Light Blue. I believe that there is also an Android version of that app.
Which do you ultimately want to use? iPhone or android phone?
BLE is somewhat complex in my experience and the Grove module with AT interface and no high level library support may not be the best choice. Adafruit has several BLE products and they are well supported. Arduino also makes a Nano33 BLE. I have used the BLE on an ESP32 which is also fairly well supported.
If BLE and phyphox is at the heart of your project you may want to do some research on the best BLE platform, and not just take what was given to you because it was available. Having a platform other than the Uno might also give you the ability to use an additional hardware serial port for the gas sensor.
I understand you are OK with the sensor<>Arduino and can read the data on a PC screen. Your only problem is Bluetooth <> phone app, and this is not an Arduino problem. Arduino merely talks to a serial port and neither knows nor cares what is connected to it on the other side.
First up, you don’t say anything about the phone. It could be that the real reason you need to use a BLE device is because you are stuck with an iPhone. In that event buying, borrowing, begging, or stealing an Android should always be held as a viable option.
Phyphox is just a smarty-farty terminal programme and there cannot be any obligation to use it. It has been around for several years and I find it hard to believe it is BLE only, particularly as it is intended to be used by schoolkids, so I think you should check that out.
As a precaution, check that the Dual Bluetooth can actually be programmed to transmit plain vanilla SPP data. The name and the thickness of the instructions suggests it can be. Furthermore, it may be in a simple data mode by default.
Also as a precaution , check that it can be configured to run SPP in classic Bluetooth. Again it probably can be, but perhaps not by default. If it can be, you have removed any obligation to use Phyphox AND enabled the possibility of using Bluetooth Graphics Terminal as a substitute.
I also suggest you forget Phyphox, at least for the moment, and install the Kai Morich terminal programme, which works in BLE and Classic Bluetooth.
I strongly agree with @Nick_Pyner. Anything you can do to run this project with classic bluetooth with SPP will save you many headaches.