subscribe here

electronic tamil

subscribe to our youtube channel " ELECTRONIC TAMIL ".keep suporting ..

14 Dec 2020

Agni satellite



 Agni satellite

it is a mini cube satellite it is in the size of 4x4x4 CM.The circuit includes components like the Arduino Pro Mini, BMP180, MPU6050, SD card module, DHT11, and an LED, all connected for telemetry data collection and storage. Below is the Arduino code corresponding to this setup:



circuit diagram

 



  • DHT11: Connect data pin to pin 2, VCC to 3.3V or 5V, and GND to ground.
  • MPU6050: Connect SDA to A4, SCL to A5, VCC to 3.3V or 5V, and GND to ground.
  • BMP180: Similar to MPU6050, connect SDA to A4 and SCL to A5.
  • SD Card Module: Connect CS to pin 10, MOSI to pin 11, MISO to pin 12, SCK to pin 13, VCC to 3.3V or 5V, and GND to ground.
  • LED: Connect it to pin 5 with a resistor in series to limit current.

  • Block diagram





    code

    #include "Wire.h"
    #include "Adafruit_Sensor.h"
    #include "Adafruit_BMP085.h"
    #include "MPU6050.h"
    #include "DHT.h"
    #include "SD.h"

    // Pin definitions
    #define DHT_PIN 2
    #define DHT_TYPE DHT11
    #define LED_PIN 5
    #define SD_CS_PIN 10

    // Sensor objects
    Adafruit_BMP085 bmp;
    MPU6050 mpu;
    DHT dht(DHT_PIN, DHT_TYPE);

    // File object for SD card
    File dataFile;

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

    // Initialize LED pin
    pinMode(LED_PIN, OUTPUT);

    // Initialize DHT sensor
    dht.begin();

    // Initialize BMP180
    if (!bmp.begin()) {
    Serial.println("BMP180 initialization failed!");
    while (1);
    }

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

    // Initialize SD card
    if (!SD.begin(SD_CS_PIN)) {
    Serial.println("SD card initialization failed!");
    while (1);
    }

    Serial.println("System Initialized Successfully!");
    }

    void loop() {
    // Read DHT11 data
    float humidity = dht.readHumidity();
    float temperature = dht.readTemperature();

    // Read BMP180 data
    float pressure = bmp.readPressure() / 100.0; // Convert Pa to hPa

    // Read MPU6050 data
    int16_t ax, ay, az, gx, gy, gz;
    mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

    // Blink LED
    digitalWrite(LED_PIN, HIGH);
    delay(100);
    digitalWrite(LED_PIN, LOW);

    // Log data to SD card
    dataFile = SD.open("telemetry.txt", FILE_WRITE);
    if (dataFile) {
    dataFile.print("Temp: "); dataFile.print(temperature); dataFile.print(" C, ");
    dataFile.print("Hum: "); dataFile.print(humidity); dataFile.print(" %, ");
    dataFile.print("Pressure: "); dataFile.print(pressure); dataFile.print(" hPa, ");
    dataFile.print("Accel: "); dataFile.print(ax); dataFile.print(", "); dataFile.print(ay); dataFile.print(", "); dataFile.print(az); dataFile.print(", ");
    dataFile.print("Gyro: "); dataFile.print(gx); dataFile.print(", "); dataFile.print(gy); dataFile.print(", "); dataFile.println(gz);
    dataFile.close();
    Serial.println("Data logged.");
    } else {
    Serial.println("Error opening telemetry.txt");
    }

    delay(1000); // Log data every second
    }







    No comments:
    Write comments

    Hey, we've just launched a new custom color Blogger template. You'll like it - https://www.electronictamil.ga/
    Join Our Newsletter