The Alpha Geek – Geeking Out

Programming

Project #26 – Radio Frequency – Bluetooth GPS Receiver GP-20U7 – Mk24

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #GPS #SparkFun #BME280 #CCS811 #IMU #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth GPS Receiver GP-20U7

——

Bluetooth GPS Receiver GP-20U7

——

Bluetooth GPS Receiver GP-20U7

——

GPS Receiver – GP-20U7 (56 Channel)

The GP-20U7 is a compact GPS receiver with a built-in high performances all-in-one GPS chipset. The GP-20U7 accurately provides position, velocity, and time readings as well possessing high sensitivity and tracking capabilities. Thanks to the low power consumption this receiver requires, the GP-20U7 is ideal for portable applications such as tablet PCs, smart phones, and other devices requiring positioning capability. With 56 channels in search mode and 22 channels “All-In-View” tracking, the GP-20U7 is quite the work horse for its size.

DL2307Mk05

1 x SparkFun Thing Plus – ESP32 WROOM
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 – Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout – CCS811
1 x Pololu AltIMU-10 v5
1 x GPS Receiver – GP-20U7
1 x Lithium Ion Battery – 850mAh
2 x SparkFun Cerberus USB Cable

SparkFun Thing Plus – ESP32 WROOM

LED – LED_BUILTIN
SDA – Digital 23
SCL – Digital 22
GPR – Digital 16
GPT – Digital 17
RX2 – Bluetooth
TX2 – Bluetooth
VIN – +3.3V
GND – GND

——

DL2307Mk05ps.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth GPS Receiver GP-20U7 - Mk24
26-24
DL2307Mk05pr.ino
1 x SparkFun Thing Plus - ESP32 WROOM
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout - CCS811
1 x Pololu AltIMU-10 v5
1 x GPS Receiver - GP-20U7
1 x Lithium Ion Battery - 85mAh
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Bluetooth Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
// Two Wire Interface (TWI/I2C)
#include <Wire.h>
// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
#include <SparkFunBME280.h>
// SparkFun CCS811 - eCO2 & tVOC
#include <SparkFunCCS811.h>
// Includes and variables for IMU integration
// STMicroelectronics LSM6DS33 gyroscope and accelerometer
#include <LSM6.h>
// STMicroelectronics LIS3MDL magnetometer
#include <LIS3MDL.h>
// STMicroelectronics LPS25H digital barometer
#include <LPS.h>
// GPS Receiver
#include <TinyGPS++.h>
// ESP32 Hardware Serial
#include <HardwareSerial.h>

// Bluetooth Serial
BluetoothSerial SerialBT;

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
BME280 myBME280;
float BMEtempC = 0;
float BMEhumid = 0;
float BMEpressure = 0;
float BMEaltitudeM = 0;
String FullString = "";

// SparkFun CCS811 - eCO2 & tVOC
// Default I2C Address
#define CCS811_ADDR 0x5B 
CCS811 myCCS811(CCS811_ADDR);
float CCS811CO2 = 0;
float CCS811TVOC = 0;
String FullStringA = "";

// 9DoF IMU
// STMicroelectronics LSM6DS33 gyroscope and accelerometer
LSM6 imu;
// Accelerometer and Gyroscopes
// Accelerometer
int imuAX;
int imuAY;
int imuAZ;
String FullStringB = "";
// Gyroscopes 
int imuGX;
int imuGY;
int imuGZ;
String FullStringC = "";
// STMicroelectronics LIS3MDL magnetometer
LIS3MDL mag;
// Magnetometer
int magX;
int magY;
int magZ;
String FullStringD = "";
// STMicroelectronics LPS25H digital barometer
LPS ps;
// Digital Barometer
float pressure;
float altitude;
float temperature;
String FullStringF = "";

// ESP32 HardwareSerial
HardwareSerial tGPS(2);

// GPS Receiver
#define gpsRXPIN 16
// This one is unused and doesnt have a conection
#define gpsTXPIN 17
// The TinyGPS++ object
TinyGPSPlus gps;
// Latitude
float TargetLat;
// Longitude
float TargetLon;
String FullStringG = "";
// GPS Date, Time, Speed, Altitude
// GPS Date
String TargetDat;
// GPS Time
String TargetTim;
// GPS Speeds M/S
String TargetSMS;
// GPS Speeds Km/h
String TargetSKH;
// GPS Altitude Meters
String TargetALT;
// GPS Status
String GPSSt = "";
String FullStringH = "";

// Software Version Information
String sver = "26-24";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
  isBME280();

  // SparkFun CCS811 - eCO2 & tVOC
  isCCS811();

  // Accelerometer and Gyroscopes
  isIMU();

  // Magnetometer
  isMag();

  // Barometer
  isBarometer();

  // isGPS
  isGPS();

  // Delay 1 sec
  delay(1000);

}

getAccelGyro.ino

// Accelerometer and Gyroscopes
// Setup IMU
void setupIMU() {

  // Setup IMU
  imu.init();
  // Default
  imu.enableDefault();
  
}
// Accelerometer and Gyroscopes
void isIMU() {

  // Accelerometer and Gyroscopes
  imu.read();
  // Accelerometer x, y, z
  imuAX = imu.a.x;
  imuAY = imu.a.y;
  imuAZ = imu.a.z;
  // Gyroscopes x, y, z
  imuGX = imu.g.x;
  imuGY = imu.g.y;
  imuGZ = imu.g.z;

  // FullString B
  FullStringB = "Accelerometer X = " + String(imuAX) + " Accelerometer Y = "
  + String(imuAY) + " Accelerometer Z = " + String(imuAZ) 
  + "\r\n";

  // FullStringB Bluetooth Serial + Serial
  for(int i = 0; i < FullStringB.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringB.c_str()[i]);
    // Serial
    Serial.write(FullStringB.c_str()[i]);
    
  }

  // FullString C
  FullStringC = "Gyroscopes X = " + String(imuGX) + " Gyroscopes Y = "
  + String(imuGY) + " Gyroscopes Z = " + String(imuGZ) 
  + "\r\n";

  // FullStringC Bluetooth Serial + Serial
  for(int i = 0; i < FullStringC.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringC.c_str()[i]);
    // Serial
    Serial.write(FullStringC.c_str()[i]);
    
  }

}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
// isBME280 - Temperature, Humidity, Barometric Pressure, and Altitude
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  // Altitude Meters
  BMEaltitudeM = (myBME280.readFloatAltitudeMeters(), 2);

  // FullString
  FullString = "Temperature = " + String(BMEtempC,2) + " Humidity = "
  + String(BMEhumid,2) + " Barometric = " + String(BMEpressure,2) 
  + " Altitude Meters = " + String(BMEaltitudeM,2) + "\r\n";

  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }

}

getBarometer.ino

// STMicroelectronics LPS25H digital barometer
// Setup Barometer
void isSetupBarometer(){

  // Setup Barometer
  ps.init();
  // Default
  ps.enableDefault();
  
}
// Barometer
void isBarometer(){

  // Barometer
  pressure = ps.readPressureMillibars();
  // Altitude Meters
  altitude = ps.pressureToAltitudeMeters(pressure);
  // Temperature Celsius
  temperature = ps.readTemperatureC();

  // FullStringF
  FullStringF = "Barometer = " + String(pressure,2) + " Altitude Meters = "
  + String(altitude,2) + " Temperature Celsius = "
  + String(temperature,2) + "\r\n";

  // FullStringF Bluetooth Serial + Serial
  for(int i = 0; i < FullStringF.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringF.c_str()[i]);
    // Serial
    Serial.write(FullStringF.c_str()[i]);
    
  }
  
}

getCCS811.ino

// CCS811 - eCO2 & tVOC
// isCCS811 - eCO2 & tVOC
void isCCS811(){

  // This sends the temperature & humidity data to the CCS811
  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);

  // Calling this function updates the global tVOC and eCO2 variables
  myCCS811.readAlgorithmResults();

  // eCO2 Concentration
  CCS811CO2 = myCCS811.getCO2();
  
  // tVOC Concentration
  CCS811TVOC = myCCS811.getTVOC();

  // FullStringA
  FullStringA = "TVOCs = " + String(CCS811TVOC,2) + " eCO2 = "
  + String(CCS811CO2,2) + "\r\n";

  // FullStringA Bluetooth Serial + Serial
  for(int i = 0; i < FullStringA.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringA.c_str()[i]);
    // Serial
    Serial.write(FullStringA.c_str()[i]);
    
  }

}

getGPS.ino

// GPS Receiver
// Setup GPS
void setupGPS() {

  // Setup GPS
  tGPS.begin(  9600 , SERIAL_8N1 , gpsRXPIN , gpsTXPIN );
  
}
// isGPS
void isGPS(){

  // Receives NEMA data from GPS receiver
  // This sketch displays information every time a new sentence is correctly encoded
  while ( tGPS.available() > 0)
    
    if (gps.encode( tGPS.read() ))
    {
     
       // GPS Vector Pointer Target
       displayInfo();
       // GPS Date, Time, Speed, Altitude
       displayDTS();
       
    }

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {

     while(true);
    
  }

}
// GPS Vector Pointer Target
void displayInfo(){

  // Location
  if (gps.location.isValid())
  {
    
     // Latitude
     TargetLat = gps.location.lat();
     // Longitude
     TargetLon = gps.location.lng();
     // GPS Status 2
     GPSSt = "Yes";

     // FullStringG
     FullStringG = "Latitude = " + String(TargetLat) + " Longitude = "
     + String(TargetLon) + "\r\n";

     // FullStringG Bluetooth Serial + Serial
     for(int i = 0; i < FullStringG.length(); i++)
     {

       // Bluetooth Serial
       SerialBT.write(FullStringG.c_str()[i]);
       // Serial
       Serial.write(FullStringG.c_str()[i]);
    
     }
    
  }
  else
  {

     // GPS Status 0
     GPSSt = "No";
    
  }

}
// GPS Date, Time, Speed, Altitude
void displayDTS(){

  // Date
  TargetDat = ""; 
  if (gps.date.isValid())
  {
    
     // Date
     // Year
     TargetDat += String(gps.date.year(), DEC);
     TargetDat += "/";
     // Month
     TargetDat += String(gps.date.month(), DEC);
     TargetDat += "/";
     // Day
     TargetDat += String(gps.date.day(), DEC);

     // FullStringH
     FullStringH = "Date = " + String(TargetDat) + "\r\n";

     // FullStringH Bluetooth Serial + Serial
     for(int i = 0; i < FullStringH.length(); i++)
     {

       // Bluetooth Serial
       SerialBT.write(FullStringH.c_str()[i]);
       // Serial
       Serial.write(FullStringH.c_str()[i]);
    
     }
    
  }

  // Time
  TargetTim = "";
  if (gps.time.isValid())
  {
    
     // Time
     // Hour
     TargetTim += String(gps.time.hour(), DEC);
     TargetTim += ":";
     // Minute
     TargetTim += String(gps.time.minute(), DEC);
     TargetTim += ":";
     // Secound
     TargetTim += String(gps.time.second(), DEC);

     // FullStringH
     FullStringH = "Time = " + String(TargetTim) + "\r\n";

     // FullStringH Bluetooth Serial + Serial
     for(int i = 0; i < FullStringH.length(); i++)
     {

       // Bluetooth Serial
       SerialBT.write(FullStringH.c_str()[i]);
       // Serial
       Serial.write(FullStringH.c_str()[i]);
    
     }
    
  }

  // Speed
  TargetSMS = "";
  TargetSKH = "";
  if (gps.speed.isValid())
  {
    
     // Speed
     // M/S
     int x = gps.speed.mps();
     TargetSMS = String( x, DEC);
     // Km/h
     int y = gps.speed.kmph();
     TargetSKH = String( y, DEC);

     // FullStringH
     FullStringH = "Speed = " + String(TargetSMS) + "\r\n";

     // FullStringH Bluetooth Serial + Serial
     for(int i = 0; i < FullStringH.length(); i++)
     {

       // Bluetooth Serial
       SerialBT.write(FullStringH.c_str()[i]);
       // Serial
       Serial.write(FullStringH.c_str()[i]);
    
     }

  }

  // Altitude
  TargetALT = "";
  if (gps.altitude.isValid())
  {
    
     // Altitude
     // Meters
     int z = gps.altitude.meters();
     TargetALT = String( z, DEC);

     // FullStringH
     FullStringH = "Altitude = " + String(TargetALT) + "\r\n";

     // FullStringH Bluetooth Serial + Serial
     for(int i = 0; i < FullStringH.length(); i++)
     {

       // Bluetooth Serial
       SerialBT.write(FullStringH.c_str()[i]);
       // Serial
       Serial.write(FullStringH.c_str()[i]);
    
     }

  }
 
}

getMagnetometer.ino

// Magnetometer
// Setup Magnetometer
void setupMag() {

  // Setup Magnetometer
  mag.init();
  // Default
  mag.enableDefault();
  
}
// Magnetometer
void isMag() {

  // Magnetometer
  mag.read();
  // Magnetometer x, y, z
  magX = mag.m.x;
  magY = mag.m.y;
  magZ = mag.m.z;

  // FullString D
  FullStringD = "Magnetometer X = " + String(magX) + " Magnetometer Y = "
  + String(magY) + " Magnetometer Z = " + String(magZ) 
  + "\r\n";

  // FullStringD Bluetooth Serial + Serial
  for(int i = 0; i < FullStringD.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringD.c_str()[i]);
    // Serial
    Serial.write(FullStringD.c_str()[i]);
    
  }
  
}

setup.ino

// Setup
void setup()
{
  
  // Serial Begin
  Serial.begin(9600);
  Serial.println("Starting BLE work!");

  // Bluetooth Serial
  SerialBT.begin("Don Luc Electronics");
  Serial.println("Bluetooth Started! Ready to pair...");

  // Give display time to power on
  delay(100);
  
  // Wire - Inialize I2C Hardware
  Wire.begin();

  // Give display time to power on
  delay(100);

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude 
  myBME280.begin();

  // CCS811 - eCO2 & tVOC
  myCCS811.begin();

  // Setup IMU
  setupIMU();

  // Setup Magnetometer
  setupMag();

  // Setup Barometer
  isSetupBarometer();

  // GPS Receiver
  // Setup GPS
  setupGPS();
  
  // Initialize digital pin LED_BUILTIN as an output
  pinMode(LED_BUILTIN, OUTPUT);
  // Turn the LED on HIGH
  digitalWrite(LED_BUILTIN, HIGH);

}

——

Arduino Uno

RX – Digital 3
TX – Digital 2
VIN – +3.3V
GND – GND

——

DL2307Mk05pr.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth GPS Receiver GP-20U7 - Mk24
26-24
DL2307Mk05pr.ino
1 x Arduino Uno
1 x SparkFun RedBoard Qwiic
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout - CCS811
1 x Pololu AltIMU-10 v5
1 x GPS Receiver - GP-20U7
1 x Lithium Ion Battery - 85mAh
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
//String BTA = "0006664FDC9E"; 

// Software Version Information
String sver = "26-24";

void loop() {

  // isBluetooth
  isBluetooth();
 
}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Setup Bluetooth
  // Begin the serial monitor at 9600bps
  Serial.begin(9600);
  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$");
  // Enter command mode
  // Short delay, wait for the Mate to send back CMD
  delay(100);
  // Temporarily Change the baudrate to 9600, no parity
  bluetooth.println("U,9600,N");
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  // Start bluetooth serial at 9600
  bluetooth.begin(9600);
  
}
// isBluetooth
void isBluetooth() {

  // If the bluetooth sent any characters
  if(bluetooth.available())
  {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());
    
  }
  // If stuff was typed in the serial monitor
  if(Serial.available())
  {
    
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth Pololu AltIMU-10 – Mk23

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #SparkFun #BME280 #CCS811 #IMU #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth Pololu AltIMU-10

——

Bluetooth Pololu AltIMU-10

——

Bluetooth Pololu AltIMU-10

——

AltIMU-10 v5 Gyro, Accelerometer, Compass, and Altimeter

The Pololu AltIMU-10 v5 is an inertial measurement unit (IMU) and altimeter that features the same LSM6DS33 gyro and accelerometer and LIS3MDL magnetometer as the MinIMU-9 v5, and adds an LPS25H digital barometer. An I²C interface accesses ten independent pressure, rotation, acceleration, and magnetic measurements that can be used to calculate the sensor’s altitude and absolute orientation. The Pololu AltIMU-10 v5 is a compact board that combines ST’s LSM6DS33 3-axis gyroscope and 3-axis accelerometer, LIS3MDL 3-axis magnetometer, and LPS25H digital barometer to form an inertial measurement unit (IMU) and altimeter.

DL2307Mk04

1 x SparkFun Thing Plus – ESP32 WROOM
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 – Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout – CCS811
1 x Pololu AltIMU-10 v5
1 x Lithium Ion Battery – 850mAh
2 x SparkFun Cerberus USB Cable

SparkFun Thing Plus – ESP32 WROOM

LED – LED_BUILTIN
SDA – Digital 23
SCL – Digital 22
RX2 – Bluetooth
TX2 – Bluetooth
VIN – +3.3V
GND – GND

——

DL2307Mk04ps.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth Pololu AltIMU-10 - Mk23
26-23
DL2307Mk04pr.ino
1 x SparkFun Thing Plus - ESP32 WROOM
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout - CCS811
1 x Pololu AltIMU-10 v5
1 x Lithium Ion Battery - 85mAh
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Bluetooth Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
// Two Wire Interface (TWI/I2C)
#include <Wire.h>
// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
#include <SparkFunBME280.h>
// SparkFun CCS811 - eCO2 & tVOC
#include <SparkFunCCS811.h>
// Includes and variables for IMU integration
// STMicroelectronics LSM6DS33 gyroscope and accelerometer
#include <LSM6.h>
// STMicroelectronics LIS3MDL magnetometer
#include <LIS3MDL.h>
// STMicroelectronics LPS25H digital barometer
#include <LPS.h>

// Bluetooth Serial
BluetoothSerial SerialBT;

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
BME280 myBME280;
float BMEtempC = 0;
float BMEhumid = 0;
float BMEpressure = 0;
float BMEaltitudeM = 0;
String FullString = "";

// SparkFun CCS811 - eCO2 & tVOC
// Default I2C Address
#define CCS811_ADDR 0x5B 
CCS811 myCCS811(CCS811_ADDR);
float CCS811CO2 = 0;
float CCS811TVOC = 0;
String FullStringA = "";

// 9DoF IMU
// STMicroelectronics LSM6DS33 gyroscope and accelerometer
LSM6 imu;
// Accelerometer and Gyroscopes
// Accelerometer
int imuAX;
int imuAY;
int imuAZ;
String FullStringB = "";
// Gyroscopes 
int imuGX;
int imuGY;
int imuGZ;
String FullStringC = "";
// STMicroelectronics LIS3MDL magnetometer
LIS3MDL mag;
// Magnetometer
int magX;
int magY;
int magZ;
String FullStringD = "";
// STMicroelectronics LPS25H digital barometer
LPS ps;
// Digital Barometer
float pressure;
float altitude;
float temperature;
String FullStringF = "";

// Software Version Information
String sver = "26-23";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
  isBME280();

  // SparkFun CCS811 - eCO2 & tVOC
  isCCS811();

  // Accelerometer and Gyroscopes
  isIMU();

  // Magnetometer
  isMag();

  // Barometer
  isBarometer();

  // Delay 1 sec
  delay(1000);

}

getAccelGyro.ino

// Accelerometer and Gyroscopes
// Setup IMU
void setupIMU() {

  // Setup IMU
  imu.init();
  // Default
  imu.enableDefault();
  
}
// Accelerometer and Gyroscopes
void isIMU() {

  // Accelerometer and Gyroscopes
  imu.read();
  // Accelerometer x, y, z
  imuAX = imu.a.x;
  imuAY = imu.a.y;
  imuAZ = imu.a.z;
  // Gyroscopes x, y, z
  imuGX = imu.g.x;
  imuGY = imu.g.y;
  imuGZ = imu.g.z;

  // FullString B
  FullStringB = "Accelerometer X = " + String(imuAX) + " Accelerometer Y = "
  + String(imuAY) + " Accelerometer Z = " + String(imuAZ) 
  + "\r\n";

  // FullStringB Bluetooth Serial + Serial
  for(int i = 0; i < FullStringB.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringB.c_str()[i]);
    // Serial
    Serial.write(FullStringB.c_str()[i]);
    
  }

  // FullString C
  FullStringC = "Gyroscopes X = " + String(imuGX) + " Gyroscopes Y = "
  + String(imuGY) + " Gyroscopes Z = " + String(imuGZ) 
  + "\r\n";

  // FullStringC Bluetooth Serial + Serial
  for(int i = 0; i < FullStringC.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringC.c_str()[i]);
    // Serial
    Serial.write(FullStringC.c_str()[i]);
    
  }

}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
// isBME280 - Temperature, Humidity, Barometric Pressure, and Altitude
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  // Altitude Meters
  BMEaltitudeM = (myBME280.readFloatAltitudeMeters(), 2);

  // FullString
  FullString = "Temperature = " + String(BMEtempC,2) + " Humidity = "
  + String(BMEhumid,2) + " Barometric = " + String(BMEpressure,2) 
  + " Altitude Meters = " + String(BMEaltitudeM,2) + "\r\n";

  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }

}

getBarometer.ino

// STMicroelectronics LPS25H digital barometer
// Setup Barometer
void isSetupBarometer(){

  // Setup Barometer
  ps.init();
  // Default
  ps.enableDefault();
  
}
// Barometer
void isBarometer(){

  // Barometer
  pressure = ps.readPressureMillibars();
  // Altitude Meters
  altitude = ps.pressureToAltitudeMeters(pressure);
  // Temperature Celsius
  temperature = ps.readTemperatureC();

  // FullStringF
  FullStringF = "Barometer = " + String(pressure,2) + " Altitude Meters = "
  + String(altitude,2) + " Temperature Celsius = "
  + String(temperature,2) + "\r\n";

  // FullStringF Bluetooth Serial + Serial
  for(int i = 0; i < FullStringF.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringF.c_str()[i]);
    // Serial
    Serial.write(FullStringF.c_str()[i]);
    
  }
  
}

getCCS811.ino

// CCS811 - eCO2 & tVOC
// isCCS811 - eCO2 & tVOC
void isCCS811(){

  // This sends the temperature & humidity data to the CCS811
  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);

  // Calling this function updates the global tVOC and eCO2 variables
  myCCS811.readAlgorithmResults();

  // eCO2 Concentration
  CCS811CO2 = myCCS811.getCO2();
  
  // tVOC Concentration
  CCS811TVOC = myCCS811.getTVOC();

  // FullStringA
  FullStringA = "TVOCs = " + String(CCS811TVOC,2) + " eCO2 = "
  + String(CCS811CO2,2) + "\r\n";

  // FullStringA Bluetooth Serial + Serial
  for(int i = 0; i < FullStringA.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringA.c_str()[i]);
    // Serial
    Serial.write(FullStringA.c_str()[i]);
    
  }

}

getMagnetometer.ino

// Magnetometer
// Setup Magnetometer
void setupMag() {

  // Setup Magnetometer
  mag.init();
  // Default
  mag.enableDefault();
  
}
// Magnetometer
void isMag() {

  // Magnetometer
  mag.read();
  // Magnetometer x, y, z
  magX = mag.m.x;
  magY = mag.m.y;
  magZ = mag.m.z;

  // FullString D
  FullStringD = "Magnetometer X = " + String(magX) + " Magnetometer Y = "
  + String(magY) + " Magnetometer Z = " + String(magZ) 
  + "\r\n";

  // FullStringD Bluetooth Serial + Serial
  for(int i = 0; i < FullStringD.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringD.c_str()[i]);
    // Serial
    Serial.write(FullStringD.c_str()[i]);
    
  }
  
}

setup.ino

// Setup
void setup()
{
  
  // Serial Begin
  Serial.begin(9600);
  Serial.println("Starting BLE work!");

  // Bluetooth Serial
  SerialBT.begin("Don Luc Electronics");
  Serial.println("Bluetooth Started! Ready to pair...");

  // Give display time to power on
  delay(100);
  
  // Wire - Inialize I2C Hardware
  Wire.begin();

  // Give display time to power on
  delay(100);

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude 
  myBME280.begin();

  // CCS811 - eCO2 & tVOC
  myCCS811.begin();

  // Setup IMU
  setupIMU();

  // Setup Magnetometer
  setupMag();

  // Setup Barometer
  isSetupBarometer();
  
  // Initialize digital pin LED_BUILTIN as an output
  pinMode(LED_BUILTIN, OUTPUT);
  // Turn the LED on HIGH
  digitalWrite(LED_BUILTIN, HIGH);

}

——

Arduino Uno

RX – Digital 3
TX – Digital 2
VIN – +3.3V
GND – GND

——

DL2307Mk04pr.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth Pololu AltIMU-10 - Mk23
26-23
DL2307Mk04pr.ino
1 x Arduino Uno
1 x SparkFun RedBoard Qwiic
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout - CCS811
1 x Pololu AltIMU-10 v5
1 x Lithium Ion Battery - 85mAh
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
//String BTA = "0006664FDC9E"; 

// Software Version Information
String sver = "26-23";

void loop() {

  // isBluetooth
  isBluetooth();
 
}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Setup Bluetooth
  // Begin the serial monitor at 9600bps
  Serial.begin(9600);
  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$");
  // Enter command mode
  // Short delay, wait for the Mate to send back CMD
  delay(100);
  // Temporarily Change the baudrate to 9600, no parity
  bluetooth.println("U,9600,N");
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  // Start bluetooth serial at 9600
  bluetooth.begin(9600);
  
}
// isBluetooth
void isBluetooth() {

  // If the bluetooth sent any characters
  if(bluetooth.available())
  {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());
    
  }
  // If stuff was typed in the serial monitor
  if(Serial.available())
  {
    
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth CCS811 – Mk22

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #SparkFun #BME280 #CCS811 #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth CCS811

——

Bluetooth CCS811

——

Bluetooth CCS811

——

SparkFun Air Quality Breakout – CCS811

The CCS811 Air Quality Breakout is a digital gas sensor solution that senses a wide range of Total Volatile Organic Compounds (TVOCs), including equivalent carbon dioxide (eCO2) and metal oxide (MOX) levels. VOCs are often categorized as pollutants and or sensory irritants and can come from a variety of sources like construction materials, machines and even people. This breakout is intended for indoor air quality monitoring in personal devices such as watches and phone.

DL2307Mk03

1 x SparkFun Thing Plus – ESP32 WROOM
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 – Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout – CCS811
1 x Lithium Ion Battery – 850mAh
2 x SparkFun Cerberus USB Cable

SparkFun Thing Plus – ESP32 WROOM

LED – LED_BUILTIN
SDA – Digital 23
SCL – Digital 22
RX2 – Bluetooth
TX2 – Bluetooth
VIN – +3.3V
GND – GND

——

DL2307Mk03ps.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - SparkFun CCS811 - Mk22
26-22
DL2307Mk03pr.ino
1 x SparkFun Thing Plus - ESP32 WROOM
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout - CCS811
1 x Lithium Ion Battery - 850mAh
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Bluetooth Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
// Two Wire Interface (TWI/I2C)
#include <Wire.h>
// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
#include <SparkFunBME280.h>
// SparkFun CCS811 - eCO2 & tVOC
#include <SparkFunCCS811.h>

// Bluetooth Serial
BluetoothSerial SerialBT;

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
BME280 myBME280;
float BMEtempC = 0;
float BMEhumid = 0;
float BMEpressure = 0;
float BMEaltitudeM = 0;
String FullString = "";

// SparkFun CCS811 - eCO2 & tVOC
// Default I2C Address
#define CCS811_ADDR 0x5B 
CCS811 myCCS811(CCS811_ADDR);
float CCS811CO2 = 0;
float CCS811TVOC = 0;
String FullStringA = "";

// Software Version Information
String sver = "26-22";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
  isBME280();

  // SparkFun CCS811 - eCO2 & tVOC
  isCCS811();

  // Delay 1 sec
  delay(1000);

}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
// isBME280 - Temperature, Humidity, Barometric Pressure, and Altitude
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  // Altitude Meters
  BMEaltitudeM = (myBME280.readFloatAltitudeMeters(), 2);

  // FullString
  FullString = "Temperature = " + String(BMEtempC,2) + " Humidity = "
  + String(BMEhumid,2) + " Barometric = " + String(BMEpressure,2) 
  + " Altitude Meters = " + String(BMEaltitudeM,2) + "\r\n";

  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }

}

getCCS811.ino

// CCS811 - eCO2 & tVOC
// isCCS811 - eCO2 & tVOC
void isCCS811(){

  // This sends the temperature & humidity data to the CCS811
  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);

  // Calling this function updates the global tVOC and eCO2 variables
  myCCS811.readAlgorithmResults();

  // eCO2 Concentration
  CCS811CO2 = myCCS811.getCO2();
  
  // tVOC Concentration
  CCS811TVOC = myCCS811.getTVOC();

  // FullStringA
  FullStringA = "TVOCs = " + String(CCS811TVOC,2) + " eCO2 = "
  + String(CCS811CO2,2) + "\r\n";

  // FullStringA Bluetooth Serial + Serial
  for(int i = 0; i < FullStringA.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullStringA.c_str()[i]);
    // Serial
    Serial.write(FullStringA.c_str()[i]);
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Serial Begin
  Serial.begin(9600);
  Serial.println("Starting BLE work!");

  // Bluetooth Serial
  SerialBT.begin("Don Luc Electronics");
  Serial.println("Bluetooth Started! Ready to pair...");

  // Give display time to power on
  delay(100);
  
  // Wire - Inialize I2C Hardware
  Wire.begin();

  // Give display time to power on
  delay(100);

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude 
  myBME280.begin();

  // CCS811 - eCO2 & tVOC
  myCCS811.begin();

  // Initialize digital pin LED_BUILTIN as an output
  pinMode(LED_BUILTIN, OUTPUT);
  // Turn the LED on HIGH
  digitalWrite(LED_BUILTIN, HIGH);

}

——

Arduino Uno

RX – Digital 3
TX – Digital 2
VIN – +3.3V
GND – GND

DL2307Mk03pr.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth CCS811 - Mk22
26-22
DL2307Mk03pr.ino
1 x Arduino Uno
1 x SparkFun RedBoard Qwiic
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
1 x SparkFun Air Quality Breakout - CCS811
1 x Lithium Ion Battery - 850mAh
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
//String BTA = "0006664FDC9E"; 

// Software Version Information
String sver = "26-22";

void loop() {

  // isBluetooth
  isBluetooth();
 
}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Setup Bluetooth
  // Begin the serial monitor at 9600bps
  Serial.begin(9600);
  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$");
  // Enter command mode
  // Short delay, wait for the Mate to send back CMD
  delay(100);
  // Temporarily Change the baudrate to 9600, no parity
  bluetooth.println("U,9600,N");
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  // Start bluetooth serial at 9600
  bluetooth.begin(9600);
  
}
// isBluetooth
void isBluetooth() {

  // If the bluetooth sent any characters
  if(bluetooth.available())
  {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());
    
  }
  // If stuff was typed in the serial monitor
  if(Serial.available())
  {
    
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth SparkFun BME280 – Mk21

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #SparkFun #BME280 #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth SparkFun BME280

——

Bluetooth SparkFun BME280

——

Bluetooth SparkFun BME280

——

SparkFun Atmospheric Sensor Breakout – BME280

The SparkFun BME280 Atmospheric Sensor Breakout is the easy way to measure barometric pressure, humidity, and temperature readings all without taking up too much space. Basically, anything you need to know about atmospheric conditions you can find out from this tiny breakout. The BME280 Breakout has been design to be used in indoor/outdoor navigation, weather forecasting, home automation, and even personal health and wellness monitoring.

DL2307Mk02

1 x SparkFun Thing Plus – ESP32 WROOM
1 x Android NextBook
1 x SparkFun BME280 – Temperature, Humidity, Barometric Pressure, and Altitude
1 x Lithium Ion Battery – 850mAh
1 x SparkFun Cerberus USB Cable

SparkFun Thing Plus – ESP32 WROOM

LED – LED_BUILTIN
SDA – Digital 23
SCL – Digital 22
RX2 – Bluetooth
TX2 – Bluetooth
VIN – +3.3V
GND – GND

——

DL2307Mk02p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - SparkFun BME280 - Mk21
26-21
DL2307Mk02pr.ino
1 x SparkFun Thing Plus - ESP32 WROOM
1 x Android NextBook
1 x SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
1 x Lithium Ion Battery - 850mAh
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Bluetooth Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
// Two Wire Interface (TWI/I2C)
#include <Wire.h>
// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
#include <SparkFunBME280.h>

// Bluetooth Serial
BluetoothSerial SerialBT;

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
BME280 myBME280;
float BMEtempC = 0;
float BMEhumid = 0;
float BMEpressure = 0;
float BMEaltitudeM = 0;
String FullString = "";

// Software Version Information
String sver = "26-21";

void loop() {

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
  isBME280();

  // Delay 1 sec
  delay(1000);

}

getBME280.ino

// SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude
// isBME280 - Temperature, Humidity, Barometric Pressure, and Altitude
void isBME280(){

  // Temperature Celsius
  BMEtempC = myBME280.readTempC();
  // Humidity
  BMEhumid = myBME280.readFloatHumidity();
  // Barometric Pressure
  BMEpressure = myBME280.readFloatPressure();
  // Altitude Meters
  BMEaltitudeM = (myBME280.readFloatAltitudeMeters(), 2);

  // FullString
  FullString = "Temperature = " + String(BMEtempC,2) + " Humidity = "
  + String(BMEhumid,2) + " Barometric = " + String(BMEpressure,2) 
  + " Altitude Meters = " + String(BMEaltitudeM,2) + "\r\n";

  // FullString Bluetooth Serial + Serial
  for(int i = 0; i < FullString.length(); i++)
  {

    // Bluetooth Serial
    SerialBT.write(FullString.c_str()[i]);
    // Serial
    Serial.write(FullString.c_str()[i]);
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Serial Begin
  Serial.begin(115200);
  Serial.println("Starting BLE work!");

  // Bluetooth Serial
  SerialBT.begin("Don Luc Electronics");
  Serial.println("Bluetooth Started! Ready to pair...");

  // Give display time to power on
  delay(100);
  
  // Wire - Inialize I2C Hardware
  Wire.begin();

  // Give display time to power on
  delay(100);

  // SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude 
  myBME280.begin();

  // Initialize digital pin LED_BUILTIN as an output
  pinMode(LED_BUILTIN, OUTPUT);
  // Turn the LED on HIGH
  digitalWrite(LED_BUILTIN, HIGH);

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth SparkFun Thing Plus – ESP32 WROOM – Mk20

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #SparkFun #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

SparkFun Thing Plus - ESP32 WROOM

——

SparkFun Thing Plus - ESP32 WROOM

——

SparkFun Thing Plus - ESP32 WROOM

——

SparkFun Thing Plus – ESP32 WROOM

The SparkFun ESP32 Thing Plus is the next step to get started with Espressif IoT ideations while still enjoying all the amenities of the original ESP32 Thing. Espressif’s ESP32 WROOM is a powerful WiFi and Bluetooth MCU module that targets a wide variety of applications. At the core of this module is the ESP32-D0WDQ6 chip which is designed to be both scalable and adaptive. To make the Thing Plus even easier to use, we’ve moved a few pins around to make the board Feather compatible and it utilizes our handy Qwiic Connect System which means no soldering or shields are required to connect it to the rest of your system.

The ESP32 Thing plus integrates a rich set of peripherals, ranging from capacitive touch sensors, SD card interface, Ethernet, high-speed SPI, UART, I2S and I2C. Thanks to the onboard ESP32 WROOM module, the SparkFun Thing Plus features 16MB of flash memory, 520kB of internal SRAM, an integrated 802.11 BGN WiFi transceiver and dual-mode Bluetooth capabilities, and a JST connector to plug in a LiPo battery.

DL2307Mk01

1 x Arduino Uno
1 x SparkFun Thing Plus – ESP32 WROOM
1 x SparkFun Bluetooth Mate Silver
2 x SparkFun Cerberus USB Cable

Arduino Uno

RX – Digital 3
TX – Digital 2
VIN – +3.3V
GND – GND

——

DL2307Mk01pr.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth SparkFun Thing Plus - ESP32 WROOM - Mk20
26-20
DL2307Mk01pr.ino
1 x Arduino Uno
1 x SparkFun Thing Plus - ESP32 WROOM
2 x SparkFun Bluetooth Mate Silver
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

// Software Version Information
String sver = "26-20";

void loop() {

  // isBluetooth
  isBluetooth();
 
}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Setup Bluetooth
  // Begin the serial monitor at 9600bps
  Serial.begin(9600);
  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  
  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$");
  // Enter command mode
  // Short delay, wait for the Mate to send back CMD
  delay(100);
  // Temporarily Change the baudrate to 9600, no parity
  bluetooth.println("U,9600,N");
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  // Start bluetooth serial at 9600
  bluetooth.begin(9600);
  
}
// isBluetooth
void isBluetooth() {

  // If the bluetooth sent any characters
  if(bluetooth.available())
  {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());
    
  }
  // If stuff was typed in the serial monitor
  if(Serial.available())
  {
    
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

SparkFun Thing Plus – ESP32 WROOM

RX2 – Bluetooth
TX2 – Bluetooth
VIN – +3.3V
GND – GND

——

DL2307Mk01ps.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth SparkFun Thing Plus - ESP32 WROOM  - Mk20
26-20
DL2307Mk01pr.ino
1 x Arduino Uno
1 x SparkFun Thing Plus - ESP32 WROOM
2 x SparkFun Bluetooth Mate Silver
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Bluetooth Serial
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

// Bluetooth Serial
BluetoothSerial SerialBT;

// Software Version Information
String sver = "26-20";

void loop() {

  // isBluetooth
  isBluetooth();

}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Serial Begin
  Serial.begin(9600);
  
  // Bluetooth device name
  SerialBT.begin("DL2307Mk01ps");
  
  // Serial
  Serial.println("The device started, now you can pair it with bluetooth!");
  
}
// isBluetooth
void isBluetooth() {

  // If stuff was typed in the serial monitor
  if (Serial.available()) {
    
    // Send any characters the Serial monitor prints to the bluetooth
    SerialBT.write(Serial.read());
    
  }
  // If the bluetooth sent any characters
  if (SerialBT.available()) {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.write(SerialBT.read());
    
  }
  // Delay
  delay(20);

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth Commands – Mk19

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth Commands

——

Bluetooth Commands

——

Bluetooth Commands

——

ACTION Commands

Begin by sending the inquiry scan command: I,, to search for other Bluetooth modules in range. The parameter defines the number of seconds the modem will take to look for other modules. It’ll default to 10 if not defined. If you just type “I” and click send, the device should respond with a “Inquiry, COD=0”, and then after ten seconds it’ll respond with any Bluetooth modules it found. It will print their information as “BT address, BT name, COD”.

If the modem finds any modules, you can try sending the connect command: C,

< to connect to one of them. The modem in the example above found one devices in range, by sending the C,0006664FAE18 command, we can attempt to connect to one of them. After sending the connect command, the device will respond with "TRYING", which will be followed by either "CONNECT failed" or the connection will be successful. After a successful connection we immediately enter data mode, and the modem becomes a pipeline. Any characters sent from one Bluetooth device will be sent to the other, and vice-versa. DL2306Mk06

1 x Arduino Uno
1 x SparkFun RedBoard Qwiic
2 x SparkFun Bluetooth Mate Silver
2 x SparkFun Cerberus USB Cable

Arduino Uno

RX – Digital 3
TX – Digital 2
VIN – +3.3V
GND – GND

——

DL2306Mk06pr.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth Commands - Mk19
26-19
DL2306Mk03pr.ino
1 x Arduino Uno
1 x SparkFun RedBoard Qwiic
2 x SparkFun Bluetooth Mate Silver
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
//String BTA = "0006664FDC9E"; 

// Software Version Information
String sver = "26-19";

void loop() {

  // isBluetooth
  isBluetooth();
 
}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Setup Bluetooth
  // Begin the serial monitor at 9600bps
  Serial.begin(9600);
  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$");
  // Enter command mode
  // Short delay, wait for the Mate to send back CMD
  delay(100);
  // Temporarily Change the baudrate to 9600, no parity
  bluetooth.println("U,9600,N");
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  // Start bluetooth serial at 9600
  bluetooth.begin(9600);
  
}
// isBluetooth
void isBluetooth() {

  // If the bluetooth sent any characters
  if(bluetooth.available())
  {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());
    
  }
  // If stuff was typed in the serial monitor
  if(Serial.available())
  {
    
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

SparkFun RedBoard Qwiic

RX – Digital 3
TX – Digital 2
VIN – +3.3V
GND – GND

——

DL2306Mk06ps.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth Commands - Mk19
26-19
DL2306Mk03ps.ino
1 x Arduino Uno
1 x SparkFun RedBoard Qwiic
2 x SparkFun Bluetooth Mate Silver
2 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
//String BTA = "0006664FAE18"; 

// Software Version Information
String sver = "26-19";

void loop() {

  // isBluetooth
  isBluetooth();
 
}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Setup Bluetooth
  // Begin the serial monitor at 9600bps
  Serial.begin(9600);
  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$");
  // Enter command mode
  // Short delay, wait for the Mate to send back CMD
  delay(100);
  // Temporarily Change the baudrate to 9600, no parity
  bluetooth.println("U,9600,N");
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  // Start bluetooth serial at 9600
  bluetooth.begin(9600);
  
}
// isBluetooth
void isBluetooth() {

  // If the bluetooth sent any characters
  if(bluetooth.available())
  {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());
    
  }
  // If stuff was typed in the serial monitor
  if(Serial.available())
  {
    
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth Moteino – Mk18

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #Accelerometer #Magnetometer #Gyroscope #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth Moteino

——

Bluetooth Moteino

——

Bluetooth Moteino

——

Moteino

Moteino began as a low power wireless Arduino compatible development platform based on the popular ATmega328p chip used in the Arduino UNO. Moteinos are compatible and can communicate with any other Arduino or development platform that uses the popular HopeRF RFM69 or LoRa transceivers, or even the older RFM12B. Moteino also comes with an optional SPI flash memory chip for wireless programming, or data logging. Moteino was designed to be a compact, highly customizable and affordable development platform, suitable for IoT, home automation and long range wireless projects.

Moteino in RFM12B to rebuild suggests doing as new without completely replacing. I decided to stripped down at RFM12B and rebuild in Bluetooth.

DL2306Mk05

1 x Moteino
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun 9 Degrees of Freedom Breakout – MPU-9150
1 x LED Red
1 x SparkFun FTDI Basic Breakout – 5V
1 x SparkFun Cerberus USB Cable

Moteino

LED – Digital 8
RX – Digital 3
TX – Digital 2
SDA – Analog A4
SCL – Analog A5
VIN – +3.3V
GND – GND

——

DL2306Mk05p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth Moteino - Mk18
26-18
DL2306Mk05p.ino
1 x Moteino
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun 9 Degrees of Freedom Breakout - MPU-9150
1 x LED Red
1 x SparkFun FTDI Basic Breakout - 5V
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>
// Two Wire Interface (TWI/I2C)
#include <Wire.h>
// I2CDev I2C utilities
#include "I2Cdev.h"
// MPU9150Lib 9-axis fusion
#include "MPU9150Lib.h"
// CalLib magnetometer and accelerometer calibration
#include "CalLib.h"
// Motion Driver InvenSense Embedded SDK v5.1
#include <dmpKey.h>
#include <dmpmap.h>
#include <inv_mpu.h>
#include <inv_mpu_dmp_motion_driver.h>
// EEPROM Magnetometer and Accelerometer data is stored
#include <EEPROM.h>

// the MPU object
MPU9150Lib MPU;
//  MPU_UPDATE_RATE defines the rate (in Hz)
// at which the MPU updates the sensor data and DMP output
#define MPU_UPDATE_RATE  (20)
//  MAG_UPDATE_RATE defines the rate (in Hz) at which the
// MPU updates the magnetometer data
//  MAG_UPDATE_RATE should be less than or equal to the MPU_UPDATE_RATE
#define MAG_UPDATE_RATE  (10)
//  MPU_MAG_MIX defines the influence that the magnetometer has on the yaw output.
//  The magnetometer itself is quite noisy so some mixing with the gyro yaw can help
//  significantly. Some example values are defined below:
// Just use gyro yaw
#define  MPU_MAG_MIX_GYRO_ONLY          0
// Just use magnetometer and no gyro yaw
#define  MPU_MAG_MIX_MAG_ONLY           1
// A good mix value 
#define  MPU_MAG_MIX_GYRO_AND_MAG       10
// mainly gyros with a bit of mag correction
#define  MPU_MAG_MIX_GYRO_AND_SOME_MAG  50
//  MPU_LPF_RATE is the low pas filter rate and can be between 5 and 188Hz
#define MPU_LPF_RATE   5

// This is our earth frame gravity vector - quaternions and vectors
MPUQuaternion gravity;

// Quaternion Result
float Quaternion_X = 0.0;
float Quaternion_Y = 0.0;
float Quaternion_Z = 0.0;

//  SERIAL_PORT_SPEED defines the speed to use for the debug serial port
#define  SERIAL_PORT_SPEED  115200

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
String BTA = "0006664FAE18";

// LED Red
int iLedRed = 8;

// Variable to calculate frequency
unsigned long curr = 0;
unsigned long last = 0;
unsigned long freq;

// Software Version Information
String sver = "26-18";

void loop() {
  
  // MPU
  isMPU();

}

getMPU.ino

// MPU
// Setup MPU
void isSetupMPU() {

  // MPU
  MPU.init(MPU_UPDATE_RATE, MPU_MAG_MIX_GYRO_AND_MAG, MAG_UPDATE_RATE, MPU_LPF_RATE);     // start the MPU

  // Set up the initial gravity vector for quaternion rotation
  // Max value down the z axis
  gravity[QUAT_W] = 0;
  gravity[QUAT_X] = 0;
  gravity[QUAT_Y] = 0;
  gravity[QUAT_Z] = SENSOR_RANGE;
  
}
// MPU
void isMPU() {

  // Quaternion
  // This is our body frame gravity vector
  MPUQuaternion rotatedGravity;
  // This is the conjugate of the fused quaternion
  MPUQuaternion fusedConjugate;
  // Used in the rotation
  MPUQuaternion qTemp;
  // The accelerations
  MPUVector3 result;

  // Get the latest data
  if (MPU.read()) {
    
    // Need this for the rotation
    MPUQuaternionConjugate(MPU.m_fusedQuaternion, fusedConjugate);
    
    // Rotate the gravity vector into the body frame
    MPUQuaternionMultiply(gravity, MPU.m_fusedQuaternion, qTemp);
    MPUQuaternionMultiply(fusedConjugate, qTemp, rotatedGravity);
    
    // Now subtract rotated gravity from the body accels to get real accelerations.
    // Note that signs are reversed to get +ve acceleration results
    // in the conventional axes.
    // Quaternion Result
    Quaternion_X = -(MPU.m_calAccel[VEC3_X] - rotatedGravity[QUAT_X]);
    Quaternion_Y = -(MPU.m_calAccel[VEC3_Y] - rotatedGravity[QUAT_Y]);
    Quaternion_Z = -(MPU.m_calAccel[VEC3_Z] - rotatedGravity[QUAT_Z]);

    // Variable to calculate frequency
    curr = micros();
    freq = curr - last;
    last = curr;
    // Bluetooth
    Serial.print( "Blue|" + BTA + "|" );
    Serial.print( Quaternion_X );
    Serial.print( "|" );
    Serial.print( Quaternion_Y );
    Serial.print( "|" );
    Serial.print( Quaternion_Z );
    Serial.print( "|" );
    Serial.print( freq );
    Serial.println( "|*" );
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
   
  }

}

setup.ino

// Setup
void setup()
{
  
  // Serial
  Serial.begin(SERIAL_PORT_SPEED);

  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);

  // LED Red
  pinMode(iLedRed, OUTPUT);
  digitalWrite(iLedRed, HIGH);
  
  // Give display time to power on
  delay(100);

  // Wire communicate with I2C / TWI devices
  Wire.begin();

  // Pause
  delay(50);

  // Setup MPU
  isSetupMPU();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth MPU-9150 – Mk17

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #Accelerometer #Magnetometer #Gyroscope #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth MPU-9150

——

Bluetooth MPU-9150

——

Bluetooth MPU-9150

——

MPU-9150

MotionInterface is becoming a “Must-Have” function being adopted by smartphone and tablet manufacturers due to the enormous value it adds to the end user experience. In smartphones, it finds use in applications such as gesture commands for applications and phone control, enhanced gaming, augmented reality, panoramic photo capture and viewing, and pedestrian and vehicle navigation. With its ability to precisely and accurately track user motions, MotionTracking technology can convert handsets and tablets into powerful 3D intelligent devices that can be used in applications ranging from health and fitness monitoring to location-based services. Key requirements for MotionInterface enabled devices are small package size, low power consumption, high accuracy and repeatability, high shock tolerance, and application specific performance programmability, all at a low consumer price point.

DL2306Mk04

1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun 9 Degrees of Freedom Breakout – MPU-9150
1 x SparkFun Cerberus USB Cable

Arduino Uno

RX – Digital 3
TX – Digital 2
SDA – Analog A4
SCL – Analog A5
VIN – +3.3V
GND – GND

——

DL2306Mk04p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth MPU-9150 - Mk17
26-17
DL2306Mk07p.ino
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun 9 Degrees of Freedom Breakout - MPU-9150
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>
// Two Wire Interface (TWI/I2C)
#include <Wire.h>
// I2CDev I2C utilities
#include "I2Cdev.h"
// MPU9150Lib 9-axis fusion
#include "MPU9150Lib.h"
// CalLib magnetometer and accelerometer calibration
#include "CalLib.h"
// Motion Driver InvenSense Embedded SDK v5.1
#include <dmpKey.h>
#include <dmpmap.h>
#include <inv_mpu.h>
#include <inv_mpu_dmp_motion_driver.h>
// EEPROM Magnetometer and Accelerometer data is stored
#include <EEPROM.h>

// the MPU object
MPU9150Lib MPU;
//  MPU_UPDATE_RATE defines the rate (in Hz)
// at which the MPU updates the sensor data and DMP output
#define MPU_UPDATE_RATE  (20)
//  MAG_UPDATE_RATE defines the rate (in Hz) at which the
// MPU updates the magnetometer data
//  MAG_UPDATE_RATE should be less than or equal to the MPU_UPDATE_RATE
#define MAG_UPDATE_RATE  (10)
//  MPU_MAG_MIX defines the influence that the magnetometer has on the yaw output.
//  The magnetometer itself is quite noisy so some mixing with the gyro yaw can help
//  significantly. Some example values are defined below:
// Just use gyro yaw
#define  MPU_MAG_MIX_GYRO_ONLY          0
// Just use magnetometer and no gyro yaw
#define  MPU_MAG_MIX_MAG_ONLY           1
// A good mix value 
#define  MPU_MAG_MIX_GYRO_AND_MAG       10
// mainly gyros with a bit of mag correction
#define  MPU_MAG_MIX_GYRO_AND_SOME_MAG  50
//  MPU_LPF_RATE is the low pas filter rate and can be between 5 and 188Hz
#define MPU_LPF_RATE   5

// This is our earth frame gravity vector - quaternions and vectors
MPUQuaternion gravity;

// Quaternion Result
float Quaternion_X = 0.0;
float Quaternion_Y = 0.0;
float Quaternion_Z = 0.0;

//  SERIAL_PORT_SPEED defines the speed to use for the debug serial port
#define  SERIAL_PORT_SPEED  115200

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
String BTA = "0006664FDC9E"; 

// Variable to calculate frequency
unsigned long curr = 0;
unsigned long last = 0;
unsigned long freq;

// Software Version Information
String sver = "26-17";

void loop() {
  
  // MPU
  isMPU();

}

getMPU.ino

// MPU
// Setup MPU
void isSetupMPU() {

  // MPU
  MPU.init(MPU_UPDATE_RATE, MPU_MAG_MIX_GYRO_AND_MAG, MAG_UPDATE_RATE, MPU_LPF_RATE);     // start the MPU

  // Set up the initial gravity vector for quaternion rotation
  // Max value down the z axis
  gravity[QUAT_W] = 0;
  gravity[QUAT_X] = 0;
  gravity[QUAT_Y] = 0;
  gravity[QUAT_Z] = SENSOR_RANGE;
  
}
// MPU
void isMPU() {

  // Quaternion
  // This is our body frame gravity vector
  MPUQuaternion rotatedGravity;
  // This is the conjugate of the fused quaternion
  MPUQuaternion fusedConjugate;
  // Used in the rotation
  MPUQuaternion qTemp;
  // The accelerations
  MPUVector3 result;

  // Get the latest data
  if (MPU.read()) {
    
    // Need this for the rotation
    MPUQuaternionConjugate(MPU.m_fusedQuaternion, fusedConjugate);
    
    // Rotate the gravity vector into the body frame
    MPUQuaternionMultiply(gravity, MPU.m_fusedQuaternion, qTemp);
    MPUQuaternionMultiply(fusedConjugate, qTemp, rotatedGravity);
    
    // Now subtract rotated gravity from the body accels to get real accelerations.
    // Note that signs are reversed to get +ve acceleration results
    // in the conventional axes.
    // Quaternion Result
    Quaternion_X = -(MPU.m_calAccel[VEC3_X] - rotatedGravity[QUAT_X]);
    Quaternion_Y = -(MPU.m_calAccel[VEC3_Y] - rotatedGravity[QUAT_Y]);
    Quaternion_Z = -(MPU.m_calAccel[VEC3_Z] - rotatedGravity[QUAT_Z]);

    // Variable to calculate frequency
    curr = micros();
    freq = curr - last;
    last = curr;
    // Bluetooth
    Serial.print( "Blue|" + BTA + "|" );
    Serial.print( Quaternion_X );
    Serial.print( "|" );
    Serial.print( Quaternion_Y );
    Serial.print( "|" );
    Serial.print( Quaternion_Z );
    Serial.print( "|" );
    Serial.print( freq );
    Serial.println( "|*" );
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
   
  }

}

setup.ino

// Setup
void setup()
{
  
  // Serial
  Serial.begin(SERIAL_PORT_SPEED);

  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  
  // Give display time to power on
  delay(100);

  // Wire communicate with I2C / TWI devices
  Wire.begin();

  // Pause
  delay(50);

  // Setup MPU
  isSetupMPU();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #26 – Radio Frequency – Bluetooth Mate Silver – Mk16

——

#DonLucElectronics #DonLuc #RadioFrequency #Bluetooth #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Bluetooth Mate Silver

——

Bluetooth Mate Silver

——

Bluetooth Mate Silver

——

SparkFun Bluetooth Mate Silver

The Bluetooth Mate is very similar to our BlueSMiRF modem, but it is designed specifically to be used with our Arduino Pros and LilyPad Arduinos. These modems work as a serial (RX/TX) pipe, and are a great wireless replacement for serial cables. Any serial stream from 2400 to 115200bps can be passed seamlessly from your computer to your target.

Bluetooth Mate has the same pin out as the FTDI Basic, and is meant to plug directly into an Arduino Pro, Pro Mini, or LilyPad Mainboard. Because we’ve arranged the pins to do this, you cannot directly plug the Bluetooth Mate to an FTDI Basic board.

The RN-42 is perfect for short range, battery powered applications. The RN-42 uses only 26uA in sleep mode while still being discoverable and connectable. Multiple user configurable power modes allow the user to dial in the lowest power profile for a given application. The Bluetooth Mate has on-board voltage regulators, so it can be powered from any 3.3 to 6VDC power supply. We’ve got level shifting all set up so the RX and TX pins on the remote unit are 3-6VDC tolerant.

DL2306Mk03

1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun Cerberus USB Cable

Arduino Uno

RX – Digital 3
TX – Digital 2
VIN – +3.3V
GND – GND

——

DL2306Mk03p.ino

/* ***** Don Luc Electronics © *****
Software Version Information
Project #26 - Radio Frequency - Bluetooth Mate Silver - Mk16
26-16
DL2306Mk03p.ino
1 x Arduino Uno
1 x SparkFun Bluetooth Mate Silver
1 x SparkFun Cerberus USB Cable
*/

// Include the Library Code
// Software Serial
#include <SoftwareSerial.h>

// Software Serial
// TX-O pin of bluetooth mate, Arduino D2
int bluetoothTx = 2;
// RX-I pin of bluetooth mate, Arduino D3
int bluetoothRx = 3;
// Bluetooth
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
// BTA
//String BTA = "0006664FDC9E"; 

// Software Version Information
String sver = "26-16";

void loop() {

  // isBluetooth
  isBluetooth();
 
}

getBluetooth.ino

// Bluetooth
// Setup Bluetooth
void isSetupBluetooth(){

  // Setup Bluetooth
  // Begin the serial monitor at 9600bps
  Serial.begin(9600);
  // Bluetooth
  // The Bluetooth Mate defaults to 115200bps
  bluetooth.begin(115200);
  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");
  bluetooth.print("$");
  // Enter command mode
  // Short delay, wait for the Mate to send back CMD
  delay(100);
  // Temporarily Change the baudrate to 9600, no parity
  bluetooth.println("U,9600,N");
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  // Start bluetooth serial at 9600
  bluetooth.begin(9600);
  
}
// isBluetooth
void isBluetooth() {

  // If the bluetooth sent any characters
  if(bluetooth.available())
  {
    
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());
    
  }
  // If stuff was typed in the serial monitor
  if(Serial.available())
  {
    
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
    
  }

}

setup.ino

// Setup
void setup()
{
  
  // Setup Bluetooth
  isSetupBluetooth();

}

——

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Project #27 – Instructor – Microcontroller – Mk02

——

#DonLucElectronics #DonLuc #Instructor #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant

——

Microcontroller

——

Microcontroller

A microcontroller is a small computer on a single Metal-Oxide-Semiconductor (MOS) integrated circuit (IC) chip. A microcontroller contains one or more CPUs (Processor Cores) along with memory and programmable input/output peripherals. Program memory in the form of ferroelectric RAM, NOR flash or OTP ROM is also often included on chip, as well as a small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications consisting of various discrete chips.

A microcontroller is a “Simple Computer” that runs one program in a loop. They are designed to perform a single, specific task. In this guide, we’ll be focusing on microcontrollers that have breakout boards, or a board that makes it easier to connect to and program the microcontroller. On a breakout board, the microcontroller pins are soldered to a printed circuit board, headers or other connectors are added to the PCB, and some basic firmware, or permanent software, is loaded to prep the microcontroller to receive signals.

There are different microcontrollers and it can be daunting to get started, especially if you’re just getting into electronics.

  • Arduino Uno, etc, (5V/16MHz, 3.3V/8MHz) is a microcontroller board based on the ATmega328.
  • Arduino Micro, etc, (5V/16MHz, 3.3V/8MHz) is a microcontroller board based on the ATmega32U4.
  • Arduino Mega 2560, etc, (5V/16MHz) is a microcontroller board based on the ATmega2560.
  • Arduino Due, etc, (3.3V/84MHz) is a microcontroller board based on the AT91SAM3X8E.
  • Arduino Zero, etc, (3.3V/48MHz) is a microcontroller board based on the ATSAMD21G18 ARM Cortex M0+.
  • Arduino Nano 33, etc, (3.3V/120MHz) is a microcontroller board based on the ATSAMD51 Cortex M4.
  • Espressif ESP32 WROOM, etc, (3.3V/240MHz) is a microcontroller board based on the Espressif Xtensa® dual-core 32-bit LX6.
  • Raspberry Pi 4 Model B (5.1V/1.5GHz) is a microcontroller board based on the Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC.
  • Raspberry Pi Zero W (5.1V/1GHz) is a microcontroller board based on the Broadcom BCM2837B0 64-bit ARM Cortex-A53 Quad Core Processor SoC.
  • Etc…

People can contact us: https://www.donluc.com/?page_id=1927

Technology Experience

  • Programming Language
  • Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc…)
  • IoT
  • Wireless (Radio Frequency, Bluetooth, WiFi, Etc…)
  • Robotics
  • Camera and Video Capture Receiver Stationary, Wheel/Tank and Underwater Vehicle
  • Unmanned Vehicles Terrestrial and Marine
  • Machine Learning
  • RTOS
  • Research & Development (R & D)

Instructor, E-Mentor, STEAM, and Arts-Based Training

  • Programming Language
  • IoT
  • PIC Microcontrollers
  • Arduino
  • Raspberry Pi
  • Espressif
  • Robotics

Follow Us

Luc Paquin – Curriculum Vitae – 2023
https://www.donluc.com/luc/

Web: https://www.donluc.com/
Facebook: https://www.facebook.com/neosteam.labs.9/
YouTube: https://www.youtube.com/@thesass2063
Twitter: https://twitter.com/labs_steam
Pinterest: https://www.pinterest.com/NeoSteamLabs/
Instagram: https://www.instagram.com/neosteamlabs/

Don Luc

Categories
Archives