Chapter 2: Solar Array Repair

Day 06: Time to fix the battery

Video lesson · 25 min

Critical battery alert — power reserves at 12%. Build a light-sensing system with a photoresistor to monitor and repair the solar array. Learn analog input, the analogRead() function, and how to read light levels from the physical world.

Mission Status: Critical Battery Alert

The alarm pierces through the submarine's hull like an ice pick through silence. Red warning lights bathe your cramped control station in an ominous glow as the computer's voice echoes through the metallic corridors: "Battery levels critical. Power reserves at 12% and falling."

You lean forward in your captain's chair, watching the digital readouts with growing concern. The HERO Board's diagnostic screen shows section after section going dark — first life support backup systems, then the recreational areas. The familiar hum of the heating units stutters and dies, leaving only the essential systems drawing power from your dying batteries.

Outside the porthole, nothing but inky darkness stretches in all directions. Your solar array — normally a lifeline of renewable energy when floating on the surface — sits useless in this abyssal prison. But you're not completely helpless. Your engineering kit contains something that might save you: photoresistors that can simulate solar panel readings.

The plan is risky. You need to test and calibrate your solar monitoring system before deploying the real panels to the surface. One wrong calculation, one faulty connection, and you'll lose your solar array forever to the crushing depths above. There's no room for error — your survival depends on getting this right the first time.

Time to become the engineer you've trained to be. The ocean won't wait, and neither can you.

What You'll Learn

By the end of this critical mission, you'll have mastered the skills needed to monitor your submarine's power systems:

• Read analog sensors: Use photoresistors to detect varying light levels, simulating solar panel output

• Master analog vs digital: Understand why some sensors give you a range of values instead of just on/off

• Use the Serial Monitor: Create a diagnostic window to watch sensor data in real-time

• Map data ranges: Convert sensor readings into useful LED blinking patterns

• Build adaptive systems: Create a solar monitoring system that adjusts to different lighting conditions

Understanding Light Sensors: Your Digital Eyes

Before we dive into the electronics, let's understand what a photoresistor actually does. Think of it as the electronic equivalent of your pupils — the black circles in the center of your eyes.

When you walk from a dark room into bright sunlight, your pupils automatically shrink to let in less light. When you enter a dark theater, they expand to capture every available photon. A photoresistor works similarly, but instead of changing size, it changes its resistance to electrical current.

In bright light: The photoresistor's resistance drops dramatically, like opening floodgates to let more electrons flow through. This creates a stronger electrical signal that your microcontroller can detect.

In darkness: The resistance shoots up, choking off the electron flow like squeezing a garden hose. The electrical signal becomes much weaker.

This makes photoresistors perfect for simulating solar panels. Both devices respond to light intensity, though solar panels generate power while photoresistors just change their resistance. For your submarine's diagnostic system, this resistance change is exactly what you need to monitor "sunlight availability" before deploying your real solar array.

The genius of this setup is that you can test your monitoring system safely underwater, using artificial light to simulate different sunlight conditions on the surface above.

Analog vs Digital: The Dimmer Switch vs Light Switch

Here's a crucial concept that will make or break your understanding of sensors: the difference between analog and digital signals.

Digital signals are like regular light switches — they're either ON (high voltage) or OFF (low voltage). No in-between. It's binary: 1 or 0, high or low, true or false. The push buttons you used in previous missions were digital inputs.

Analog signals are like dimmer switches — they can be anywhere from completely off to full brightness, with infinite positions in between. Instead of just 1 or 0, you might read 247, or 891, or 12 — any number within a certain range.

Your HERO Board converts analog voltages (0V to 5V) into digital numbers (0 to 1023). When the photoresistor senses bright light, it might generate 4.2V, which becomes the number 859. In dim light, it might only generate 1.1V, which becomes 225.

This is lesson 7 of 31 in 30 Days Lost in Space — a professionally produced Arduino course taught by Dr. Greg Lyzenga (NASA JPL scientist, Harvey Mudd professor). Each lesson features cinematic-quality video produced with a 20-30 person professional crew.

All video lessons are free to watch. Get the kit at craftingtable.com — $100 with a 30-day money-back guarantee.