Categories
Uncategorized

DS3231 Using Capacitor as a 2032 Battery Replacement

This is a really great way to avoid buying the LIR2032 batteries. It’s very hard to find them in my little town, they’re in stock at times and I hate delaying a project because of a lack of batteries.

So I had the bright idea to use a 5v 4F capacitor instead!

Does it work? Yes. But…. only for about 2 days. But since this capcitor is only about 80 cents bought in packs of 20 I had to give it a try.

I would say that 95% of my instances of losing my clocks time due to power loss was because I didn’t set the battery in properly or it was during the testing phase/development stage and I was too lazy to put a battery into the RTC. Some where from momentary power loss from a loose or broken wire.

Most of my camera projects include solar power. If I’ve lost power because my 18650 batteries have run dry even with the solar in place… I’ve got bigger problems. This is more about keeping power to the RTC while changing out batteries from the projects.

For example, if I use AA batteries in a project and need to swap them out because they’re getting a little low it should only take about 2 minutes to swap them out. But if there’s no battery in the DS3231 I’ll lose my clocks time. With this capacitor in place it won’t lose the time.

For an even cheaper solution, check out this article: Click Here.

How to do it:

First let’s prepare our RTC

We’re going to take the split tab in the center of the photo above and bend it backwards. The little anchor pins might pop out and that’s fine!

The split metal part that we just bent outwards is the negative terminal. If you want to double check please plug in our RTC and check to make sure yours is the same as mine. In the photo above the split tongue part is the negative and the part on the left of the photo that grips the 2032 battery into place is the positive. If I plug my RTC into a breadboard for example, the pin CLOSEST to the board is the positive.

The Positive terminal on our capacitor is the one at the left of the photo above. We’re going to bend that pin out flat.

Next, bend the pin back up but do it closer to the center point. I usually go about the distance of the skinny part into the main part with my thumbnail. It used to be bent where the skinny part meets the thick part. I’ve bent it about 4-5mm farther in. You’ll be able to see where to bend it later as you put these two together.

You can see how the positive pin is bent now so that it meets the right spot on the RTC board. I’ve soldered the negative pins together already.

Time to solder the negative pins together. Try placing the capacitor where you want it so that you can see where the two points should meet. If you go too long that’s fine, you can always just push the pins down to make room.

Here’s another view just before I did the soldering. You can see how the two negative pins meet up.

Time to squish them together! The positive pin should go between the outer black plastic and the metal terminal. It will be a little tight at first but go for it. Once it snaps down into place it fits quite nicely. If you really want to, you can drop some solder in there or wrap the whole thing with a bit a tape.

That’s it my friends! Please don’t ever hesitate to ask question on here I love to help people out with their projects.

Categories
Uncategorized

DIY Wireless SD Card Wemos D1 ESP8266

Features of the Wireless SD Card

This is such an amazing little tool to have for so many reasons.

Photos of how to connect and use this device are at the bottom of the article past the sketch.

Broadcasts its own wifi signal for you to connect to.

Use a free FTP app on your smartphone or PC to send and receive photos, videos or files.

It uses the exact same IP address every time so once you’ve set it up in your FTP manager you just click a button to send files.

Powered by good old fashioned USB or a 5v source.

Let’s talk about speeds

The speed of this device is not going to win any races but the low cost of a WemosD1 makes this worth it.

Upload speed is between 100 to 200 KBPS that’s kilobytes per second.
Download is faster at 200 to 300 KBPS.

When I tested the speeds I downloaded a 3.5MB photo and it took just under 10 seconds. This is the kind of device where you select all of the photos you want to move, click start and then go about another multitask.

I’m using an Iphone and an app called FTPManager that allows for one free connection at a time. The full app is $3.99

Wiring Schematic

MicroSD WemosD1
CS D4
SCK D5
MOSI D7
MISO D6
VCC 5V
GND GND

The Sketch

Important: You need three files, the sketch below is the first and then you need two more in the same folder as the sketch that can be downloaded here: CLICK HERE

#include <SD.h>
#include <ESP8266WiFi.h>
#include "ESP8266FtpServer.h"
const char* ssid = "SDcard1";
const char* password = "12345678";
// config static IP
IPAddress apIP(192, 168, 12,7);  
IPAddress gateway(192, 168,12, 7);
IPAddress subnet(255, 255, 255, 0); 
FtpServer ftpSrv;//set #define FTP_DEBUG in ESP8266FtpServer.h to see ftp verbose on serial
void setup(void){
  Serial.begin(115200);
  Serial.println("");
  //Setting the Ip address for the WiFi connectivity
  WiFi.config(apIP, gateway, subnet);
  Serial.println();
  Serial.print("Configuring access point...");
  //Setting the esp to softaccess point mode
  WiFi.mode(WIFI_AP);
  WiFi.disconnect();
  delay(100);
  //changing softAP config and starting the Start AP
  WiFi.softAPConfig(apIP, gateway, subnet);
  WiFi.softAP(ssid, password);
  Serial.println("Access point completed");  
  //2 indicates the Chip select pin
  if (SD.begin(D4)) {
      Serial.println("SD opened!");
      ftpSrv.begin("esp8266","esp8266");    //username, password for ftp.  set ports in ESP8266FtpServer.h  (default 21, 50009 for PASV)
  }
  else
  {
    Serial.println("SD not opened");   
  }
}
void loop(void){
  ftpSrv.handleFTP();        //make sure in loop you call handleFTP()!!   
}

Using the wireless sd card with my Iphone:

Open up your wifi connections and select SDcard1. If you want a different wifi signal look for these lines in the sketch above:
const char* ssid = “SDcard1”;
const char* password = “12345678”;

Change SDcard1 to what ever you like, the password is 12345678

Now open up your favorite ftp app, I’m using FTPManager Pro.

In the photo above you can see the PLUS sign at the top right, click that.

Then select FTP

Display Name can be what ever you want to show in the app, it doesn’t have to be the same as the wifi signal but I did keep it the same.

Type in the IP address of 192.168.12.7

Leave everything else alone except username and password which are both esp8266 and this can also be changed in the sketch

Categories
Uncategorized

Wildlife Trap Monitoring Camera

This is a DIY project guide or you can order a ready to go camera from us that’s pre-programmed.

In the photo above you can see the black box leaning against the trap. You’ll get better range by trying to keep the camera farther away from the ground but I thought for range testing this would be a good start. You can use any usb power bank.

There are smaller power banks with single cells that will fit inside the case I’ve used.

So what does it look like on my iphone 6s?

Parts you’ll need:

ESP32-CAM $15 Canadian
FTDI USB Programming Connector $15 Canadian
USB connection cable

Power Source:
USB battery bank

Software you’ll need:
Arduino IDE

What does this do?
This project will create a simple live streaming camera that puts an image onto any smart phone or tablet that can connect to a wifi signal.

The camera comes with a wifi broadcast that you can name and set a password for. You connect your smartphone to the wifi signal from this camera and open your browser. Type in 192.169.4.1 and you’ll have the camera’s menu shown on your screen. It’s really that easy.

Let’s talk about the range for a minute.

The basic build in this guide, has a range of about 200-300 feet. You can get an ESP32-CAM that has a better antenna but you’ll need to be able to do some tiny, TINY soldering that requires some skill.

We do offer a service where I solder the pin pads that you need for the better antenna and there will be a guide coming soon on how to do it. Please get in touch with us. ryan@starairvision.com

Ok, back to more range options. I’m currently working on a wifi repeater that will extend the range to your smartphone to over 500 feet. With the right antenna setup the range is even better. More articles coming soon.

So what can we do with the 200 foot range?

This is simply a great way to check your trap without getting too close. Perhaps you’re out in the field for a week trapping wildlife for science and studying purposes. This is a perfect way to monitor the trap from a distance keeping your smell away from the site.

Categories
Uncategorized

Streaming IP Camera Range Test With Mesh Network

Sign up for our free newsletter for updates on cool projects

This is an add on project to our wildlife remote viewing camera. The difference here is that you won’t need a local LAN because the camera has its own access point built in.

Purpose of This Project

To find the maximum range of the wireless camera to a smartphone.
To find the maximum range using a repeater system called mesh networking.

Step one in this project was to build the ESP32-cam’s streaming system without needing a router. The camera has its own access point. I will then attach repeaters and spread the system out seeing how many nodes/repeaters we can use before the system will collapse.

Line of Sight vs Forest Landscape

We have two very different environments to discuss. Without much difficulty (money) we can send this camera’s signal 20kms away and feed it to the internet for viewers around the world. Sounds amazing right? But 99 times out of 100 the areas we want to place a camera do not have direct line of sight rendering the amazingness useless. Sorry I like to use made up words sometimes, get used to it.

If you’re monitoring something with this camera on top of a mountain you’re in luck. Line of sight from mountains are great. For the rest of the world we need to figure out how to bounce the signal around our obstacles.

Goal Number One

Place the camera at the site and see how far away my Iphone 6 will pick up the video signal.

Goal Number Two

Place one repeater into the system and try to test the range to make sure the repeater is placed within its circle of range. It’ll be very tricky to make this efficient but still working. We could add in 20 repeaters every 30 feet but that’s not what we’re after here. We want to stretch out the network to its maximum capabilities and save on time and money.

Goal Number Three

To be able to view the water levels of the creek 300 meters away from the comfort of my home.

Get the Layout of the Land

The green circle in the photo above is our target location. It’s a creek flow control that makes sure the water levels don’t get too high. Its a concern for me as a home owner because the creek flows through my yard. When the water levels get to high and city worker open the flow to the main creek diverting water.

The red circle is my house.

Each yellow circle with a green dot in the center will be a repeater. The yellow circle at my house will be my cell phone.

Keep an eye on this project, once the 300 meters is complete I’ll keep moving the camera farther and farther away adding in more turns and repeaters to see what the max range really is. Stay tuned.

For email updates on this project please sign up to the free newsletter at the top of this article.

Categories
Uncategorized

Webcam for Weather Underground With Solar Power

Sign up for our free newsletter for updates on cool projects

Best Webcam for Weather Underground is the One You Build

I can’t tell you how amazing it was to finally see that first image uploading to wunderground.com on Feb 3rd 2021. It’s been a long time of trying with no success for many people, if you’re camera isn’t working you’re not alone. This guide will show you how to make a webcam for weather underground that will upload at set intervals.

Webcam for weather underground

Here’s the webcam’s link:
https://www.wunderground.com/dashboard/webcam/wu-0212083/5

For some reason, at the time of writing this WU has the date set to one day too far ahead so you might get an error saying there’s no data for this date. Use the calendar to pick the correct day or to see my first test photo use this link: https://www.wunderground.com/dashboard/webcam/wu-0212083/5/2021-2-4

You can set the end of the link to the right date, hopefully the recognize this issue one day and fix it. Why not have a direct link that takes you to the camera’s most recent photo?

The camera location is in my back yard running off the wifi and a solar panel, the creek never floods or anything but I always wanted to have a camera to watch the ducks and to just keep an eye on the water level.

Another complaint that I have is that WU will only update your photo on the server every 15 minutes. So if you have your camera set to update ever 3 minutes you’ll end up wasting valuable solar power. I’ve set this project to update every 14 minutes.

Parts List:

ESP32-CAM Module
FTDI Programmer
5v step up
18650 battery charge controller
Solar Panel
Camera Housing

Wiring up the Webcam Power Source

The esp32-cam needs 5v to operate. The 18650 battery is between 4.2v and 2.9v so we have to step it up. I’ll start at the battery holder with the obvious. Make sure you have the battery with the positive end at the top/red wire and the bottom is at the black wire end. During the soldering process keep the battery out of the holder please.

Battery Box to Charge Controller
On the charge controller you’ll see pins marked B+ and B- where you will attach our battery holder. It’s the two pins on the inside, on the opposite end of the microusb port. The charge controller will cut off the connection for you if the voltage gets too low. Also VERY IMPORTANT this little unit will not work until a batter is attached and you connect the micro usb port to a power source, I’ve no idea why but it’s like an ON function or something.

Solar Cell to Charge Controller
Connect the positive of the solar cell to the end of the board where the micro usb is and it’s labelled with only a + and a – symbol. This is the input end of the board. If you’re only using one solar cell you don’t need a diode to protect the solar cell. The charge controller will not allow voltage from the battery through to the cell, but the solar cell can charge the battery.

Charge Controller to Step Up 5V
On the end where our battery is attached there are two pins left on the outside. The labels are OUT+ and OUT- which again, we put wires from positive to positive. The 5V step up will have IN+ and IN- which is where the charge controller connects to. On the other end of the step up there are 4 little pins and we want the outside ones. The labels are 5V and GND. Leave the D+ and D- empty.

5V Step Up to ESP32-CAM
Connect the 5V on the step up to the 5V on the ESP32-cam. Connect the GND to GND.

Double check your connections and then plug a battery into the holder. You’ll need to plug that microUSB on the charge controller into a power source before this will work.

Software You’ll Need for This Project:

Arduino IDE
The Script to Upload onto the ESP32-CAM
Library: ESP32ftp – I’ll explain the install on this below

Creating Your Weather Underground Account and Camera

Sign up for wunderground.com as a free account. When you log in, look for “My Profile” at the top right corner and click that once. Then click on “My Devices”.

Click add new device. Under “outdoor webcam” select “FTP”

The next section will be for setting the location of the webcam on the map. You can enter your address if you want or click on “manual”. If you opt for the “manual” function you can grab the locator and move it where you want. Zoom into the map to where your camera will be sitting in the real world. Click the map once to make the marker go to that location. You’ll want to pick something fairly close to where your camera is but maybe not TOO close incase of snoopers.

Give your device a name. Then give your device a camera type, I just write in ESP32-CAM it doesn’t really matter. Associated PWS is if you have a weather station nearby. If not, select none.

Click accept and next/done.

On this next page that comes up you’ll have some crucial information given to you. There are two things you need, the rest has been taken care of for you in the code.

Device ID and Upload key are the two things you’ll want to write down. We need to place that into the script code that you’re going to upload to your new camera. This tells WU which camera to send these photos to.

If You’ve Never Installed Something with Arduino Before:

If you’re brand new to this I’ll walk you through the basic steps.

Download and install the arduino IDE program, it’s free but please make a donation to them if you can. They’re powered by awesome people like you.

Ok, first things first. Getting Arduino IDE ready. From here on I’ll just call it IDE.

Click on File and then preferences in IDE, then highlight everything in the Additional Boards Manager Url box at the bottom.

Delete what’s there and put these two lines in its place.
https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json

The first line is the original with a comma at the end and the new one to make sure you get all of the available libraries. Click OK

Now click Tools at the top, then board, then boards manager.

Do a search for “esp32” and install the board by Espressif.

Next click tools at the top and then manage libraries.

In the search box type in “esp32 ftp”. The exact library you’re looking for is “esp32_ftpclient”.

Click install and then click close.

Now click File and then save as.

When prompted for the file name just type in ESP32-CamFtp. If it asked you to save it into another folder click ok to do so. You can name it what ever you want.

Highlight everything that looks like code on the page, there will be a few lines of code as your first file opens for you. Delete all of the code on the page, you want a perfectly clean page. Then open this txt file: Click Here (It’s the same link as above). Highlight everything in that text file. It might open on your screen and that’s fine. You can also save it to your computer.

Paste all of that txt file into your new file in IDE and click save.

Editing the Code for This Project

Near the top of the code look for:

const char* ssid = “”;
const char* password = “”;

char ftp_server[] = “webcam.wunderground.com”;
char ftp_user[] = “”;
char ftp_pass[] = “”;

The ssid is the name of the wifi signal you have available for the camera to use, your password goes below that where is says password.

The ftp server is always webcam.wunderground.com which is already in place for you. The user will be the camera “ID” that you wrote down while setting up that camera on wunderground.com and the pass will be the “key”. Here’s an example of how it should look. If you’re new to all this please and need help don’t hesitate to comment below as I’d be really glad to help you out.

Example:

const char* ssid = “myhomewifi”;
const char* password = “123456789”;

char ftp_server[] = “webcam.wunderground.com”;
char ftp_user[] = “wu-02083CAM6”;
char ftp_pass[] = “OuOmUxd”;

Once that’s done click save.

We’re ready to hook up the ESP32-Cam to our computer with the FTDI programmer.

On the red ftdi make sure that the jumper near the pins is set to 5v and not 3.3v in the photo above it is set to 5v. The jumper should be on pin 1 and 2 or the left side closest to 5v.

Connect:
Ground to Ground – black wire
VCC (FTDI) to 5V (esp32-cam) – red wire
TX (FTDI) to U0R (esp32-cam) – green wire
RD (FTDI) to U0T (esp32-cam) – blue wire

Connect:
GND to Io0 on the esp32-cam like this: – Brown wire

The reason for the jumper in the photo above is to tell the esp32-cam that you want it in the right mode to receive software or a download. In the photo above please ignore the microSD card as this project does not require one.

IMPORTANT: Hook up the FTDI and esp32-cam first and THEN plug the usb cable into the computer. It’s easy to make a mistake while trying to push the wires down. Another thing you need to know is that each time you upload to the esp32-cam you need to hit the reset button on the back next to the 5V pin. It will frustrate you to no end if you forget to hit reset and you try to upload because it needs that reboot after the jumper goes on.

So to restate, connect the esp32-cam and the ftdi first then add the upload jumper, then plug the usb port in. If you do it in that order you do not need to press reset but it’s a great habit to build. Before each upload I check for that jumper and then press reset it’s that simple.

Ok, now we have to tell IDE what kind of board we’re uploading to. Click Tools, then Board, then Esp32 Arduino, then scroll way to the bottom of the list and find “AI Thinker ESP32-CAM”. Click that one.

Now we have to tell IDE which port we’re on. Click Tools, then Port, and select the right port. This can be a pain finding the right port. I like to go to the list of port items and open the list of available ones. Unplug the FTDI and watch what happens in the list. Then plug it back in and you should see one appear in the list. That’s the port you want to select here.

OH BOY! We’re ready to upload!

At the top of IDE there is a check mark in a circle, to the left of that is an arrow pointing to the right. That’s the button you click to send the “script” that we’ve created to the ESP32-CAM. Click it!

In the bottom section you’ll see the process start. You might get some errors and if you do please comment below so I can correct the tutorial if needed I’ll respond right away.

If you don’t get any errors and it uploads, once it’s done you’ll see the percent hit 100 and it’ll say reset.

Take the jumper off the Esp32-cam and press the reset button on the back next to the 5V. With the other wires attached still, you can watch what happens!!

In IDE click tools and then serial monitor. A new window will pop up. You can press the reset button again if you like so you can watch the whole process. You’ll see it connecting to the wifi and sending the photo via the ftp server. You’ll also see any errors in this window if we didn’t do something correctly. It’s very common to have spelling mistakes in the SSID as well as wrong passwords for the wifi.

With any luck you should be able to go to wunderground.com now and see your photo.

Keep in mind that it will only refresh the photo every 15 minutes. It’ll drive you insane if you’re not aware of this thinking the photo isn’t working. Sometimes it skips a photo. Below your photo on the WU website you can see the last time it refreshed.

Please comment below with the location of your camera on WU I would REALLY love to see!

Categories
Uncategorized

Solar Powered Field Charger for Power Banks

These little module are amazing. I’ve taken a 12v solar cell and attached it to the USB module. The positive is the square side on the module.

There’s not much too this project but it’s a good one. Another nice thing about these power banks is that they can charge and discharge at the same time.

Let me know if you have any questions.

Categories
Uncategorized

DIY Solar Powered Weather Station Wunderground

Sign up for our free newsletter for updates on cool projects

DIY Solar Powered Weather Station

*Please Note! For this diy solar powered weather station you will need a different article on this website as a prerequisite for this project. This guide shows you how to add the solar portion. Follow this project and complete it first: Click Here

Features:
Never have to change the battery again.
Automatically disconnects power to protect the battery (Mine has never had to disconnect as it has enough backup power to last for weeks of dark winter days). If you have any concerns with this it’s very easy to just add more 18650 batteries in parallel to the 1 that I’m using.
Automatically turns back on once the sun comes out and the batteries charge back up.

DIY Solar Powered Weather Station Parts List:

18650 charge protector
18650 Li-po battery
18650 Li-po battery holder
5v Step Up – In the photo I used a small stepup that I don’t recommend as they tend to fail, please use the one that I’ve recommended in the link “5v Step Up” as they’re now my go to unit and are awesome.
5v Solar Cell 500mah
Wiring

diy solar powered weather station close up photo
Here it is in action, on the back deck of the office loading up the battery even in cloudy winter conditions.
Photo 3 – In this photo Voltage1 is at the top of the photo and Voltage2 is the bottom rail. You’ll need to know this for the explanations below.

In photo 3 the solar cell wiring is plugged into the bread board first in my example. I did this because it gave me the option to disconnect the solar cell and replace it easily but you don’t have to do this.

How to Connect the Wiring

The solar cell is connected to the 18650 charge controller at the end that has the micro USB. In photo 3 it goes from a red/white pair to a blue/white pair. It’s marked clearly with a + and a – where the wires connect. I only just realized that the 18650 charge controller will keep your solar cell safe if you have only one solar cell. The voltage will not flow back through to the solar cell and you do not need a blocking diode. If you have two solar panels in parallel you will need a blocking diode on each solar cell you add into the project.

18650 Charge Controller Wiring:

You’ve just connected the solar cell and now we’ll hook up the battery box. The two wires coming off the battery box go to Voltage1 (photo 3 and is the top rail). The top rail is then connected to the 18650 charge controller inside pins. You’ll see them on the board with labels of B+ and B- for battery positive and negative. Those solder pads will block electricity if the 18650 battery gets too low 2.7 volts I believe. They will reactivate when the solar cell charges them up to about 3.2 volts. Those pads will also not let the voltage from the solar take the 18650 batteries too high and will cut off the solar when the battery reaches 4.2 volts. The red light that indicates the solar cell is charging, will turn blue when the battery is full. They’re an amazing add on to any project. The outer pads are labelled out+ and out- and will be connect to Voltage2 (look at photo 3 its the bottom rail).

5v Step Up

On your 5v step up the bottom rail in photo 3 Voltage2 is connected to the “in” side of the step up. On the board it will be labelled IN+ and IN- then you connect the GND and 5V while leaving d+ and D- alone. Those inside solder pads will only give you the voltage of the IN side and we don’t use them in this project. Connect the GND and 5V on the step up’s out side to Vin and GND on your NodeMCU.

Deep Sleep wiring:
You’ll notice a green wire in photo 3 going from RST (beside GND) to D0 on the NodeMCU. This makes a connection to wake the NodeMCU up and will save a lot of power. This is really important as it’ll save on the use of the battery overnight. It’s always better to use software to save power instead of just adding more expensive items like 18650 cells.

That’s it! If you have any comments or questions and what some help with your project I LOVE a good challenge. I’ll help you develop what ever you need without charge. But I’ll most likely end up creating a tutorial for my efforts.

Categories
Uncategorized

Arduino Weather Station for Weather Underground

Sign up for our free newsletter for updates on cool projects

This is a basic Arduino Weather Station for Weather Underground using a Nodemcu and BME280 temp humidity and pressure sensor. You can set the timer for updates, currently set for every three minutes. Please ask questions on this page, I love responding to people so don’t be afraid to say hello. If this is your first ever Arduino project then get a hold of me using the comments below and I’ll help you get it setup.

Arduino Weather Station for Weather Underground
In the photo above, the power bank has 4 18650 batteries that will last about 5 days. The battery bank can take a solar panel and use it at the same time to recharge when needed. Let me know if you’re interested in this by posting below and I’ll build a how to article on that subject. The purple module is the BME280 and of course a NodeMCU. I’ll make an article about using a WemosD1 soon. The BME280 is known to read high and this article addresses that issue below.

IMPORTANT: The bme280 sensors are known to read a little bit high and have a floating temperature reading error or offset. If you’re ok with it being off a few degrees or you are willing to adjust the code a bit for your sensors error amount than this is a great little project. If not, I’ve built a section on adding in a DHT22 sensor to this same project.

Parts List:
NodeMCU
BME280 – Double check when yours arrives if it’s 3.3v or 5v

NodeMCU 3 pack
NodeMCU 5 pack Best Value
BME280 3 pack – Double check when yours arrives if it’s 3.3v or 5v

.Zip file for the code Click Here or scroll down and both files are printed on the page.

Very Important: Your WU weatherstation will not work on the newer ESP8266 board library. You’ll need to go to your board manager, find your install for esp8266 and then select 2.4.2 I’ve no idea why it doesn’t work on any other version, but I was pulling my hair out with this project and then randomly read that someone had to downgrade to make it work. Once you have it uploaded to your board you can go back to the newest update for your future projects.

ALSO VERY IMPORTANT: The picture below does not show a wire between D0 and RST. This is for the deep sleep function to help save power usage. It’s what wakes up the board to send the data. When you’re uploading to the nodemcu remove one end of this jumper from D0 to RST or you could get errors while trying to send the script to the Nodemcu.

Weather Station close up photo.
A close up of the BME280 sensor and the NodeMCU. SDA to D2, SCL to D1, VIN to 3.3v and GND to GND. Do not power the BME from the 5v.

Normally the BME280 sensor reads high from 2 to 4 degrees Celsius. This project includes a way to correct your sensor. You’ll have to decide on how to correct it. If you want it accurate in winter and summer you’ll have to update your code during the season changes.

The alternative is to set it to about 3 degrees offset and have it average out. Currently it’s winter here and I’ve got it set bang on to see how it changes at it warms up around here in spring.

To fix the over temp issue on a BME280 find this line:

float sensor_temperature = bme.readTemperature() * 9/5+32; // Read temperature as Fahrenheit

Change that line where it says 9/5+32 to 9/5+30 like this:

float sensor_temperature = bme.readTemperature() * 9/5+30; // Read temperature as Fahrenheit

If you find that your reading is constantly over temp by say 5 degrees. Then you reduce the number to 27 instead of the original 32.

Weather Underground screen shot of the reporting page.
In the photo above, you can see how my weather station is now reading the same as the nearby stations. It used to drive me NUTS that mine was always 2-3 degrees higher than everyone else. Not that I normally like to follow the crowd, but my home weather station that I purchased was always on par with the people around me so I know that it’s the BME280 that’s off (or used to be).

Please feel free to post questions about the Arduino weather station for weather underground project below or email me at ryanrr@gmail.com

Categories
Uncategorized

ESP32-Cam Motion Camera Trap Project With Date and Time

Sign up for our free newsletter for updates on cool projects

ESP32-cam Camera Trap

In this project we’ll be building an esp32-cam motion camera trap that saves photos to an SD card with the date and time in the file name.

This camera can last a very long time by using 18650 batteries. I’m using two 18650 batteries and haven’t done any testing yet on how long it will last but of course it depends on how many triggers are happening.

The code for this camera trap includes the ability to transfer the images over to a server. I’m still working on getting the server setup on a wifi lan and waiting for parts. I’ll update this when its ready.

The file name of each photo will have the date and then the time stamped like this:

08012021_11_41_30.jpg

The order is Day Month Year. Then after the first _ the time starts so 11:41 am and the last part is the seconds.

Why I wanted this included is because for a lot of the wildlife tracking I do, knowing what animals are in the area is no enough. Know what day and time it happened is obviously crucial.

Parts You’ll Need:

ESP32-Cam
DS3231 real time clock
HC-SR501 motion sensor
5V Step up
SN3904 Transistor
18650 Charge controller
18650 Battery Holders x 2
18650 Batteries x 2
Resistor 10k ohm – Top one on blue line below
Resistor 1k ohm – Bottom one on yellow line below

The wiring above shows how I’m building these now.
I’m no longer using a voltage step up as you see in the photos below. I’m running two 18650 batteries in parallel providing 4.1 volts total at full charge.

The wiring diagram above shows 4 AAA batteries in series and that will work too but I couldn’t find a diagram image for the 18650 batteries so I used that instead. The camera will stop working when the batteries reach 3 volts. The battery charge controller will cut off at 2.65 volts. I’m constantly using a 5v solar panel attached to the charge controller so the voltage always stays pretty high.
Closeup of the esp32-cam motion camera trap.

Code You’ll Need For This Project:

Code: Although the code is listed below, you’ll need two other files as well. RTClib.cpp and RTClib.h Here are all of the files in a zip. Click Here

#include <Arduino.h>
#include <Wire.h>
#include "RTClib.h"
#include <WiFi.h>
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#include "esp_camera.h"
#include "FS.h"
#include "SD_MMC.h"
#include "driver/rtc_io.h"
int save_flag = 0; 
const char* ssid = "arunmobile";
const char* password = "arun1234";
#define ESP32CAM_LED_FLASH 4
String saved_image_name = "/first.jpg";
String serverName = "192.168.43.16";   // REPLACE WITH YOUR Raspberry Pi IP ADDRESS
//String serverName = "example.com";   // OR REPLACE WITH YOUR DOMAIN NAME
String serverPath = "/upload";     // The default serverPath should be upload.php
const int serverPort = 8080;
#define uS_TO_S_FACTOR 1000000ULL  /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP  30        /* Time ESP32 will go to sleep (in seconds) */
int connection_error_count = 0;
RTC_DATA_ATTR int cnt = 0;
WiFiClient client;
// CAMERA_MODEL_AI_THINKER
#define PWDN_GPIO_NUM     32
#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
const int remain_connected_timerInterval = 5000;    // time between each HTTP POST image
const int wifi_timerInterval = 5000;    // time between each HTTP POST image
String status_send = "";
unsigned long previousMillis = 0;   // last time image was sent
char dateTimeFilenamearray[25];
RTC_DS3231 rtc;
uint8_t print_wakeup_reason(){
  esp_sleep_wakeup_cause_t wakeup_reason;
  wakeup_reason = esp_sleep_get_wakeup_cause();
  int status = 0;
  switch(wakeup_reason)
  {
    case ESP_SLEEP_WAKEUP_EXT0 : 
        Serial.println("Wakeup caused by external signal using RTC_IO"); 
        status = 1;
        break;
    case ESP_SLEEP_WAKEUP_EXT1 : 
        Serial.println("Wakeup caused by external signal using RTC_CNTL"); 
        status = 2;
        break;
    case ESP_SLEEP_WAKEUP_TIMER : 
        Serial.println("Wakeup caused by timer");
        status = 3;
        break;
    case ESP_SLEEP_WAKEUP_TOUCHPAD : 
        Serial.println("Wakeup caused by touchpad");
        status = 4;
        break;
    case ESP_SLEEP_WAKEUP_ULP : 
        Serial.println("Wakeup caused by ULP program");
        status = 5;
        break;
    default : 
        Serial.printf("Wakeup was not caused by deep sleep: %d\n",wakeup_reason); break;
  }
  return status;
}
uint8_t capture_image(String path_new)
{
    
    // String path_new = "/pircheck"+String(cnt)+".jpg";
    // cnt++;
    String keypressed = "button";   
  
    Serial.println("Starting SD Card");
      if(!SD_MMC.begin()){
        Serial.println("Card Mount Failed");
        return 0;
    }
    uint8_t cardType = SD_MMC.cardType();
    if(cardType == CARD_NONE){
        Serial.println("No SD_MMC card attached");
        return 0;
    }
    Serial.print("SD_MMC Card Type: ");
    if(cardType == CARD_MMC){
        Serial.println("MMC");
    } else if(cardType == CARD_SD){
        Serial.println("SDSC");
    } else if(cardType == CARD_SDHC){
        Serial.println("SDHC");
    } else {
        Serial.println("UNKNOWN");
    }
    uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
    Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize);   
    
    // digitalWrite(ESP32CAM_LED_FLASH, HIGH);
    camera_fb_t *fb = NULL;
    fb = esp_camera_fb_get();
    if (!fb)
    {
      Serial.println("Camera capture failed");
      return 0;
    }
    else
    {
      Serial.println("Camera Captured");
    }
    delay(1000);
    fs::FS &fs = SD_MMC;
    Serial.printf("Picture file name: %s\n", path_new.c_str());
    
    File file = fs.open(path_new.c_str(), FILE_WRITE);
    if(!file){
      Serial.println("Failed to open file in writing mode");
    } 
    else {
      file.write(fb->buf, fb->len); // payload (image), payload length
      Serial.printf("Saved file to path: %s\n", path_new.c_str());
    }
    file.close();
    delay(1000);
    SD_MMC.end();
    delay(1000);
    esp_camera_fb_return(fb);
    delay(1000);
    // digitalWrite(ESP32CAM_LED_FLASH, LOW);
    
}
String sendPhoto(const char * path) {
  String getAll;
  String getBody;
  static uint8_t buf[1024];
  if(!SD_MMC.begin()){
        Serial.println("Card Mount Failed");
        
    }
    uint8_t cardType = SD_MMC.cardType();
    if(cardType == CARD_NONE){
        Serial.println("No SD_MMC card attached");
        
    }
    Serial.print("SD_MMC Card Type: ");
    if(cardType == CARD_MMC){
        Serial.println("MMC");
    } else if(cardType == CARD_SD){
        Serial.println("SDSC");
    } else if(cardType == CARD_SDHC){
        Serial.println("SDHC");
    } else {
        Serial.println("UNKNOWN");
    }
    uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
    Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize);
  fs::FS &fs = SD_MMC; 
  File file = fs.open(path);
  delay(500);
  if(file)
  {
    Serial.println("file detected.........");  
  }
  Serial.println("Connecting to server: " + serverName);
  if (client.connect(serverName.c_str(), serverPort)) {
    Serial.println("Connection successful!");    
    String head = "--RandomNerdTutorials\r\nContent-Disposition: form-data; name=\"imageFile\"; filename=\"esp32-cam.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n";
    String tail = "\r\n--RandomNerdTutorials--\r\n";
    uint16_t imageLen = file.size();;
    uint16_t extraLen = head.length() + tail.length();
    uint16_t totalLen = imageLen + extraLen;
  
    client.println("POST " + serverPath + " HTTP/1.1");
    client.println("Host: " + serverName);
    client.println("Content-Length: " + String(totalLen));
    client.println("Content-Type: multipart/form-data; boundary=RandomNerdTutorials");
    client.println();
    client.print(head);  
    
    size_t fbLen = file.size();
    for (size_t n=0; n<fbLen; n=n+1024) {
      if (n+1024 < fbLen) {
        file.read(buf, 1024);
        delay(10);
        client.write(buf, 1024);        
      }
      else if (fbLen%1024>0) {
        size_t remainder = fbLen%1024;
        file.read(buf, remainder);
        delay(10);
        client.write(buf, remainder);
      }
    }   
    client.print(tail);    
    
    int timoutTimer = 10000;
    long startTimer = millis();
    boolean state = false;
    
    while ((startTimer + timoutTimer) > millis()) {
      Serial.print(".");
      delay(100);      
      while (client.available()) {
        char c = client.read();
        if (c == '\n') {
          if (getAll.length()==0) { state=true; }
          getAll = "";
        }
        else if (c != '\r') { getAll += String(c); }
        if (state==true) { getBody += String(c); }
        startTimer = millis();
      }
      if (getBody.length()>0) { break; }
    }
    file.close();    
    Serial.println();
    client.stop();
    Serial.println(getBody);
    delay(1000);
    SD_MMC.end();
  }
  else {
    getBody = "";
    Serial.println(getBody);
  }
  return getBody;
}
void renameFile(const char * path1, const char * path2){
    Serial.printf("Renaming file %s to %s\n", path1, path2);
    if(!SD_MMC.begin()){
        Serial.println("Card Mount Failed");
        
    }
    uint8_t cardType = SD_MMC.cardType();
    if(cardType == CARD_NONE){
        Serial.println("No SD_MMC card attached");
        
    }
    Serial.print("SD_MMC Card Type: ");
    if(cardType == CARD_MMC){
        Serial.println("MMC");
    } else if(cardType == CARD_SD){
        Serial.println("SDSC");
    } else if(cardType == CARD_SDHC){
        Serial.println("SDHC");
    } else {
        Serial.println("UNKNOWN");
    }
    fs::FS &fs = SD_MMC; 
    if (fs.rename(path1, path2)) {
        Serial.println("File renamed");
    } else {
        Serial.println("Rename failed");
    }
    SD_MMC.end();
}
void deleteFile(const char * path){
    Serial.printf("Deleting file: %s\n", path);
    if(!SD_MMC.begin()){
        Serial.println("Card Mount Failed");
        
    }
    uint8_t cardType = SD_MMC.cardType();
    if(cardType == CARD_NONE){
        Serial.println("No SD_MMC card attached");
        
    }
    Serial.print("SD_MMC Card Type: ");
    if(cardType == CARD_MMC){
        Serial.println("MMC");
    } else if(cardType == CARD_SD){
        Serial.println("SDSC");
    } else if(cardType == CARD_SDHC){
        Serial.println("SDHC");
    } else {
        Serial.println("UNKNOWN");
    }
    fs::FS &fs = SD_MMC;
    if(fs.remove(path)){
        Serial.println("File deleted");
    } else {
        Serial.println("Delete failed");
    }
    SD_MMC.end();
}
String listDir(const char * dirname, uint8_t levels){
    Serial.printf("Listing directory: %s\n", dirname);
    if(!SD_MMC.begin()){
        Serial.println("Card Mount Failed");
        
    }
    uint8_t cardType = SD_MMC.cardType();
    if(cardType == CARD_NONE){
        Serial.println("No SD_MMC card attached");
        
    }
    Serial.print("SD_MMC Card Type: ");
    if(cardType == CARD_MMC){
        Serial.println("MMC");
    } else if(cardType == CARD_SD){
        Serial.println("SDSC");
    } else if(cardType == CARD_SDHC){
        Serial.println("SDHC");
    } else {
        Serial.println("UNKNOWN");
    }
    uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
    Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize);   
    delay(1000);
    fs::FS &fs = SD_MMC; 
    File root = fs.open(dirname);
    delay(1000);
    if(!root){
        Serial.println("Failed to open directory");
        
    }
    if(!root.isDirectory()){
        Serial.println("Not a directory");
        
    }
    String filename = "";
    File file = root.openNextFile();
    if(file){        
      Serial.print("  FILE: ");
      Serial.print(file.name());
      Serial.print("  SIZE: ");
      Serial.println(file.size());
      filename = String(file.name());
    }   
    file.close();
    SD_MMC.end();
    return filename;
  }

void go_to_deepsleep()
{
    esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,0); //1 = High, 0 = Low
    esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
    Serial.println("Going to sleep now");
    esp_deep_sleep_start();
    Serial.println("This will never be printed");
}
void setup_wifi()
{
  delay(10);
  // We start by connecting to a WiFi network
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  unsigned long previousMillis = millis(); 
  int flag = 0;
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print("."); 
    Serial.print("connecting");  
    unsigned long currentMillis = millis(); 
    if (currentMillis - previousMillis >= wifi_timerInterval) 
    {
        flag = 1;
        break;
    }  
  }
  
  if (flag == 0)
  {
    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
  }
  else
  {
    Serial.println("WiFi not connected");
  }
  
}
void setup() {
  //delay(5000);
  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); 
  Serial.begin(115200); 
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }
  String path_new = "";
  //Print the wakeup reason for ESP32
  uint8_t status = print_wakeup_reason();
  Serial.print("Serial status is "); 
  Serial.print(status); 
  if(status==0)
  {   
    // delay(20000);
    Serial.println("<<<<<<<<<<<<<<<<<<< POWER >>>>>>>>>>>>>>>>>>>"); 
    // go_to_deepsleep();
  }
  if(status==1)
  {   
    Serial.println("<<<<<<<<<<<<<<<<<<< MOTION >>>>>>>>>>>>>>>>>>>"); 
    
  }
  if(status==3)
  {   
    Serial.println("<<<<<<<<<<<<<<<<<<< TIMER >>>>>>>>>>>>>>>>>>>"); 
    
  }  
  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;
    config.frame_size = FRAMESIZE_VGA;
    config.jpeg_quality = 12;  //0-63 lower number means higher quality
    config.fb_count = 1;  
    pinMode(4, INPUT);
    digitalWrite(4, LOW);
    rtc_gpio_hold_dis(GPIO_NUM_4);
    
    // camera init
    esp_err_t err = esp_camera_init(&config);
    if (err != ESP_OK) {
      Serial.printf("Camera init failed with error 0x%x", err);      
      Serial.println("<<<<<<<<<<<<<<<<< Restartig >>>>>>>>>>>>>>>");
      delay(1000);
      ESP.restart();
    }
  if(status==1 || status == 0)
  {
    
    delay(1000);    
    if(status == 0)
    {
      path_new = saved_image_name;
    }
    else
    {
      DateTime now = rtc.now();
      dateTimeFilenamearray[0] = '\0';
      //sprintf(dateTimeFilenamearray, "/%02d%02d%d_%d:%d:%d", now.day(), now.month(), now.year(),now.hour(),now.minute(),now.second());
      sprintf(dateTimeFilenamearray, "/%02d%02d%d_%d_%d_%d", now.day(), now.month(), now.year(),now.hour(),now.minute(),now.second());  
      Serial.println(dateTimeFilenamearray);
      //path_new = "/motion_"+String(cnt)+".jpg";
      path_new = String(dateTimeFilenamearray)+".jpg";
      cnt++;      
    }
    
    capture_image(path_new);
    delay(1000);
    // esp_camera_deinit();
    // delay(10000);
    pinMode(4, OUTPUT);
    digitalWrite(4, LOW);
    rtc_gpio_hold_en(GPIO_NUM_4);
    delay(10000);
    go_to_deepsleep();
  }  
  setup_wifi(); 
  
  previousMillis = millis();
  connection_error_count = 0;
}
void loop() {
  
  if (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");   
    unsigned long currentMillis = millis(); 
    if (currentMillis - previousMillis >= remain_connected_timerInterval) {
      go_to_deepsleep();
    }
  } 
  else
  {   
    if(connection_error_count < 3)
    {
      String filename = "";
      filename = listDir("/",0);
      if(filename != "")
      {    
        Serial.print("filename is: ");
        Serial.println(filename);    
        delay(1000);
        if(filename != saved_image_name){
          status_send = "";
          status_send = sendPhoto(filename.c_str());   
          if(status_send.indexOf("ok") > 0){
            Serial.print("Response from the server");
            Serial.println(status_send);
            deleteFile(filename.c_str());   
            connection_error_count = 0;     
          } 
          else
          {
            delay(3000);
            connection_error_count++;
          }                
        } 
        else
        {
          deleteFile(filename.c_str());
        }              
        previousMillis = millis();
        delay(2000);
      }
      else
      {
        delay(5000);
        go_to_deepsleep();
      } 
    }
    else
    {
        delay(1000);
        go_to_deepsleep();
    }
       
  }    
}
Categories
Uncategorized

DIY Wireless Wildlife Camera Project

DIY Wireless Wildlife Camera ESP32-CAM

This DIY wireless wildlife camera is amazing for keeping an eye on your surroundings while out in the field.

What Does This Camera Do

The DIY wireless wildlife camera streams live video to your mobile device.

What this camera doesn’t do:
Take photos and store them.
This camera is not motion activated.

Want me to build one for you? Get in touch with Ryan@starairvision.com and I’ll get you a quote. I’m shipping from Canada and the price will be $20 Canadian for a pre-programmed ESP32-cam on its own. I can put together kits for you or build the whole thing.

  • You can add in a wifi router for greater range. But that will be another project and I’ll link to it here when it’s complete.

DIY Wireless Wildlife Camera Example

A conservation officer who’s watching for people fishing on a river system can stay hidden while seeing a live view of multiple different locations in the area simply by looking at their mobile device. The officer placed 3 cameras, one on the trail coming into the location. Another camera right by the river looking at the most popular fishing spot. The last camera was placed on the trail just a few feet away so that from behind the large tree the officer could look at the trail to see if anyone was approaching the hiding spot.

The poachers had no idea they were being watched with this DIY wireless wildlife camera as they cast out their illegal snagging hooks during a closed fishing period.

Another story is from a researcher who had traps set to catch endangered bird species who used the cameras to watch the nets. As a bird flew into the net the researchers could check every few minutes which greatly reduced the time the birds were in trapped. This reduced stress time on the animals.

Wireless Wildlife Remote Camera

The range on this diy wireless wildlife camera to your cell phone for viewing is not great. It’s about 300 feet line of sight. Even with its limited range, the camera has many uses. There are many ways we can extend the range. I’ll add a link here to the next project when it’s done for adding a range booster that will give you over 1km to your cell phone. It’s a booster that you carry with you that talks to the camera.

camera view

The resolution is better in real life, this is just a screen shot from my cell phone.

diy wireless wildlife camera

The finished camera broadcasting a signal to my cell phone.

What you’ll need to know

Not much about electronics or arduino. We’ll walk you through each of the steps. If you click the links below you’ll see photos of each part you need. You will need to know some basic soldering skills. Here’s my favorite USB soldering Iron for small projects like these.

DIY Wireless Wildlife Camera Viewing

You can connect to it with any cell phone and you don’t need to download an app. The camera broadcasts its own WIFI signal. Then open your wifi connection, pick the camera (in this case the wifi signal will be called Camera01) and click connect. It will ask you for the password which is 123456789 but you can change it to what ever you want. Once connect you open a browser on your phone, ipad or computer and type in 192.168.4.1 you can also add that to your bookmarks.

Cons:
This camera does not record video or take photos. It’s an observation camera that gives you a live feed only. There will be more projects here to use this same camera as a regular camera trap that can save photos to the microSD card.

Parts you’ll need:

ESP32-cam
FTDI Programmer
5v Power Source
– 4.2v 18650 battery and the a single case for mounting them or 5pcs Click Here
5v Step Up 3pcs or for 1pc click here
Weatherproof Case
Charge Controller or 3pcs click here

If you want the ESP32 Camera that comes with an FTDI programmer CLICK HERE as it’s cheaper.

Software:
Arduino IDE (it’s free) Download Here
Code Files Download Here

Useful Applications For This Project

One of the best uses for this camera is monitoring wildlife. It gives you an upfront view without disturbing your subject. It’s also possible place multiple cameras out there and check different places by simply logging into a different camera.

An example of this is when trapping wildlife for tagging. You can place a camera in each of the traps and check them more often and without disturbing the trap.

If you’re banding birds and using nets, you can setup cameras pointing at the nets and check them every few minutes reducing “in the net” time for the birds.

For those who are filming wildlife having these cameras can really up your game. You’ll know when an animal is approaching giving you more time to get ready.

DIY Wireless Wildlife Camera Range Extenders

In the next few months I’ll be building some range extenders for this project as well as solar recharging. You’ll be able to leave these cameras in remote locations and access them to check if anything is in the area. Go to  the next location and check that camera. Imagine the time savings of not having to hike up that cliff again and again.

Don’t forget to sign up for our newsletter as we release the long range articles.

An Example DIY wireless camera Project

diy wireless wildlife camera inside parts

In the photo above (I still need to solder the battery terminal wire as well as the power supply wires from the step up).

Step One Drilling the Holes in the Case

Drill Size 1/4 inch for the antenna
Use drill size 19/64 for the camera lens

The camera lens hole was a little bit big but still worked very well. I didn’t have the next size down to make up the difference. You could try a 9/32.

A mistake that I made in this first tutorial was to put the camera lens hole off to the side thinking I was saving room for electronics. After placing it I realized that now I don’t have access to the micro SD card slot. Thankfully you don’t need one for this project but I recommend having the lens hole more in the center to save room for microSD card if you decide to change your project into the motion camera project that’s coming soon.

Antenna Placement

You can decide where to place the antenna, I didn’t really have any reason to place it at the top. Some people like to make the hole on the side and the antenna can bend up. This might help with weather proofing but I haven’t had any issue mounting at the top.

The antenna connector has a nut that you undo, place the mount through the hole and then screw down the nut to secure it in place. Never power up your camera without the antenna attached. It might not hurt this unit because it has a built in antenna but its not worth taking the risk.

Camera Placement

Take your ESP32-cam and practice placing it where you want it. I recommend up at the top and slide the camera as far to the right as possible taking note of where to drill the hole. In my next build I get exact measurements for where to drill.

Which way is up? You don’t want to install the camera upside down, it’s easier to do than you think and there’s nothing worse than doing your first test run to find out the camera is up side down.

The antenna connector on the camera should be off to the right as in the photo above.

Step Two Mounting the ESP32-Cam

Two sided tape can work for this but I recommend good old hot glue for this. When placing the camera into the case, make sure the lens on the outside looks flat as you press the camera into the case with hot glue. The lens is free floating on the camera and you can end up with the lens looking off to the side which makes placing the camera that much harder.

I like to put just a little hot on two of the corners of the camera first. That way later on when testing it, if it’s not quite right you can easily fix it. Just use enough hot glue to keep it in place until you’re ready to lock it down.

Step Three Mounting the Battery Box

I put a single line of hot glue down the center of each battery box. Make sure the wires are the same color on each end as you don’t want to end up making serial connections or frying something. This battery setup is built in parallel. Total voltage is 4.2 volts at full charge.

You don’t need to use three batteries here like I have. With three batteries you’ll get about 3 days of constant use day and night. Your setup might not need that much if your using the camera for a few hours at a time. In many situations the camera only needs one 18650 battery. But like my favorite TV scientists always say… anything worth doing is worth OVER doing haha.

In my setup, the three red wires are soldered together into one wire lead. The three reds together and the three blacks together.

Step Four Mounting the Power Supply and Charge Controller

A little hot glue goes a long way here.

I put a small line down the back of each module and squish it in there. It’s very important for the blue module (battery charge controller and over discharge cut off) that you mount it with the little connector pointing down just like in the photo above. That way you can recharge the 18650 battery with a micro USB cable.

Step Five Wiring it all Together

Starting at the batteries, take the red positive lead wire from the 18650 batteries and solder it to the blue charge controller module. You should see a B+ at the top of the module that stands for battery positive. Right next to that solder pad is B- which is where you’ll place the black lead. These two solder pads are at the inside of the module. The two solder pads on the outside are where the power leaves the charge controller. It will cut power off if the batteries get too low.

Place a red wire on the blue charge controller module where it says OUT+ like in the photo above. This wire is then connected to the green module where it says IN+. Connect a wire from the blue module where it says OUT- and attach it to the green module where it says IN-. The green module is a voltage step up that will take the lower voltage of the batteries and step it up to 5 volts that the camera needs.

Power Wire Placement

I like to use arduino wires for this next step as they have really great connectors for the camera that will fit inside the case. If you opted for the camera and programmer kit, you’ll get some of these wires included like this one. Or you can order some jumper wires like these as they’re always useful.

The top left pin on the camera in the photo above is the where the red positive connector goes. Make sure to take enough wire to reach your green module’s +5v solder pad. The black wire is connected to the green module’s GND pad and connects to the camera’s bottom right pin.

Here’s a photo of the completed wiring.

diy wireless wildlife camera closeup

Step Six Programming the Camera

Setting up the DIY wireless wildlife camera is easy but can be a little bit much for someone who’s doing it for the first time.

It’s time to install arduino IDE if you haven’t already.

You’ll need to download the .zip file listed at the top of this article. Unzip the file where ever you like and double click the file called: CameraWebServer_Access_Point
It should have a blue symbol next to it. Open that file by double clicking it.

The Arduino IDE software will open automatically with your files showing like this:

programming the diy wireless wildlife camera

Setup The Board

Click on Tools, then mouseover Board, then select board manager. A window will come up. In the search bar type in esp32. Install the one by Esspressif Systems.

If you can’t find anything when searching for esp32 go to File, Preferences and look for “additional boards manager urls” then copy and paste this into the line box:

https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json

Now go back to the boards manager as stated above and try it again. If you’re still having issues email me ryan@starairvision.com and I’ll arrange a time to help you with it.

Once the board has been installed you’ll to connect the ESP32-cam to your computer.

You’ll need a USB cable that fits the FTDI and they’re usually the older thicker microusb like this one.

Programming cable

Connect the FTDI

Wire up the FTDI to the ESP32-cam making sure the jumper on the FTDI is set to 5v.

Connect GND to GND (black wire)
VCC on FTDI connect to 5v on the ESP32 (red wire)
RX on FTDI connect to UOT on ESP32 (blue wire)
TX on FTDI connect to UOR on ESP32 (green wire)

diy wireless wildlife camera FTDI

In the photo above, the black wire is the ground, the blue wire is UOT and the green wire is UOR sorry for the blurry image. Make sure to check your FTDI jumper just above where you connected the wires it can be set to 3.3v or 5v. Make sure to use 5v.

Put your ESP32-cam into upload mode by placing a jumper from pin IO0 to GND. If you look for the 3.3v pin on the ESP32-cam and count the pins down the side it should be pins 3 and 4.

Wiring setup for the diy wireless wildlife camera

In the photo above you can see that I have a microSD card installed. You don’t need one for this wildlife remote camera wireless project.

Plug the FTDI usb cable into your computer. But before you do! Go to tools, ports and look at what ports are available before you plug it in. Now plug your USB cable in and see what NEW port is now available. Mine is usually on Com3 but it might be different for yours.

Now click tools, then mouse over board:, then mouse over ESP32 ARDUINO> and look for AI thinker ESP32-CAM. It’s way down the list.

Prepare the Code

A few lines down in the code you’ll find:

const char* ssid = “Camera01”;
const char* password = “123456789”;

You can change the name of the wifi which is currently set to Camera01 to anything you want. Next you can also change the password.

Above that section of code is the “select camera model”

One of the lines should be missing the // at the beginning and it should look like this:

#define CAMERA_MODEL_AI_THINKER

This means that the AI thinker model is selected and not one of the other ones which is what you want.

It’s time to upload!

Under the edit button you’ll see an arrow button that’s pointing to the right. Click that and the code will upload.

When you see the orange text at the bottom saying “hard reseting via RTS pin” it’s complete.

If you see ……._______…….._______……. then press the reset button on the ESP32-CAM it’s right next to the 5v pin.

Take the jumper off from the ESP32-cam from the IO0 and GND pin. In the photos above its the brown jumper wire.

Take the 5v wire and put it back again.

Now we go to our cell phone or PC and look for “Camera01” or what ever you changed it to in your list of available WIFI networks. Click it and enter the password you used.

Once you’re connected to it open a browser and type in 192.168.4.1

If everything is working you’ll see a black screen with red options. The first option is the resolution. On cell phones I find that 320×240 is just fine. But play with it and see which ones work best for you. What’s that selected go all the way to the bottom of the list and press start streaming. You should see the camera’s screen show up.

Congrats you’ve got your wildlife remote camera wireless working!

Please feel free to post questions below and I’ll help you with it. You can also email me at ryan@starairvision.com