top of page
Technology
Screenshot (781).png

SMART BRIDGE

  • stemlabrkmvp
  • Dec 20, 2024
  • 4 min read

Smart Bridge System using Arduino Uno

Creating a Smart Bridge system involves using sensors to monitor the bridge's condition (such as vibration, tilt, strain, temperature, etc.) and sending data to a central system for analysis and alerts. For simplicity, this example will show how to set up a basic version of a Smart Bridge using an Arduino Uno, some basic sensors, and a way to send alerts via LED or Serial Monitor.

Components Required

  1. Arduino Uno - The main microcontroller to read sensor data and send alerts.

  2. Accelerometer (ADXL345) - Measures vibrations or movements in the bridge.

  3. Temperature Sensor (LM35) - Monitors temperature changes that might affect the bridge's structural integrity.

  4. Strain Gauge or Force Sensor (Flex Sensor) - Measures strain on the bridge structure.

  5. LED - To signal an alert if a threshold is crossed (such as vibration or strain levels being too high).

  6. Buzzer - Optional, for audible alerts.

  7. Jumper Wires - To connect components.

  8. Breadboard - To build the circuit.

Wiring Diagram

  1. Accelerometer (ADXL345):

    • Connect the VCC to 5V on the Arduino.

    • Connect GND to Ground.

    • Connect SDA to A4 (on Arduino Uno).

    • Connect SCL to A5 (on Arduino Uno).

  2. Temperature Sensor (LM35):

    • Connect the VCC to 5V.

    • Connect GND to Ground.

    • Connect the Output Pin to A0 on the Arduino.

  3. Strain Sensor (Flex Sensor):

    • Connect one end to 5V and the other end to Analog Pin A1 with a resistor between the sensor and the ground.

  4. LED:

    • Connect the long leg (anode) of the LED to Pin 13.

    • Connect the short leg (cathode) to GND via a 220-ohm resistor.

  5. Buzzer (Optional):

    • Connect the positive leg of the buzzer to Pin 12.

    • Connect the negative leg to GND.

Arduino Code

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>

// Define pin numbers
const int ledPin = 13;
const int buzzerPin = 12;
const int flexPin = A1;
const int tempPin = A0;

// Initialize ADXL345 accelerometer
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

// Threshold values for sensors
float vibrationThreshold = 2.0;  // Example threshold for vibration
int strainThreshold = 300;       // Example threshold for strain
float temperatureThreshold = 30.0;  // Example temperature threshold in Celsius

void setup() {
  // Start serial communication
  Serial.begin(9600);

  // Initialize LED and Buzzer
  pinMode(ledPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);

  // Initialize accelerometer
  if (!accel.begin()) {
    Serial.println("Couldn't find the ADXL345 sensor");
    while (1);
  }

  // Initialize flex sensor
  pinMode(flexPin, INPUT);

  // Initialize temperature sensor
  pinMode(tempPin, INPUT);
}

void loop() {
  // Read accelerometer data
  sensors_event_t event;
  accel.getEvent(&event);
  float acceleration = event.acceleration.x + event.acceleration.y + event.acceleration.z;

  // Read temperature sensor data
  int tempReading = analogRead(tempPin);
  float temperature = (tempReading * 5.0 * 100.0) / 1024.0;  // Convert analog to temperature

  // Read flex sensor data (strain measurement)
  int strainValue = analogRead(flexPin);

  // Check if any condition exceeds the threshold
  if (acceleration > vibrationThreshold || strainValue > strainThreshold || temperature > temperatureThreshold) {
    // Turn on LED and buzzer for alert
    digitalWrite(ledPin, HIGH);
    digitalWrite(buzzerPin, HIGH);
    Serial.println("Warning! Bridge stress detected.");
  } else {
    // Turn off LED and buzzer if everything is normal
    digitalWrite(ledPin, LOW);
    digitalWrite(buzzerPin, LOW);
    Serial.println("Bridge is stable.");
  }

  // Delay before next reading
  delay(1000);  // Delay 1 second
}

Explanation of the Code

  1. Libraries:

    • We use the Wire.h library to communicate with the ADXL345 accelerometer over I2C.

    • The Adafruit_Sensor.h and Adafruit_ADXL345_U.h libraries handle data collection from the accelerometer.

  2. Pin Definitions:

    • The LED and buzzer are connected to Pins 13 and 12, respectively.

    • The flex sensor (representing strain) is connected to A1, while the temperature sensor is connected to A0.

  3. Sensor Initialization:

    • The ADXL345 accelerometer is initialized and used to detect vibrations and movements on the bridge.

    • The LM35 temperature sensor measures the bridge's temperature, which can be used to detect potential issues like thermal expansion.

    • The flex sensor is used to measure the strain on the bridge (this can be a proxy for physical stress on the structure).

  4. Main Loop:

    • The code continuously reads data from the sensors (vibration, temperature, and strain).

    • If any sensor reading exceeds the predefined threshold (indicating potential stress or damage), the system triggers the LED and buzzer as an alert.

    • If everything is normal, the LED is turned off, and the buzzer remains silent.

How to Use this Smart Bridge System:

  1. Build the Circuit on a breadboard using the components listed.

  2. Upload the code to your Arduino Uno using the Arduino IDE.

  3. Once the system is up and running, it will continuously monitor the vibration, strain, and temperature of the bridge.

  4. If any readings exceed the thresholds, the system will alert the user by lighting up the LED and activating the buzzer.

  5. The data can also be viewed on the Serial Monitor for real-time feedback.

Expanding the System:

To make the bridge smarter, you can:

  • Add more sensors, like humidity or seismic sensors.

  • Use Wi-Fi (ESP8266/ESP32) to send alerts or sensor data to a cloud platform for remote monitoring.

  • Implement GPS functionality to track the location of the bridge and manage multiple bridges in a network.

  • Add a display (e.g., an LCD or OLED screen) to show real-time data about the bridge’s health.

This simple project demonstrates the potential for smart infrastructure in monitoring the safety and condition of bridges using low-cost sensors and the Arduino platform.

 
 
 

Recent Posts

See All
Code anti sleep alarm car

To create an Anti-Sleep Alarm Car System  using an Arduino Uno , we need to address a few limitations of the Arduino platform. The...

 
 
 

Comments


bottom of page