Height of My Titan Sunflowers Showing Just Over 4-inches in 11 days

Networked Time-Lapse with Night Vision

OVERVIEW

This project is a time-lapse of a tray of Titan Sunflowers. The setup consisted of a camera with a No IR filter (for night-vision) and temperature/humidity sensor connected to a Raspberry Pi 4, run headless (without a monitor) as it logged image snapshots and temperature/humidity readings of the first 11 days of growth of the seedlings.

Planting the seedlings on 21 April 21. After the peat pellets are expanded by absorbing water, you place a seed in top and cover it. EASY. The half on the left in the tray are done. The half on the right, I just pushed the seed down and covered it up. In front, are a compressed peat pellet and one of the Titan sunflower seeds.
Planting the seedlings on 21 April 21. After the peat pellets are expanded by absorbing water, you place a seed in top and cover it. EASY. The half on the left in the tray are done. The half on the right, I just pushed the seed down and covered it up. In front, are a compressed peat pellet and one of the Titan sunflower seeds.

Why Time-Laspe with Night Vision?

I was fortunate enough to have a small yard (‘yard’ makes it sound too big) in Brooklyn durning lockdown and, like many people around the world, took up gardening. I’d read about how fast these sunflowers grew and wanted to start some for my garden. I figured I’d start a tray and use a camera with night vision to create a time-lapse of one of my new favorite activities!

Check it out:

Process

Because of all the sensors and networked components, I decided to break this project up into tackleable pieces. “What are the basics of the project?” I asked myself. Once I got parts working, I could try to connect them, which made this project not only more manageable, but easier to troubleshoot.

To create the time-lapse images for this project, I followed the Pi Recipe for A Timelapse Webcam Application. I went through and retyped the files to make sure I understood what was going on. Hardware-wise, I got the Pi with No IR webcam, a heated mat (to help the seedlings sprout), seedling tray with planted Titan sunflower seeds (that can grow to be 10′ tall!), and grow lights set up in the window with a monitor, keyboard, and mouse attached. I found a way to log each camera capture by saving a line with the image name (which includes the date) using ‘fs.append’ function by including the ‘fs’ node module. TIP: If you use fs.write and restart the server, it will replace your log.

The mystic purple glow of the grow lamps in my window.
The mystic purple glow of the grow lamps in my window.

I decided that, once I had the program running, I would make sure the images were actually being saved in the file I wanted and that the log I was writing to was being updated. Once I’d done that, I gave the project a rest for the night, but, later while going over my day in my head, I started thinking about my project. I wondered if/how I could check on my project while sitting in bed, using my phone.

Side view of my time lapse setup. To the left is the Raspberry Pi (you’ll notice my two USB cables–keyboard and mouse–have been loosened.) On top of it sits a no IR camera that is transmitting IR (which can be seen on this long exposure photo.) Underneath the seedling tray with the 10 Titan sunflower seeds planted in compressed peat is a heating mat that should keep a temperature around 72ºF, helping them grow quickly. Above are 4 LED grow lights on a 9 hour/day timer. Titan sunflowers grow to be around 10 feet tall and should make for great subjects for a week-long time lapse.
Side view of my time lapse setup. To the left is the Raspberry Pi (you’ll notice my two USB cables–keyboard and mouse–have been loosened.) On top of it sits a no IR camera that is transmitting IR (which can be seen on this long exposure photo.) Underneath the seedling tray with the 10 Titan sunflower seeds planted in compressed peat is a heating mat that should keep a temperature around 72ºF, helping them grow quickly. Above are 4 LED grow lights on a 9 hour/day timer. Titan sunflowers grow to be around 10 feet tall and should make for great subjects for a week-long time lapse.
Top view of my time lapse setup.
Top view of my time lapse setup.

I thought, “Ok. If I know the IP address, I could connect, but I don’t have Terminal on my phone…” “I don’t need Terminal, if I can check on the control panel page that displays an image.” “How do I do that?” “http:IP.ADD.RE.SS would be the ‘domain’ info… Wait! The Pi has a name on the network!” “Do I need to type index.html… or…? Oh, :8080! Let’s check there!”

So I typed, “http://raspberrypi.local:8080” in the address bar of the Safari browser on my iPhone and got this:

A screen shot of the Timelapse Cam control panel. This is from when I realized I could connect to my Raspberry Pi sitting in bed on my phone! Sweet!
A screen shot of the Timelapse Cam control panel. This is from when I realized I could connect to my Raspberry Pi sitting in bed on my phone! Sweet!

Man, this was a great feeling!

Major Success

A picture of my mini bread board with DHT11 attached. To the left is the Raspberry Pi with my balsa wood-medicine bottle cap-sticky note stand holding the no IR camera.
A picture of my mini bread board with DHT11 attached. To the left is the Raspberry Pi with my balsa wood-medicine bottle cap-sticky note stand holding the no IR camera.

I wanted to add a DHT11 sensor, which records temperature and humidity, but didn’t have much experience coding remotely, but I decided I’d give it a try. To do this, I connected to the Pi via ssh, used ‘nano’ to edit the files, and ‘less’ to double-check the contents of the files and folders. Using console.log, I could incrementally check how the setup was working. It was initially intimidating, but the cool thing is that a lot of the commands (ssh-ing and using ‘nano’ and ‘less’ I was already familiar with.)

Screen Shot of my successful attempt at integrating temperature and humidity readings into my time lapse project. As you can see in the terminal, I was able to get the info console logged!
Screen Shot of my successful attempt at integrating temperature and humidity readings into my time lapse project through remote login. As you can see in the terminal, I was able to get the info console logged!

The biggest error I had was that when I was testing and tried running the ‘node server.js’ command, I was getting errors that I needed root permission, which I couldn’t figure out. I realized that the issue I was having with PM2 was that it was being stored in a root file, so I tried running PM2 and was able to get the server running!

Screen Shot of my log updating with temperature and humidity. Still showing in Celsius, but that will soon be resolved with math.
Screen Shot of my log updating with temperature and humidity. Still showing in Celsius, but that will soon be resolved with math.

Takeaways

I had a number of successes with this project. I’d never programmed a device remotely, which felt really empowering. I also appreciated that this project allowed me to branch out its features and functionality as I went. Specifically, the takeaways I’ll most appreciate from this project are the epiphany of being able to remote login to my Raspberry Pi via my phone and the notion of approaching a project with the idea of having a core which you build out from.