Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Sensor Data Acquisition System with Bluetooth and Wi-Fi Connectivity

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Sensor Data Acquisition System with Bluetooth and Wi-Fi Connectivity

Circuit Documentation

Summary

This circuit integrates a variety of sensors and modules to create a multifunctional system capable of sensing motion, touch, sound, and providing wireless communication capabilities. The core of the circuit is an Arduino UNO microcontroller, which interfaces with an MPU-6050 gyroscope and accelerometer, an Adafruit MPR121 capacitive touch sensor, a SparkFun Electret Microphone for audio input, an HC-05 Bluetooth module for wireless data transmission, and an ESP8266 ESP-01 WiFi module for network connectivity. A Bi-Directional Logic Level Converter is used to safely step down the 5V signals from the Arduino to 3.3V levels required by the ESP8266. The entire system is powered by a 9V battery connected to the Arduino's Vin pin.

Component List

Wiring Details

Arduino UNO

MPU-6050

Adafruit MPR121

HC-05 Bluetooth Module

ESP8266 ESP-01 WiFi Module

Bi-Directional Logic Level Converter

SparkFun Electret Microphone Breakout

9V Battery

Adafruit ADXL345

Documented Code

#include <Wire.h>
#include <Adafruit_ADXL345_U.h>
#include <MPU6050.h>
#include <Adafruit_MPR121.h>
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>

// ADXL345 Accelerometer
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

// MPU6050 Gyroscope
MPU6050 mpu;

// MPR121 Capacitive Sensor
Adafruit_MPR121 cap = Adafruit_MPR121();

// HC-05 Bluetooth Module
SoftwareSerial BTSerial(2, 3); // RX, TX

// Wi-Fi Module ESP8266
SoftwareSerial espSerial(10, 11); // RX, TX for ESP8266

// Microphone Sensor (Analog)
int micPin = A0;

void setup() {
  Serial.begin(9600);
  Wire.begin();

  // Initialize Accelerometer
  if (!accel.begin()) {
    Serial.println("Could not find a valid ADXL345 sensor, check wiring!");
    while (1);
  }

  // Initialize Gyroscope
  mpu.initialize();
  if (!mpu.testConnection()) {
    Serial.println("MPU6050 connection failed");
    while (1);
  }

  // Initialize Capacitive Sensor
  if (!cap.begin(0x5A)) {
    Serial.println("MPR121 not found, check wiring?");
    while (1);
  }

  // Initialize Bluetooth Module
  BTSerial.begin(9600);
  Serial.println("Bluetooth module ready");

  // Initialize Wi-Fi Module
  espSerial.begin(9600);
  Serial.println("ESP8266 module ready");

  // Battery Setup (if any voltage monitoring needed)
}

void loop() {
  // Read ADXL345 Accelerometer
  sensors_event_t event;
  accel.getEvent(&event);
  Serial.print("Accel X: "); Serial.print(event.acceleration.x); Serial.print(" m/s^2 ");
  Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" m/s^2 ");
  Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.println(" m/s^2");

  // Read MPU6050 Gyroscope
  Serial.print("MPU6050 Gyro X: "); Serial.println(mpu.getRotationX());
  Serial.print("Y: "); Serial.println(mpu.getRotationY());
  Serial.print("Z: "); Serial.println(mpu.getRotationZ());

  // Read Capacitive Sensors
  uint16_t touched = cap.touched();
  for (uint8_t i = 0; i < 12; i++) {
    if (touched & (1 << i)) {
      Serial.print("Electrode "); Serial.print(i); Serial.println(" was touched");
    }
  }

  // Read Microphone (Analog)
  int micValue = analogRead(micPin);
  Serial.print("Mic Value: "); Serial.println(micValue);

  // Bluetooth Communication
  if (BTSerial.available()) {
    char btData = BTSerial.read();
    Serial.print("Bluetooth Data: "); Serial.println(btData);
  }

  // Wi-Fi Communication (example: send AT command)
  espSerial.println("AT");
  if (espSerial.available()) {
    String espData = espSerial.readString();
    Serial.print("ESP8266 Response: "); Serial.println(espData);
  }

  delay(1000);  // Adjust the delay as necessary
}

This code initializes and reads data from the various sensors connected to the Arduino UNO. It also handles serial communication with the HC-05 Bluetooth module and the ESP8266 WiFi module. The accelerometer data is read and printed to the serial monitor, as is the gyroscope data from the MPU6050. The capacitive touch states are checked and reported,