Hello. This is my first forum post, so I hope this is the right place to ask this. This is my first ever Arduino project. I am an engineering student working on a project with some other students. My part requires me to design a base station to receive accelerometer data from an Arduino Nano BLE 33, perform digital signal processing, and then transmit the data to a smartphone app (that will be designed by another student) and laptop simultaneously. I am receiving and transmitting data via BLE, but I need guidance on what is possible and what approaches is best. I am using an Arduino Uno R4 WIFI as my base station. Here are my questions:
I did my research on BLE and did some basic examples on operating BLE. Is it possible for my Arduino to receive and transmit data simultaneously (close as possible to real time)? How can this be done? As mentioned i am receiving data from another Arduino and transmitting it to phone and laptop. Essentially the base station needs to act as a peripheral and central role at the same time.
Is it possible to connect and send data to the phone and laptop simultaneously? What is a way to make this possible? So essentially a peripheral device needs to connect to two central devices.
I would appreciate any help from an experienced individual. Please do let me know if things need clarification or further detail to make answering this easier.
Hey Nick. As i mentioned, I am not experienced with working with this stuff. Everything I'm learning is new to me, so I guess my ability to choose the most optimal solution is not great. I selected BLE so I can keep the method of communication consistent throughout the design. Correct me if I am wrong but I believe I will not be able to use BLE and WIFI at the same time (BLE for receiving and WIFI for transmitting). So that's why I decided to stick with BLE. But if you believe WIFI can work, maybe you can provide some guidance so I can look into it further. Thanks.
Now you've got me....
I believe you are on the wrong tram. The Uno R4 is just a Uno with a WiFi module added, presumably an ESP8266, which implies that, if you want Bluetooth, you have to add a Bluetooth module, most probably on software serial. In that event, the two radios are independent and there would be no problem operating both.
IF your Uno has radio based on ESP32, then yes, your single 2.4 GHz module is used for WiFi Bluetooth and BLE but not at the same time. I don't know if these modules can be reconfigured on the fly. If they are, I guess you could get by with just that. If not, things will get messy but not insurmountable.
Whichever way you have to go, I would suggest that leaving the WiFi out of the game altogether would be inelegant.
the uno-r4-wifi documentation states The UNO R4 WiFi also features an ESP32-S3 for Wi-Fi®/Bluetooth® connectivity, which can also be separately programmed via a specific header.
the Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6 states the ESP32-S3 supports WiFi and BLE 5.0 but as @Nick_Pyner states they use the same radio therefore cannot be used concurrently
if you only receive the information once over BLE you could then enable WiFi and run an Access point/webserver to display the information
if the information is received continuously you will have to receive using BLE and use BLE to communicate with smartphone and laptop
not sure what you will use the RA4M1 processor for - you can probably do the whole project on the ESP32-S3
Yes the goal for me is to receive information continuously so that's why I am aiming to use BLE. However, as i mentioned I was having trouble answering the two questions I mentioned in my original post. I am going to do some digital signal processing so that's why I need the processor. The project involves Parkinson's tremor analysis.
even the BLE part alone is none trivial
how much data/second? I assume you are transmitting in raw binary?
what is the communicating between the RA4M1 and ESP32?
is it undergraduate or postgraduate? how long have you got?
I would tend to do the signal processing on the smartphone which these days have powerful processors and plenty of memory
depends what you mean by 'real time' - how much data/second?
I have sampled sensor data and transmitted 1000bytes/second using BLE to an Android phone for processing using a double buffer
interrupt routine reads sensor data into buffer 1
buffer 2 transmitted over BLE to smart phone
every second switch buffers
never attempted to receive and transmit over BLE at same time
This is an undergraduate 4th year capstone project. I have been doing research for a while now but I have about 4 months to do it (so present it at the end of april). I am planning on having a sampling frequency of 100Hz. As for communication between the ESP32 and RA4M1, I am not too sure about how that works. Since they're on the same board, i assumed there's automatic communication between both. I am aware you can activate/program each individually. I am sure it involves UART or I2C communication between the two. Again this is my first time working with arduino so I am trying my best to learn as much as I can, so I appreciate your time. This might help:
100samples/second over BLE should be OK - depends on the protocol and how many bytes per sample
the application I mentioned in post 8 was sampling human movement using a LSM9DS1_magnetometer sampling evey 20mSec 18bytes of data (6bytes each of magnetometer, accelerometer and gyroscope).
Using double buffering every second a frame of approximatly 1000bytes was transmitted to an Android phone for analysis