Tuesday, May 28, 2024

Eclipse Light and Temperatures

 As I showed in the companion post about my experiences during the 2024 total solar eclipse, I made an Arduino-based light and temperature sensor to record the changes during the eclipse. The goal was to record at a regular interval from the start to the end of the eclipse. The set-up involves four main components beyond the Arduino: a photoresistor, a digital temperature sensor, a way to write data to an SD card, and a clock to track the time of day. While the Arduino has some built-in timing capabilities,  they always restart at 0 when the power is turned on. A real-time clock has a watch battery so it can keep the time even when turned off.

I have a data recording shield from Adafruit that includes the SD card system and the clock all on one board that fits on top of the Arduino board. That provided two of the components. Light and temperature sensors are pretty common. I settled on using a photoresistor that came with my starter kit and a digital temperature sensor that was part of a suite of sensors. 

For the photoresistor, I needed to build a voltage divider so I could measure the change in resistance. Finding the right value for the fixed resistor in the divider can be a challenge and one I largely failed at in the end as you'll see. Measuring the light is one of the earliest lessons in the starter kit so I just copied that code over. Likewise, the temperature sensor has a simple tutorial program that I copied in. Below is the breadboard layout with the data logging shield hiding an Arduino.

Breadboard view of the sensors 

The clock needs to be set whenever a new battery is put in or if it has drifted over time. When I was doing testing of the recorder, I noticed that during some tests, I was getting default times instead of the real time. But other times, it worked fine. I was focused on getting the rest of the system working so I hadn't focused on the time but it was annoying. It was also messing up which file I wrote to as the filename was constructed from the date. Obviously something was wrong with the set-up or the code. It wasn't making sense that it sometimes worked and sometimes didn't. I finally thought to test the battery and the voltage was low so it was about dead. When I was testing and I noticed the wrong time, I would reprogram it but then leave everything plugged in to the computer while doing testing. Since the clock was still powered, it held the time fine. But if I took it off computer power for long, the battery would fail and the clock would reset. A new battery quickly fixed that. 

I settled on recording data every five seconds. Each time through the loop, I read the light and temperature values, then I could write them out to the SD card along with the time. I didn't need precise timing for this so I used the built-in delay function instead of checking the time from the clock. I was a little concerned about generating too much data but that wasn't a valid concern. In the end, the file was only 141 KB. And that included some additional debugging fields for each write.

I took the working system outside one sunny day for an extended test. When I looked at the data after about an hour I noticed the temperature climbed pretty steadily getting up to near 100 degrees F on a day with weather only in the low 70's. I suspected the sensor was heating up in the direct sunlight and that was giving the high readings. I needed a way to shade the sensor while still letting air flow around it. A box would trap air and be slow to respond to temperature changes. I also needed to have light reach the photoresistor. I tried an open-weave basket over part of the breadboard but that was hard to cover over the temperature sensor. So I ran the photoresistor wires through the open weave so the light sensor was on top while the basket shaded the temperature sensor. But that turned out to be awkward to connect and disconnect the wires for transport. I settle on an index card folded over like a tent to shade the temperature sensor but leaving the rest of the set up exposed to the sun. That worked OK but might have contributed to the fluctuating temperatures recorded. 

The day of the event I set the board out on a side table and put the tent cover on it and let it start recording. All went to plan except for the light calibration. I had played around with the fixed resistor in the voltage divider to try and make sure I covered a good range. Apparently a flashlight is much dimmer than in the sun so my middle point for calibration was much too dim and throughout most of the partial eclipse I was maxing out the sensor. Only right at totality could you see the light drop off. That's a bummer but OK considering this was about my fourth priority on the day. 

Below is the full event's data. You can see the light is flat for all except the shortest amount of times as totality hits. The temperature rises as the afternoon progresses and then starts dropping off as more and more of the sun is covered. 

In total, it was a fun project even if I ended up deciding to do it late so it was a bit rushed and not as well tested as needed.



Saturday, May 18, 2024

2024 Solar Eclipse

This spring we were able to experience our first, but hopefully not last, total solar eclipse. Even having read lots about eclipse experiences, it greatly exceeded our expectations. 

We were lucky that my parents live in the path of totality, so we made early reservations to stay near them. After checking out the options and the eclipse coverage, we all decided that watching from their front yard was our best option. No traffic to deal with, plenty of access to food and drinks, cover if the weather turned on us. Plus we could have more comfortable chairs.

The weather forecast the days leading up to the eclipse weren't great with predictions of overcast skies ranging from 60-80% likely. But things started to turn for the better in the last few days. It was cloudy on the drive up and even a bit a rain as we arrived Sunday. However, Monday, the day of the big event, turned out to be a beautiful day. There were a few sparse clouds in the morning but they cleared by early afternoon and we had a gorgeous, sunny day. 

All the optics are ready and protected

The eclipse started around 2:00 pm so shortly after lunch we started to set up. I had my camera with a solar filter set up on one tripod. Sharon set up our birding scope on the other, also with a filter. We hadn't originally planned to use the scope but I didn't consider the size of the lens hood for my camera when I first bought a solar filter and just went off the screw-on filter size for the lens. That filter ended up being too small to fit, so I had to buy a bigger size. The first, smaller, one did fit the scope, so now we could watch up-close in real-time and get photographs. We also had glasses for everyone and laid a white sheet out on the ground. 

Some more friends joined us

At 1:53 the partial eclipse started with just the slightest sliver of the sun disappearing. As the next hour progressed we kept seeing more and more of the sun disappear behind the moon. For most of that time, the effects were hard to see if you weren't looking at the sun. 

Through the scope we could easily make out a couple of sunspots and use those to help track the progress of the moon. We also used a colander to project little sun shapes on the sidewalk. A great way to see the eclipse if you don't have your solar protection with you. 

Using a colander to project the partial eclipse

Somewhere around 90% coverage, we could start to notice changes in the quality of the light. It was detectably dimmer; kind of like at dusk but since the sun was still high above, it didn't quite seem like dusk. Sharon pointed out that it was dim but still a single point of light so we were casting sharp shadows. Not something you see at dusk or overcast days. Very quickly the light kept fading and we could see the automatic garage lights turning on around the neighborhood. 

In the final seconds before totality we could see the light quickly fading. On the sheet and the sidewalk we saw shadow waves as the dim light refracted through the atmosphere. We had read about this, hence the seemingly random sheet on the ground, but it was nothing like we imagined. Almost spooky in the dim light. 

We all removed our glasses as the last of the sun went behind the moon. Along the visible horizon we could see light, looking out beyond the extent of the moon's shadow to where it was still day. Seeing the shadow move over us and then being able to see the sun's corona was an amazing experience that is hard to put into words. 

Although totality lasted more than three minutes for us, it went by quickly. I tried firing off a lot of photographs but at first I had failed to remove the solar filter so all I got was blackness. Once I realized that, I did take several more but didn't do the bracketing that I had wanted to do. So the images turned out fine but I didn't get the range of corona that I was hoping for. 

Totality

In the video below, you can see the shadow approaching as things get dark, the lights turn on, and then hear us react to totality. It ends with the sunlight coming back up. Again, I didn't quite capture the images I was hoping for. This camera did automatic ISO adjustment. You can kind of see it getting noisier as it darken but not nearly the change in light that we actually experienced.

About 30-40 seconds before totality ends, we felt the winds pick up. You can hear that on the video too. It was a cool wind blowing in from the northeast, the direction the shadow was moving. During totality, we could feel the temperature drop. And as totality ended, we again saw the shadow bands. 

I also wanted to capture the changing temperature and light levels throughout the day. I built a simple data collector using an Arduino board, and digital temperature sensor and a photoresistor. I'll write more about how I built that in a companion post. Again, I didn't do a great job calibrating the photoresistor so it was maxed out for most of the time but you can definitely see the sudden drop in light levels and the accompanying temperature drop.

Temperature (red) and light level (normalized, blue) during eclipse

We stayed out and watched the sun slowly come back over the next hour. It was almost like the previous hour but in reverse. Except there was less anticipation as we had already experienced the amazing changes of totality.


In some birding circles it is common to celebrate seeing a new species of bird with a slice of pie. We built on that idea and had celebratory eclipse brownies that evening.

Eclipse Brownie

We are looking forward to finding a way to see another one. And if you haven't experienced one, it truly is on a different level than a partial eclipse.