Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Friday, April 5, 2024

Data Collection Plan for Total Solar Eclipse 2024

First of all, if you've been watching the weather forecasts, you may have concluded that the total solar eclipse passing through Dallas on Monday will be a bust. Well, don't give up hope, yet. Even though we got clouded out in 2017 on our trip to Marshall, Missouri, as you would see in my post from back then, I still managed to capture of view of totality through the clouds. All it takes is for the clouds to part a bit at just the right time or the clouds to be high altitude and thin for us to still be able to see totality. Regardless of the forecast, be sure to get outside to see what there is to see!

Even if we are clouded out, you'll still experience one aspect of a total solar eclipse: it will get dark! With that in mind, I expect to have a successful day whether I get to see the total eclipse or not. I have a bunch of microcontrollers (ESP32) with sensors that I'll be using to collect data that day. 

That said, you may find that my approach to data collection is a bit unorthodox. Here's part of my setup for data collection. Yes, that is a Nonni's biscotti box. :-D

Seriously, here's the type of data I'll be collecting:

- light levels for visible light and near infrared (lux)
- light spectrum levels in various wavelengths
- environment: temperature, humidity, air pressure
- sound level changes (dB)
- magnetic field changes

WARNING: you may be a geek if you keep reading beyond this point. 

TL;DR

The architecture I'm using builds on infrastructure I already have in place. I use Home Assistant running on a Raspberry Pi for my home automation, control and historical data. Home Assistant supports integrating data sensors using microcontrollers called an ESP32 via a system called ESPHOME. By attaching various sensor components to an ESP32 then configuring it in ESPHOME, it makes it simple to automatically collect sensor data in Home Assistant for storage, retrieval, monitoring and analysis. 

Here is an example of a historical data graph in Home Assistant. The beauty of this besides being able to quickly visualize data is that Home Assistant also makes it easy to download the data for analysis in other tools. 

My original plan was to set things up to collect data through three full days, the day before, of and after the eclipse. Given the prospect of clouds and, more importantly, the forecast for rain on Tuesday, I've scaled back to just trying to collect data in the hours around the eclipse. I considered creating weatherproof enclosures for the sensors but that would have turned a shoestring-budget project into something quite a bit more expensive. 

After things have wrapped up, I'll pull up history for all the sensor devices in Home Assistant and download the data for further analysis.

As for the details of the sensors I'm planning to deploy, let's start with the light sensors. You can see details of the code plus the specific sensors in this gist on github.com. For this sensor package, the ESP32 and the sensors are mounted on a breadboard that is in the bottom of the biscotti box.

The reason is that my goal is to measure changes in ambient light. For various (and technical) reasons, direct sunlight would be more challenging to measure with these sensors. Given we should see a drop in ambient light levels (and color levels) during totality even if it is cloudy, I think the data will be more predictable and meaningful just measuring ambient light. Pointing the sensors straight up and blocking them from direct sunlight should accomplish this. 

One thing you'll see in the ESPHOME code for each sensor package is that they generally report data back to Home Assistant once a minute but include a switch I can turn on that tells the sensor to send measurements every second (or faster). I have Home Assistant automations set up to flip the high speed data collection switch on for each sensor package a little while before the eclipse starts and turn it back off a little while after the eclipse ends. That way once I set things up Sunday evening or Monday morning, I can focus my attention on the eclipse, leaving the data collection to happen automatically. 

On one side of the outside of the box is another ESP32 mounted on a breadboard with a sensor to measure the environment. Here's the gist with the ESPHOME including details on the sensor.  It will collect data on temperature, relative humidity and air pressure. The code also derives absolute humidity and dew point. 

Based on things I have read including published eclipse science projects, we should certainly see a change in temperature as the Moon's umbra passes over us during totality. Relative humidity has an inverse correlation to temperature so I expect to see changes to it that are similar to the temperature changes (but inverted). I have no idea what to expect in terms of changes in absolute humidity, air pressure and dew point but it will be interesting to see if there are changes that match the timing of the eclipse. 

On the other side of the box is an ESP32 with a digital microphone. This one is set up to measure changes in sound levels throughout the eclipse. You'll see in the gist, this is based on a custom ESPHOME component. It provides sound levels in several forms but my interest is in just having the unfiltered (raw) sound levels. 

Measuring changes in sound levels that can correlate to the total phase of the eclipse may be challenging. Although it may "get quiet" in terms of reactions to the darkness by birds and insects, my guess is that loud expressions of joy during totality by folks gathered with us to observe the eclipse may offset any drop in sound levels by nature. 

The last sensor package I've put together was an afterthought. I had one more ESP32 and also had a sensor that is a magnetometer, one that measures changes in magnetic fields in 3 axis. See this gist for the ESPHOME code which includes details of the sensor. The ESP32 I'm using in this case also happens to be much smaller than the others which seemed like to a good idea for a sensor trying to measure changes in local magnetic fields. 

Based on my research, there have been changes in magnetic fields around Earth measured during past total eclipses but those measurements were performed with sophisticated equipment in the upper reaches of the atmosphere or in space. I don't have any reason to expect that I'll measure any changes that correlate to the timing of the eclipse with my simple magnetometer setup but I figure I'll do the data collection and see what happens. 

For this sensor package, I've mounted the sensor on top of a wooden yardstick with the ESP32 below and a Wi-Fi antenna below that. My plan is to have this mounted on a stake well away from structures and people to minimize other magnetic fields nearby. However, that means it's further to the Wi-Fi router, hence the extra antenna. I'm also using a power pack instead of using a power adapter plugged into AC power. This means the only limitation on where I can put this will be how far from the house I get before the Wi-Fi signal drops. 

Sometime next week when I have had time to review and analyze the data collected on Monday, I'll write up my conclusions and share them here. 

Just two days and a wake-up before show-time!

Stay tuned!



Thursday, August 31, 2023

Solar Transit of a Jet


UPDATE: I've replaced the previous video with a new version that includes the sound of the jet flyover from the original audio track. 

While out filming the sun to practice for the total solar eclipse next April, I was photo-bombed by a jet! 

The technical term is "transit", when an object crosses in front of an astronomical body. There is plenty of air traffic over our house with Love Field and DFW serving the area so I guess this shouldn't have surprised me but observing a transit (like this one, or this one) takes being in just the right place at just the right time so it's a pretty rare thing to have happen. 

One reason I happened to be shooting at this time is that I'm working out exactly what equipment I'm going to be shooting with for the total solar eclipse. This video was shot using:
  • Sky Watcher EvoStar 72ED refractor
  • Baader film solar filter
  • 2" mirror diagonal
  • Celestron 1.25" 2X Barlow
  • T2-ring
  • Nikon D750 DSLR
  • Focusing with DeepSkyDad AF3 autofocuser
  • Sky Watcher Star Adventurer 2 tracker
  • Radian carbon fiber tripod
I have a new 2" 2X Barlow and I plan to shoot straight-through (i.e., no diagonal) but I am still working out what combination of components will allow me to properly focus with the new Barlow. Once I have that worked out, I'll start working on automating my astrophotography workflow using a small computer (a Raspberry 4 running software called StellerMate).  

The quality of this video isn't great but that's basically because I was focusing (pun intended) more on getting the equipment working right than on the finer details. Next April may see a long ways off but it will be here in the blink of an eye and as I know from my experience in 2017, being ready to catch a full eclipse end-to-end, most importantly those few minutes of totality, takes an incredible amount of practice. So, I'll be shooting pretty regularly over the next few months to make sure I have everything working perfectly. 

Anyone have a way to ensure that April clouds don't spoil the eclipse for me, er, us?

Seriously, you'll notice from the video that the Sun is pretty active with quite a few sunspots showing. Over the next few weeks, if I can get a day with good "seeing" (i.e., where there is minimal air turbulence), I'll get some shots with lots of detail, everything in focus, and the sunspots should jump off the page at you. Stay tuned!

Warning 
NEVER look directly at the sun without proper protection. This video was shot using a telescope and camera equipped with a special solar filter.