pasquale887
Published © Apache-2.0

SkySense - The Perfect Flying Laboratory

A flying laboratory equipped with everything you need. : ESP32 Cam, BME680, and Wio Tracker L1 Series. Perfect for any occasion.

IntermediateWork in progress24 hours29

Things used in this project

Hardware components

Seeed Studio Wio Tracker L1 Series
One for the ground station and the other for the laboratory
×2
Esp32cam
×1
Micro SD
×1
Grove - Temperature, Humidity, Pressure and Gas Sensor (BME680)
Seeed Studio Grove - Temperature, Humidity, Pressure and Gas Sensor (BME680)
×1
Battery 1860 3.7V
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Machine Screw, M3
Machine Screw, M3
×6
Machine Screw, M2
Machine Screw, M2
×2
Hot Air Balloon
×1
Rope 1m
×1

Software apps and online services

Fusion
Autodesk Fusion
Arduino IDE
Arduino IDE
Meshtastic
Meshtastic
Fritzing.

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

Base Capsule

Sketchfab still processing.

Capsule Lid

Sketchfab still processing.

Internal Structure

Sketchfab still processing.

Schematics

Diagram

Code

ESP32CAM Code

Arduino
#include "esp_camera.h"
#include "FS.h"
#include "SD_MMC.h"

// ESP32-CAM AI-Thinker pin definition
#define PWDN_GPIO_NUM     -1
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM      0
#define SIOD_GPIO_NUM     26
#define SIOC_GPIO_NUM     27

#define Y9_GPIO_NUM       35
#define Y8_GPIO_NUM       34
#define Y7_GPIO_NUM       39
#define Y6_GPIO_NUM       36
#define Y5_GPIO_NUM       21
#define Y4_GPIO_NUM       19
#define Y3_GPIO_NUM       18
#define Y2_GPIO_NUM        5
#define VSYNC_GPIO_NUM    25
#define HREF_GPIO_NUM     23
#define PCLK_GPIO_NUM     22

void setup() {
  Serial.begin(115200);
  Serial.println("Starting ESP32-CAM...");

  // Camera configuration
  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer   = LEDC_TIMER_0;
  config.pin_d0       = Y2_GPIO_NUM;
  config.pin_d1       = Y3_GPIO_NUM;
  config.pin_d2       = Y4_GPIO_NUM;
  config.pin_d3       = Y5_GPIO_NUM;
  config.pin_d4       = Y6_GPIO_NUM;
  config.pin_d5       = Y7_GPIO_NUM;
  config.pin_d6       = Y8_GPIO_NUM;
  config.pin_d7       = Y9_GPIO_NUM;
  config.pin_xclk     = XCLK_GPIO_NUM;
  config.pin_pclk     = PCLK_GPIO_NUM;
  config.pin_vsync    = VSYNC_GPIO_NUM;
  config.pin_href     = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn     = PWDN_GPIO_NUM;
  config.pin_reset    = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;

  // Resolution and quality
  config.frame_size = FRAMESIZE_SVGA;  // 800x600 (try UXGA, VGA, QVGA...)
  config.jpeg_quality = 12;            // 0-63 (lower = better quality)
  config.fb_count = 1;

  // Initialize camera
  if (esp_camera_init(&config) != ESP_OK) {
    Serial.println("Camera init failed!");
    return;
  }

  // Initialize SD card
  if (!SD_MMC.begin("/sdcard", true)) { // true = 1-bit mode (more stable)
    Serial.println("SD Card Mount Failed!");
    return;
  }

  if (SD_MMC.cardType() == CARD_NONE) {
    Serial.println("No SD Card detected!");
    return;
  }

  Serial.println("Initialization done!");
}

void loop() {
  // Capture photo
  camera_fb_t * fb = esp_camera_fb_get();
  if (!fb) {
    Serial.println("Camera capture failed!");
    return;
  }

  // Create unique file name
  static int photo_num = 0;
  String path = "/photo_" + String(photo_num++) + ".jpg";

  // Save to SD
  fs::FS &fs = SD_MMC;
  File file = fs.open(path.c_str(), FILE_WRITE);
  if (!file) {
    Serial.println("Failed to open file for writing!");
  } else {
    file.write(fb->buf, fb->len);
    Serial.printf("Saved file: %s (%u bytes)\n", path.c_str(), fb->len);
  }
  file.close();

  // Return the frame buffer back to the driver
  esp_camera_fb_return(fb);

  // Wait 15 seconds
  delay(15000);
}

Credits

pasquale887
4 projects • 8 followers

Comments