Lesson 14 Transmitting BLE Data from Arduino BLE 33 Sense

  Переглядів 7,386

Coding Scientist

Coding Scientist

2 роки тому

In this lesson I will show you how to enable your inbuilt Bluetooth Sensor and install few libraries. After uploading the codes, I will also show you how to connect to a mobile phone and start reading various Sensor data being transmitted from Arduino 33 BLE Sense. I will also show you how to capture various sensor data, export the data in CSV format for Machine Learning and IoT purpose.
For this lesson, you will need to down the below mobile app.
For iOS : apps.apple.com/us/app/nrf-con...
For Android: play.google.com/store/apps/de...
Project Source Codes : github.com/AnbuKumar-maker
Contact us for more projects: info@codingscientist.com
WhatsApp Support: +91-99725-77735
About us: www.codingscientist.com
Hackster Community: www.hackster.io/anbu-kumar
LinkedIn: / codingscientist
Facebook: / coding.scientist
Twitter: / robo_thoughts

КОМЕНТАРІ: 33
@redstone51
@redstone51 21 день тому
Excellent post Sir!!!🙏👌
@andrearomeroramos6586
@andrearomeroramos6586 Рік тому
how to export the data to csv format?
@farshidowrang2762
@farshidowrang2762 Рік тому
#include // Bluetooth Library #include // Pressure Sensor Library #include // Temperature Sensor Library #include // Magnetometer Sensor Library // Initalizing global variables for sensor data to pass onto BLE String p, t, m; // BLE Service Name BLEService customService("180C"); // BLE Characteristics // Syntax: BLECharacteristic (, , ) BLEStringCharacteristic ble_pressure("2A56", BLERead | BLENotify, 13); BLEStringCharacteristic ble_temperature("2A57", BLERead | BLENotify, 13); BLEStringCharacteristic ble_magnetic("2A58", BLERead | BLENotify, 20); // Function prototype void readValues(); void setup() { // Initalizing all the sensors HTS.begin(); BARO.begin(); IMU.begin(); Serial.begin(9600); while (!Serial); if (!BLE.begin()) { Serial.println("BLE failed to Initiate"); delay(500); while (1); } // Setting BLE Name BLE.setLocalName("Arduino Environment Sensor"); // Setting BLE Service Advertisment BLE.setAdvertisedService(customService); // Adding characteristics to BLE Service Advertisment customService.addCharacteristic(ble_pressure); customService.addCharacteristic(ble_temperature); customService.addCharacteristic(ble_magnetic); // Adding the service to the BLE stack BLE.addService(customService); // Start advertising BLE.advertise(); Serial.println("Bluetooth device is now active, waiting for connections..."); } void loop() { // Variable to check if cetral device is connected BLEDevice central = BLE.central(); if (central) { Serial.print("Connected to central: "); Serial.println(central.address()); while (central.connected()) { delay(200); // Read values from sensors readValues(); // Writing sensor values to the characteristic ble_pressure.writeValue(p); ble_temperature.writeValue(t); ble_magnetic.writeValue(m); // Displaying the sensor values on the Serial Monitor Serial.println("Reading Sensors"); Serial.println(p); Serial.println(t); Serial.println(m); Serial.println(" "); delay(1000); } } Serial.print("Disconnected from central: "); Serial.println(central.address()); } void readValues() { // Reading raw sensor values from three sensors float x, y, z; float pressure = BARO.readPressure(); float temperature = HTS.readTemperature(); if (IMU.magneticFieldAvailable()) { IMU.readMagneticField(x, y, z); // Saving sensor values into a user presentable way with units p = String(pressure) + " kPa"; t = String(temperature) + " C"; m = "X:" + String(x) + ", Y:" + String(y); } }
@farshidowrang2762
@farshidowrang2762 Рік тому
is the following code, the correct one?
@Joe_Ngaruiya
@Joe_Ngaruiya 8 місяців тому
great video prof ...now once i receive data from the sensors how can i control like if the temperature is 20'c and am interested on 30'c .is it possible i control a thermostat using this sensor data automatically ?
@CodingScientist
@CodingScientist 8 місяців тому
Yes its possible, complex circuit, code and libs will be needed
@VinodPatel-tb8ii
@VinodPatel-tb8ii Рік тому
Great video, just the thing I was looking for to transmit data to my android phone. I was able to see the data on my phone, but could not figure-out how to plot the data. If you could (or anyone), please, provide instructions on how to plot the data. Thanks, Vinod
@CodingScientist
@CodingScientist Рік тому
Hello, thanks, plotting data is there in one of my series 👍
@WarlockSRB
@WarlockSRB Рік тому
@Kumar I have a little problem with my coding, did try a lot of stuff, but sadly cannot make this board be recognized by PC (Asus USB-BT400 dongle) as HID device (joystick with 6 axis). I've tried to simply connect to PC via BT/BLE and still no go for sending data. If you don't mind, please make a simple example of this board using BT/BLE for connecting to PC, would like to have it as virtual COM, or HID device. Thanks and keep it up...
@CodingScientist
@CodingScientist Рік тому
Looks like a BT driver issue in your PC, try updating the drivers and check once pls😃
@lephuckhuong441
@lephuckhuong441 Рік тому
graet video, i'm using a similar sensor to this and it has BLE connection too. I wonder if there could be a way to sent data from the device directly to Windows using BLE connection?
@CodingScientist
@CodingScientist Рік тому
Yes its possible 👍
@jamalalhourani9371
@jamalalhourani9371 10 місяців тому
@@CodingScientist Hi, is there a video that shows how to send data to windows using BLE?
@farshidowrang2762
@farshidowrang2762 Рік тому
C:\Users\Documents\Arduino\MyBLE\MyBLE.ino:55:6: note: 'void loop()' previously defined here void loop()
@farshidowrang2762
@farshidowrang2762 Рік тому
🙏🙏🙏
@farshidowrang2762
@farshidowrang2762 Рік тому
C:\Users\Documents\Arduino\MyBLE\MyBLE.ino:21:6: note: 'void setup()' previously defined here void setup()
@rantheone9789
@rantheone9789 3 місяці тому
can you please show how to send simple data from peripheral ble33 device to central ble33 device using the ble setup? simple code:( i just dont see anywhere
@CodingScientist
@CodingScientist 3 місяці тому
This needs to be built from scratch👍
@PartyshopChile
@PartyshopChile 2 роки тому
I can not find the code in the github link, is there any shorcut? I will be gratefull
@CodingScientist
@CodingScientist 2 роки тому
github.com/AnbuKumar-maker/Machine-Learning-on-Arduino-33-BLE-Sense
@muhammadzulkifli7675
@muhammadzulkifli7675 Рік тому
excuse me Profesor, I need to transer data from BLE 33 sense to Google Firebase, How is it?
@CodingScientist
@CodingScientist Рік тому
Yes it can be done
@sebastienmenot664
@sebastienmenot664 4 місяці тому
Hello, where can I find the code please ?
@CodingScientist
@CodingScientist 4 місяці тому
github.com/AnbuKumar-maker/Machine-Learning-on-Arduino-33-BLE-Sense
@sebastienmenot664
@sebastienmenot664 4 місяці тому
Thank you a lot! Great lessons!
@santoshkamble1290
@santoshkamble1290 2 роки тому
Hello Sir, please share the code link
@CodingScientist
@CodingScientist 2 роки тому
Its in my GitHub link provided in the video comments
@PartyshopChile
@PartyshopChile 2 роки тому
#include // Bluetooth Library #include // Pressure Sensor Library #include // Temperature Sensor Library #include // Magnetometer Sensor Library // Initalizing global variables for sensor data to pass onto BLE String p, t, m; // BLE Service Name BLEService customService("180C"); // BLE Characteristics // Syntax: BLECharacteristic (, , ) BLEStringCharacteristic ble_pressure("2A56", BLERead | BLENotify, 13); BLEStringCharacteristic ble_temperature("2A57", BLERead | BLENotify, 13); BLEStringCharacteristic ble_magnetic("2A58", BLERead | BLENotify, 20); // Function prototype void readValues(); void setup() { // Initalizing all the sensors HTS.begin(); BARO.begin(); IMU.begin(); Serial.begin(9600); while (!Serial); if (!BLE.begin()) { Serial.println("BLE failed to Initiate"); delay(500); while (1); } // Setting BLE Name BLE.setLocalName("Arduino Environment Sensor"); // Setting BLE Service Advertisment BLE.setAdvertisedService(customService); // Adding characteristics to BLE Service Advertisment customService.addCharacteristic(ble_pressure); customService.addCharacteristic(ble_temperature); customService.addCharacteristic(ble_magnetic); // Adding the service to the BLE stack BLE.addService(customService); // Start advertising BLE.advertise(); Serial.println("Bluetooth device is now active, waiting for connections..."); } void loop() { // Variable to check if cetral device is connected BLEDevice central = BLE.central(); if (central) { Serial.print("Connected to central: "); Serial.println(central.address()); while (central.connected()) { delay(200); // Read values from sensors readValues(); // Writing sensor values to the characteristic ble_pressure.writeValue(p); ble_temperature.writeValue(t); ble_magnetic.writeValue(m); // Displaying the sensor values on the Serial Monitor Serial.println("Reading Sensors"); Serial.println(p); Serial.println(t); Serial.println(m); Serial.println(" "); delay(1000); } } Serial.print("Disconnected from central: "); Serial.println(central.address()); } void readValues() { // Reading raw sensor values from three sensors float x, y, z; float pressure = BARO.readPressure(); float temperature = HTS.readTemperature(); if (IMU.magneticFieldAvailable()) { IMU.readMagneticField(x, y, z); // Saving sensor values into a user presentable way with units p = String(pressure) + " kPa"; t = String(temperature) + " C"; m = "X:" + String(x) + ", Y:" + String(y); } }
@farshidowrang2762
@farshidowrang2762 Рік тому
I get an error: exit status 1 Compilation error: redefinition of 'void setup()'
@CodingScientist
@CodingScientist Рік тому
Reboot
@farshidowrang2762
@farshidowrang2762 Рік тому
Using board 'nano33ble' from platform in folder: ... Compilation error: redefinition of 'void setup()'
@farshidowrang2762
@farshidowrang2762 Рік тому
@@CodingScientist Yes I have rebooted my computer. Maybe I need a newer version of library
ESP32 gets data from Xiaomi Thermometers using BLE
11:38
Volos Projects
Переглядів 10 тис.
Lesson 0 Machine Learning on Arduino BLE Sense
12:53
Coding Scientist
Переглядів 14 тис.
You’ve Never Seen A Race Like This 🚀
00:21
Red Bull
Переглядів 39 млн
Master BLE Basics in Just 10 Minutes: The Ultimate Guide!
9:15
Novel Bits
Переглядів 86 тис.
Bluetooth Arduino RECEIVE data + Chart
9:26
Electronoobs
Переглядів 300 тис.
Using the accelerometer and gyroscope on your Nano 33 BLE
9:40
Scott Fitzgerald
Переглядів 13 тис.
Уроки Arduino #2 - работа с монитором COM порта
7:03
Заметки Ардуинщика
Переглядів 701 тис.
Reverse Engineering Bluetooth Low Energy (BLE) Devices
59:52
Elektor TV
Переглядів 3 тис.
Power AC Coolness with Anker SOLIX F3800
0:27
Anker SOLIX
Переглядів 3,4 млн
Result of the portable iPhone electrical machine #hacks
1:01
KevKevKiwi
Переглядів 4,8 млн
Iphone yoki samsung
0:13
rishton_vines😇
Переглядів 9 млн
Phone charger explosion
0:43
_vector_
Переглядів 7 млн