Circuit Documentation
Summary of the Circuit
This circuit integrates a variety of sensors and modules with an Arduino UNO microcontroller to perform multiple functions including GPS tracking, heart rate monitoring, temperature and humidity sensing, and motion detection through an accelerometer. The Arduino UNO serves as the central processing unit, interfacing with the GPS NEO 6M module for location tracking, the Heart Pulse Sensor for monitoring heartbeat, the MKE-S14 DHT11 Temperature and Humidity Sensor for environmental data, and the adxl345 keystudio accelerometer for motion detection. The circuit is designed to read data from these sensors and output the information through the Arduino's serial interface.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- It has 14 digital input/output pins, 6 analog inputs, a USB connection, a power jack, an ICSP header, and a reset button.
Heart Pulse Sensor
- A plug-and-play heart-rate sensor for Arduino
- It can be used to measure the electrical activity of the heart.
GPS NEO 6M
- A GPS module that provides location data via satellite positioning
- It communicates with the Arduino via serial communication.
MKE-S14 DHT11 Temperature And Humidity Sensor
- A basic, ultra low-cost digital temperature and humidity sensor
- It uses a capacitive humidity sensor and a thermistor to measure the surrounding air.
adxl345 keystudio
- A small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement
- It measures the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion or shock.
Wiring Details
Arduino UNO
Vinconnected to the 5V power supply netGNDconnected to the ground netA0connected to the Heart Pulse Sensor signal outputA4(SDA) connected to the adxl345 keystudio SDA pinA5(SCL) connected to the adxl345 keystudio SCL pinD3connected to the DHT11 signal pinD4connected to the GPS NEO 6M RX pinD5connected to the GPS NEO 6M TX pin
Heart Pulse Sensor
VCCconnected to the 5V power supply netGNDconnected to the ground netSIGNALconnected to Arduino UNOA0
GPS NEO 6M
VCCconnected to the 5V power supply netGNDconnected to the ground netRXconnected to Arduino UNOD4TXconnected to Arduino UNOD5
MKE-S14 DHT11 Temperature And Humidity Sensor
5Vconnected to the 5V power supply netGNDconnected to the ground netSIGconnected to Arduino UNOD3
adxl345 keystudio
5Vconnected to the 5V power supply netGNDconnected to the ground netSDAconnected to Arduino UNOA4SCLconnected to Arduino UNOA5
Documented Code
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <DHT.h>
#include <SoftwareSerial.h>
// Pin definitions
#define HEARTBEAT_PIN A0
#define DHT_PIN 3
#define GPS_RX_PIN 4
#define GPS_TX_PIN 5
// DHT11 setup
#define DHTTYPE DHT11
DHT dht(DHT_PIN, DHTTYPE);
// ADXL345 setup
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);
// GPS setup
SoftwareSerial gpsSerial(GPS_RX_PIN, GPS_TX_PIN);
void setup() {
Serial.begin(9600);
gpsSerial.begin(9600);
dht.begin();
if (!accel.begin()) {
Serial.println("No ADXL345 detected!");
while (1);
}
Serial.println("Setup complete.");
}
void loop() {
// Read heartbeat sensor
int heartbeat = analogRead(HEARTBEAT_PIN);
Serial.print("Heartbeat: ");
Serial.println(heartbeat);
// Read DHT11 sensor
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.println(" *C");
// Read ADXL345 sensor
sensors_event_t event;
accel.getEvent(&event);
Serial.print("X: ");
Serial.print(event.acceleration.x);
Serial.print(" \tY: ");
Serial.print(event.acceleration.y);
Serial.print(" \tZ: ");
Serial.print(event.acceleration.z);
Serial.println(" m/s^2");
// Read GPS data
while (gpsSerial.available()) {
char c = gpsSerial.read();
Serial.print(c);
}
delay(2000); // Delay for 2 seconds
}
This code initializes and reads data from the connected sensors, outputting the results to the serial monitor. It includes setup and loop functions that are standard in Arduino programming. The setup() function initializes the serial communication, sensors, and checks for the presence of the ADXL345 accelerometer. The loop() function reads data from the heartbeat sensor, DHT11 sensor, ADXL345 accelerometer, and GPS module, printing the results to the serial monitor every two seconds.
