Skip to content

okyang/esp32PlantCam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ESP32 Plant CAM

A solar-powered time-lapse camera for your plants.

thumbnail

Main Features:

  • takes time-lapses of your plants outdoors
  • solar-powered
  • uses xiao esp32s3
  • sends images to gofile.io api server

Table of Contents:

Demo

Quick timelapse created from the ESP32 Plant Cam πŸ˜„!

Download demo.mp4 here

Full instructional video coming soon...

Build Instructions

Materials Used

Tools Used

  • Soldering Station

    • Soldering Iron
    • Solder Fume Extractor
  • 3D Printer

Step - Assemble the Circuit

Refer to this diagram for soldering all the components together:

circuit diagram

Use the XIAO ESP32S3 pinout diagram for on which pins to use when soldering:

pinout for xiao esp32s3

  1. Take off the camera module to expose the pin holes

  2. Then solder the end of the JST 2-Pin Female Connector to the XIAO-ESP32S3

    1. The red wire should go to the 3V3 pin

    2. The black wire should go to the GND pin

      soldering the wires to the esp32s3
  3. Then connect the JST female end to the LOAD out port on the bq24074

    reference to where to connect the cable to the bq24074
  4. Next, put the camera module back on the XIAO-ESP32S3

    camera module on the esp32s3
  5. Next, plug in the LIPO battery to the bq24074

  6. Finally, this is a bit annoying, but for the 6V 2W Solar Panel, you'll have to cut the male end off, feed it through the hole in the flanged weather proof enclosure, and solder it directly to the female barrel connector on the bq24074.

    1. I had to do this because if I plugged a male barrel connector in, it wouldn't fit on in the flanged weather proof enclosure I got.

Step - Assemble the Backboard

  1. Laser cut the assembly/back-board-cutout.svg on a 3mm thick piece of wood

  2. 3D print the plant_cam_xiao_holder.stl

    1. also use a soldering iron to insert the M3 threaded inserts
    backboard orientation
  3. 3D print the esp32 seatbelt seat_belt.stl

  4. 3D print 2 of the battery_holder.stl

  5. Super glue the 3D prints to the backboard in this orientation:

    backboard orientation
  6. Add all the electronics to the backboard in the same orientation as the picture

  7. Add the seatbelt to over the ESP32S3 with 2 M3 screws to make sure it doesn't fall out

ℹ️: I want to improve this in the future and just make one solid 3D printed piece.

Step - Arduino Preparation

Reference: Seeed Studio | xiao esp32s3 Software Preparation

  1. Install Arduino 2.3.7+

    1. Download Link: https://www.arduino.cc/en/software/
    2. Download Link for Nerds: https://github.com/arduino/arduino-ide/releases/tag/2.3.7
  2. Add Board URL

    1. Navigate to: File -> Preferences
    2. In the text box labeled "Additional boards manager URL's" insert the following
      1. https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
    3. Then click OK
  3. Install esp32 Board Drivers

    1. On the left side panel, click on the Boards Manager Icon
    2. Then search for "esp32"
    3. Install "esp32 by Espressif Systems"
      1. ❗ If you run into the DEADLINE_EXCEEDED error, follow this workaround
  4. Select the esp32s3 board

    arduino prep select esp32s3
  5. IMPORTANT: Turn on PSRAM option

    1. Follow instructions
      1. Go to Tools > PSRAM
      2. Then select OPI PSRAM

Step - Setup Gofile

  1. Get your gofile.io API token
    1. Make an account

      gofile create account screenshot
    2. Go to My Profile

      gofile my profile screenshot
    3. ⭐ Copy your Account Token

      gofile account token screenshot

Step - Get your Gofile folder ID

  1. Make folder for your Images

    1. I created one called "plant_cam"

      gofile create folder screenshot
    2. For your Folder, click on the three dots and click Properties

      gofile properties screenshot
    3. ⭐ Copy your folder id:

      1. ℹ️ we will use this id to upload images to
      gofile folder id screenshot

Step - Create Your Config File

  1. Create a config.h file in the same folder as plant_cam.ino

    .
    └── plant_cam/
       β”œβ”€β”€ camera_index.h
       β”œβ”€β”€ camera_pins.h
       β”œβ”€β”€ plant_cam.ino
       └── config.h  <---- Create this file here
  2. Get your gofile account token from step - setup gofile

  3. Get your gofile folder id from step - get your gofile folder id

  4. Add the following variables to the file, and fill out your own values:

    const char *ssid = "YOUR_NETWORK_SSID";
    const char *password = "YOUR_NETWORK_PASSWORD";
    const String folderId = "YOUR_GOFILE_FOLDER_ID";
    const String bearerToken = "YOUR_GOFILE_AUTHORIZATION_TOKEN";

Step - Upload the Arduino Code

  1. Finally, go ahead and upload the Arduino code to the XIAO ESP32S3

Step - Squish the Backboard into the Weatherproof Enclosure

  1. Open up the weatherproof enclosure
  2. Slide the end of the backboard to align with the hole
  3. Screw 2 M6 screws to secure in place
  4. Finally, close the lid on the weather proof enclosure
  5. For mounting, I don't have specific instructions, because you can mount the enclosure and solar panel anywhere you want with the mounting holes.
    1. Personally, I just mounted it to some spare aluminum extrusion I had.

thumbnail

Circuit Diagram

Refer to this diagram for soldering all the components together:

circuit diagram

Use the XIAO ESP32S3 pinout diagram for on which pins to use when soldering:

pinout for xiao esp32s3

Code Explanation

The basic flow for code is:

  1. initialize the SD card
  2. initialize wifi <--- this will loop until successful
  3. initialize the camera
  4. take a photo
  5. send it to the gofile server

Things I Learned

One useful tip for linux users is to use AppImageLauncher. I use Ubuntu and an AppImage for Arduino IDE 2.0, but one thing that annoys me about using an AppImage is having to keep track of where the AppImage executable is. To circumvent this problem, I learned about this tool called AppImageLauncher that manages your AppImages and integrates it in your desktop.

Improvement Considerations

To avoid scope creep, I'll just write down my thoughts here, otherwise I'll never finish this project πŸ˜…. Some improvement ideas include:

  • Having a LED to signal Wifi Connection
    • I can only find out until it takes a picture
  • Using a higher definition camera module with auto-focusing
  • Overall design simplifications
    • As I was writing the instructions, I realized how many steps there were to assemble this. To improve I think I can:
      • make the back-board one assembled piece
      • have a bigger weather proof enclosure to fit everything better.

Resources

Onshape files

  • esp32 plant cam - my cad files I designed for this project. It's probably not the best, I'm still learning.

esp32s3

Solar Charger

Other Links

Past Projects

About

An esp32 powered timelapse camera for plants.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors