You are on page 1of 79

SOLAR CLASS

5 Lessons Beginner Level

In this hands-on beginner class, you'll learn fun ways to harness solar energy in your own
backyard, then level up to soldering solar powered electronics projects. Each lesson builds in
complexity, stocking your personal library of maker skills with a few more techniques you may not
previously have discovered.
You'll start simple with a trash bag solar balloon, demonstrating thermal energy collection
resulting in buoyancy as the black balloon floats on its own. Then you'll learn how to engrave
organic materials using custom stencils and a magnifying glass to concentrate the sun's light.
The last few lessons focus on solar panels and solar power, where you will build a solar USB
backup battery, and then a soil moisture tracker. By the end, you will gain takeaways for applying
solar power to your own electronics projects, too.
Whether you're a novice or have some experience with the topics at hand, I hope this class offers
a fun and easy way to start using solar energy in your everyday life.

Class Author:
bekathwia (/member/bekathwia/)
Becky Stern is a content creator at Instructables. She has authored hundreds of tutorials about everything from wearable
electronics to knitting. Before joining Instructables, Becky worked as a senior video producer for MAKE Magazine and as director
of wearable electronics at Adafruit. She lives in New York City and enjoys riding her motorcycle, making YouTube videos, and
collecting new hobbies to share with you. Her work has been featured by VICE, the BBC, The Late Show with Stephen Colbert,
Engadget, CNN, Business Insider, Forbes, and Science Friday.

Solar Class: Page 1


Lessons

Lesson 1: Solar Balloon


Build your own buoyancy demo with trash bags and tape! It's
irresistibly easy to build your own floating balloon and watch it rise on
a sunny day. This lesson makes a great school or family project!

Lesson 2: Solar Engraving


Wield the concentrated power of the sun by engraving designs with a
magnifying glass! You'll learn to create a custom stencil from foil tape,
then safely burn the design into leather, cardboard, cork, wood, and
more.

Lesson 3: Solar Panels


Switching gears from thermal energy to solar-generated electricity,
this lesson will get you up to speed on solar panels. Learn how they
work and why you also need batteries and charge controllers for most
applications of solar power.

Lesson 4: Solar USB Charger


Learn how to put together your own USB backup battery that
recharges with a solar panel, step-by-step. If you're new to soldering,
this is a great project for practice, since there's lots of variety in the
connections.

Lesson 5: Solar Powering Microcontroller Projects


Create a low-power Arduino project in a waterproof enclosure! We'll
build an internet-connected soil moisture monitor, and you can apply
the general skills to any sensor or microcontroller project you wish to
power with the sun.

Solar Class: Page 2


LESSON 1: SOLAR BALLOON

https://vimeo.com/236174542

Let's make a solar balloon that floats with the power of hot air! This is the perfect backyard activity for a
sunny day. A few common trash bags taped together can become a science experiment and entertaining
way to spend an afternoon.

The black color of the bags absorbs the sun's energy, heating up the air inside. The color of an object
correlates with the wavelengths of light it absorbs and reflects. Black absorbs the most wavelengths, while
white absorbs the fewest. Red absorbs all but the red wavelengths, and so forth for other colors. Black is
the most efficient color for converting light energy into heat energy, which is then transferred to the air
inside the closed balloon. The hot air is less dense than the surrounding air, causing the balloon to float up,
supporting its own weight.

This same physics powers hot air that balloons you can ride in. It's the principle of buoyancy— once the air
inside heats up and expands, our balloon weighs less than the air it displaces because it is less dense.
This project demonstrates how solar radiation can be used to create heat, and a fun day outside.

Solar Class: Page 3


What You'll Need

All you need are some black trash bags (https://www.amazon.com/dp/B004MDLYZ6/?tag=instructabl09-


20), cellophane packing tape (https://www.amazon.com/dp/B01DTDE9DS/?tag=instructabl09-20), scissors
(https://www.amazon.com/dp/B000P0LNRE/?tag=instructabl09-20), and a piece of string
(https://www.amazon.com/dp/B000WWGALE/?tag=instructabl09-20). Look for trash bags that are .3 mil to
1 mil in thickness— the thinner, the better. Likewise, thinner tape is best to reduce the overall mass of the
balloon.

It's best to pick a sunny day with calm wind conditions for this project. It can be particularly frustrating to try
to build the balloon when it's windy, so consider assembly indoors if it's breezy.

Solar Class: Page 4


Solar Class: Page 5
Trim Bags

Leave one trash bag with the bottom seam intact, then cut off both the seam and the flaps (if any) on two
more bags. On the last bag I cut off the seam, but not the flaps, since they'll be at the opening of the
balloon (however flaps are not required).

Tape Together

Solar Class: Page 6


Open up and overlap the trash bags together by about an inch, then tape around each seam.

Inflate Your Balloon

Solar Class: Page 7


Run around to fill your new balloon with air.

Gather up and tie off the open end of the balloon, topping it off with air from your lungs (if you're up to it) or
a hair dryer (optional).

Solar Class: Page 8


Tie a knot in the gathered end to close up the balloon.

Solar Class: Page 9


Tether & Enjoy!

Tether your balloon with some string and put it out in the sun, where it should heat up and start to float. The
heat generated inside the balloon decreases the air density, which creates lift. This is the same reason
objects float in water, and is described by Archimedes' principle
(https://en.wikipedia.org/wiki/Buoyancy#Archimedes.27_principle). Since the balloon heats up slowly, the
increasing upthrust from the slowly changing pressure inside can be observed in the time it takes to
explain the science behind it.

It's very important not to let the balloon go. Not only is it bad for the environment, but it could be deadly if it
gets into an airplane's engine.

Solar Class: Page 10


When you're ready to deflate it, be careful because the surface will be hot. Cut a hole and start to squeeze
out the air.

Share a photo of your solar balloon in the Class Project section below, and get ready to tackle another
backyard solar project in the next lesson!

Solar Class: Page 11


LESSON 2: SOLAR ENGRAVING

https://vimeo.com/234078598

Learn to focus the energy of the sun into a concentrated beam capable of engraving cardboard, leather,
cork, wood, and other organic materials. If you ever experimented with a magnifying glass outside on a
sunny day, you are probably already familiar with this technique.

The science at work here is the concentration of energy using a lens. Each ray of light carries energy along
with it. Usually these rays are evenly spread out over the objects they hit, so no single point is getting a lot
more or less energy than nearby areas.

The magnifying glass is a lens that focuses beams of light coming into it, concentrating many rays' energy
into more localized energy. If your material is at the right distance and orientation from the magnifying
glass, all the light coming through the lens is concentrated into one spot on the material, heating it up
enough to burn. A similar method using fields of mirrors pointing towards a central collector
(https://en.wikipedia.org/wiki/Concentrated_solar_power) is used to heat up water for steam power
generators.
Solar Class: Page 12
What You'll Need

Solar Class: Page 13


You don't need much to practice your solar engraving skills. To follow along with these instructions, gather
together:

Magnifying glass (https://www.amazon.com/dp/B01AO5SPZ2/?tag=instructabl09-20)

Small piece of glass (such as from a picture frame)

Tape (https://www.amazon.com/dp/B00347A87G/?tag=instructabl09-20) for the glass edges (masking, duct,

artist, gaffer's, etc.)


Aluminum duct tape (https://www.amazon.com/dp/B01FROBUXE/?tag=instructabl09-20)

Pencil or sharp implement such as an awl

Craft knife (https://www.amazon.com/dp/B005KRSWM6/?tag=instructabl09-20)

Cutting mat (https://www.amazon.com/dp/B0015AOIYI/?tag=instructabl09-20)

Tweezers (optional)
Dark sunglasses

Organic materials to engrave (such as cardboard, leather (https://www.amazon.com/dp/B01365YP0Q/?

tag=instructabl09-20), cork, wood)

Spray bottle (https://www.amazon.com/dp/B000NJ221/?tag=instructabl09-20) with water

Fire extinguisher (https://www.amazon.com/dp/B00002ND64/?tag=instructabl09-20) (recommended)

Solar Class: Page 14


Tape Glass Edges

First off, let's make the glass a bit safer to work with. Tape up the edges with some tape of your choosing
(such as masking, duct, artist, gaff, etc.).

Solar Class: Page 15


When all the sharp edges are covered in tape, the glass is much safer to handle because it's less likely to
cut you. Set it aside and get ready to make the stencil design!

Draw Your Stencil Design

Solar Class: Page 16


Grab your cutting mat, aluminum duct tape, pencil or other pointed implement, and your craft knife.

Solar Class: Page 17


Draw and a simple design of your choice on the aluminum tape. You can use a pencil or the sharp tip of an
awl— anything pointy will do. You can engrave slightly crisper lines if you place your stencil tape-side
down, which requires cutting out your design backwards if it’s not symmetrical.

Solar Class: Page 18


The simpler the shape, the easier it will be to transfer flawlessly to the glass. The smaller the shape, the
more quickly you'll be able to engrave it with the sun. I recommend starting with some simple geometric
shapes to start out! Try hearts, stars, and other shapes with simple geometry.

Solar Class: Page 19


Cut Out Design

Carefully cut out your stencil design with a sharp craft knife. You can use a ruler if your lines are straight,
but don't overshoot the cuts because we are keeping the stencil, not the interior shapes.

Remove the aluminum tape in the areas you desire to engrave.

Transfer to Glass

Solar Class: Page 20


Carefully transfer the stencil to the center of the glass, and fill in the remaining glass with more metal tape.

If your stencil tears or warps during transfer, use your pencil or a pair of tweezers to repair it.

Solar Class: Page 21


Press the tape down firmly all around the stencil area to ensure it is flat to the glass.

Solar Class: Page 22


Get Outside, Get Engraving

Solar Class: Page 23


Take your new stencil, magnifying glass, and some materials with you to a bright and sunny spot where
you can easily tilt your work to directly face the sun. This technique works great on leather, cork, and
cardboard, and will also engrave wood with a little extra time.

It’s smart to be prepared with a spray bottle of water in case your material ignites. To stay ultra safe while
using this technique, I’ve got a fire extinguisher nearby as well. The concentrated light beam gets really
hot, so keep it away from your hands.

You should wear dark sunglasses to make it easier to see where your concentrated light beam is going,
and also consider some sunblock and a hat.

Solar Class: Page 24


Adjust the distance and angle of the magnifying glass until the point of light is as small as you can possibly
make it, and slowly move the beam over all areas of the stencil. You may start to see some smoke coming
away from the engraving site. When you've passed your beam over the entire design, which may take
several minutes, you may remove your stencil to see the results.

Solar Class: Page 25


Materials & Tips

It's significantly easier to execute this technique when you can tilt your work towards the sun, which means
it's easier to engrave flat, simple shaped objects than, say, the handle of a hammer. You should only
engrave organic materials. Don't engrave plastics or other synthetic materials, which may produce harmful
fumes and/or melt rather than engrave.

Solar Class: Page 26


It was easy to engrave a flat cork trivet and a rectangular piece of wood. You may notice different materials
require different amounts of time to engrave effectively (wood is slower than cardboard, for example).

Solar Class: Page 27


See how it's hard to hold the stencil and the hammer up to face the sun? Consider creating a jig to hold
your object if it isn't easily held at an angle from your work surface.

Solar Class: Page 28


If you place your stencil tape-side down, you'll get crisper lines at the edges of your engraved areas. This
requires a symmetrical design, or cutting your design backwards at the stencil stage.

Did you ever think you'd be using the physics and of light to draw? The convex shape of the magnifying
glass collects photons on one side and unifies them at a single point as they exit the other side. You can
use this same science to start a campfire with a pair of eyeglasses. The ease with which heat is generated
depends on the steepness of the convex lens. Please be responsible with this technique, and don't start
forest fires.

Solar Class: Page 29


Next, Try...

The next time the sun comes out, try it out! I’d love to see what you create with this technique. Please post
a photo in the Class Project section below, and also check out the inspirational engraving projects below,
and take a peek at our Laser Cutting Class (https://www.amazon.com/dp/B000NJ221/?tag=instructabl09-
20) to take this technique to the next level.

Solar Class: Page 30


LESSON 3: SOLAR PANELS

Are you ready to generate electricity with solar energy? Let's do it! Discover how solar panels work and
how they are used in practical applications.

https://youtu.be/Lk--SiDQU40

Photovoltaic Cells

A solar panel is made from an array of photovoltaic cells (https://en.wikipedia.org/wiki/Solar_cell), which


generate an electrical current when exposed to light. Photovoltaic cells are made from two types of silicon
semiconductor stacked together in wide flat layers sandwiched by a solid conductor on back and thin
gridded connectors on the front (so light can directly contact the silicon).

Solar Class: Page 31


The photovoltaic effect was discovered in 1839 by French scientist Edmond Becquerel, and by the 1880s,
the first solar cell. The material used was selenium, which had been recently discovered to have
photoconductive properties, which means it becomes electrically conductive when exposed to light.

Another 1880s observation catapulted solar technology forward: the photoelectric effect. Light hits a
surface of a material and the photons knock the electrons out of place, freeing them to flow through a
conductor. But it wasn't until the 1950s that more-efficient silicon was used in commercial solar cells, and it
remained so prohibitively expensive that its applications were limited mainly to satellites.

Photo CC Jon Olav Eikenes (https://www.flickr.com/photos/jonolave/4892983363/)

Research steadily improved solar power's efficiency and reduced cost. Modern solar panels are made from
crystalline silicon with two types:

n-type silicon has an excess of electrons

p-type silicon has a deficiency of electrons

Photons hit the layer cake and electrons are knocked out of their spot at the n-p junction. They are then
free to move through the top conductors and into a circuit.

Solar Class: Page 32


You can perform a fun experiment to demonstrate this effect with a few LEDs, a solderless breadboard,
and a multimeter. LEDs are diodes, which are also made of two types of silicon layered together to allow
electron flow in one direction. They behave similarly to photovoltaic cells (but much less effective at
generating power), and we can measure the electricity they generate. Learn more about diodes in Randy's
Instructables Electronics Class (https://www.instructables.com/lesson/Diodes/).

Wire up a handful of LEDs (6-8) in parallel on a solderless breadboard.

Attach the probes of your multimeter to the positive and negative terminals and measure the voltage.
Alligator clips can be handy here to free up your hands. Shine a bright light on the LEDs and watch the
voltage increase!

Solar Class: Page 33


Solar panels are available in a variety of different voltages, depending on how many photovoltaic cells it
contains. The more cells, the higher the voltage. The larger each cell is, the more current it can generate.
Projects in this class use the rugged 6V solar panels made by Voltaic
(https://www.amazon.com/l/8450784011), available in 2W (https://www.amazon.com/dp/B06Y1TYXP3/?
tag=instructabl09-20), 3.5W (https://www.amazon.com/dp/B0091PU5TG/?tag=instructabl09-20), 6W
(https://www.amazon.com/dp/B073RQ7HLS/?tag=instructabl09-20&th=1), or 9W
(https://www.amazon.com/dp/B001U2FCZK/?tag=instructabl09-20). The formula for Watts is Volts times
Amps, so the 2W panel can generate 2W/6V = 500mA of current at it's maximum (when it's the sunniest).

But the solar panel's output is far from consistent. Shade from a tree or building, clouds, where you live,
time of day, and the current season are a few factors that will affect the performance of your solar panel.
To make the best use of this fluctuating power source, solar panels are almost always used to charge a
battery rather than power devices directly.

Batteries & Charge Controllers

Depending on the scale of your solar goals, various different types of equipment are required to make use
of the power from solar panels. For small DC electronics, a small charge controller circuit and lipoly battery
is all you need to get started.

Solar Class: Page 34


To pick a battery and panel size, you can determine the rough power consumption of your device by
adding together its components' current usage. For example, the PowerBoost
(https://www.adafruit.com/product/2030) in the upcoming Solar USB Charger Lesson will draw as much
current as your USB device wants, typically 1000mA. If I choose a 2200mAh battery, I can charge my
device for 2200/1000 = 2 hours total, or at least complete 2-4 device charges, or a week's worth of 15
minute end-of-day sips.

Solar Class: Page 35


Under optimal sunlight conditions, a 2W solar panel (2W / 6V = 330mA) can charge a 2200mAh battery in
about seven hours (2200/330). A 3.5W panel can charge the battery in 4 hours (2200mAh / (3.5W / 6V)).
But in reality, the charge rate will be slower due to changing conditions as you move your solar panel
around, or as clouds roll by.

Photo CC Tom Page (https://www.flickr.com/photos/tompagenet/5995109473/)

For large projects like powering an off-grid home or adding solar power to your vehicle, you'll need a few
more components to get up and running, such as a charge controller, mounting hardware and cabling,
battery inverter, and deep cycle battery or several. Here are a few vendors selling panels and kits for off-
grid solar:

Renogy (https://www.renogy.com/)

Home Depot (http://www.homedepot.com/b/Electrical-Alternative-Energy-Solutions-Solar-Panel-Kits-Off-Grid-

Solar-Kits/N-5yc1vZcdrj)

Wholesale Solar (https://www.wholesalesolar.com/off-grid-packages)

For any large scale solar panel installation, including on-grid solar systems, you should be sure to consult
the applicable professionals in order to properly install solar panels and their requisite electrical wiring. If
you don't know what you're doing, find someone who does to help! Don't take this lesson as an
endorsement of any dangerous activities outside your skill level. Rechargeable batteries require their own
safety precautions— you should take care not to leave your project unattended or expose your battery to
extreme temperatures or physical abuse.

https://vimeo.com/239241131

Solar Class: Page 36


Solar Panel Wire Extension

You may wish to extend or change the connector on your solar panel's wire. Here's an effective way to
cleanly splice the cable to install a different connector and/or extension. make sure you're using wire that is
the appropriate thickness/gauge for the maximum current of your solar panel.

Apply a large piece of heatshrink tubing over the slack of the wire. Strip and tin the inner wires, and apply
smaller bits of heat shrink to one side.

For the cleanest end result, cut the wires asymmetrically as shown. Solder the inner wires, matching red to
red and black to black (or white to black as in my case), then heat up the heatshrink tubing to insulate the
solder joints.

Repeat to insulate the entire junction with the larger piece of heatshrink tubing, and you can hardly tell
there was any wire surgery!

Solar Class: Page 37


LESSON 4: SOLAR USB CHARGER

https://vimeo.com/238971304

Let's make something super useful— your own solar powered USB backup battery! After some simple
soldering, you'll be ready to charge your phone and other portable electronics on the go while camping or
during the next power outage. What follows is a basic recipe which you can follow exactly, or switch out
the solar panel and battery size to match your desired capacity, charge speed, and budget.

Solar Class: Page 38


What You'll Need

Parts (Adafruit shopping list (http://www.adafruit.com/wishlists/446491)):

Solar lipoly battery charger (https://www.adafruit.com/product/390)

2W Solar panel (https://www.adafruit.com/product/200) (or larger if you can manage: 3.5W

(https://www.adafruit.com/product/500), 6W (https://www.adafruit.com/product/1525), or 9W

(https://www.adafruit.com/product/2747))

PowerBoost 1000 Basic (https://www.adafruit.com/product/2030)

2200mAh li-ion battery (https://www.adafruit.com/product/1781) (or other lipoly/li-ion battery

(https://www.adafruit.com/category/574) at/above 500mAh, optional 2.2K ohm resistor for adjusting max charge

rate)

On/off power switch (https://www.adafruit.com/product/1478) (mine is illuminated and also requires a 220ohm
resistor (https://www.adafruit.com/product/2780) for the LED)

Thermistor (https://www.adafruit.com/product/372) (optional; recommended for safely charging unattended)

Wire (https://www.amazon.com/dp/B01LH1G2IE/?tag=instructabl09-20)

Heat shrink tubing (https://www.amazon.com/dp/B01MFA3OFA/?tag=instructabl09-20)

Enclosure box (cardboard recommended, but metal (https://www.adafruit.com/product/2230)/plastic

(https://www.adafruit.com/product/903)/wood ok)

Double stick foam tape (https://www.amazon.com/dp/B000789ANS/?tag=instructabl09-20)

Small screws (optional)

Tools:

Soldering iron (https://www.amazon.com/dp/B01DUPRXCE/?tag=instructabl09-20) and solder

(https://www.adafruit.com/product/145)

Third hand tool (https://www.amazon.com/dp/B01E62773K/?tag=instructabl09-20)

Wire strippers (https://www.amazon.com/dp/B00FZPHMUG/?tag=instructabl09-20)


Flush snips (https://www.amazon.com/dp/B00FZPDG1K/?tag=instructabl09-20)

Tweezers (https://www.amazon.com/dp/B01HB46J8E/?tag=instructabl09-20) or needlenose pliers

Utility knife (http://www.amazon.com/dp/B0006SJAR0/?tag=instructabl09-20) (or drill/chisels/rotary tool,

depending on enclosure material)

USB A-miniB cable (https://www.amazon.com/dp/B00NH13S44/?tag=instructabl09-20)

Heat gun or lighter

Multimeter (https://www.amazon.com/dp/B0012VYKVQ/?tag=instructabl09-20) (optional but handy for

troubleshooting)

Scissors (https://www.amazon.com/dp/B000P0LNRE/?tag=instructabl09-20)

First soldering project? No problem! This is a great project for beginners, and you'll get a variety of types of
solder practice while building it. You can learn how in the soldering lesson
(https://www.instructables.com/lesson/Soldering-1/) of Randy's free Instructables Electronics Class
(https://www.instructables.com/class/Electronics-Class/), then come back here to assemble your solar
charger.
Solar Class: Page 39
Circuit Diagram

The solar charger circuit board comes with a USB port, DC jack for the solar panel, and two JST ports
already attached to the board. The battery comes with a JST plug and will attach to the JST port labeled
BATT. The solar charger comes with a JST pigtail cable which will connect to the LOAD port and be
soldered directly to the PowerBoost input terminals.

The power switch (at the top of the diagram above) should be attached to the PowerBoost pins labeled EN
and GND. Flipping it will turn on and off the PowerBoost. This switch does not have to carry the circuit's
current load, so choose almost any on/off switch you like. I chose an illuminated on/off pushbutton, which
also needs to be connected to the PowerBoost's 5V and GND pins, with a 220ohm resistor in series. The
illuminated portion of the switch is optional, but it is a nice indicator that the device is ready to charge your
USB devices.

Solar Class: Page 40


Solar Class: Page 41
Test Fit Components

You'll want to pick an enclosure that fits all your components snugly, without too much squishing. I had an
extra Moo business card box that fits the length of the battery and the height of the solar charger perfectly,
and even has a little extra space left over for business cards still.

It closes with magnets embedded in the layers of cardboard and paper. If you can't find a stiff
paper/cardboard box, you can choose an enclosure made from wood, plastic, or metal, however these
harder materials will require different tools for creating port openings, such as a drill with a step bit.

In addition to physically fitting inside, you must also plan out where to create the openings so that your
device is useable. I chose to put the illuminated power button next to the USB port, since the light indicates
it's ready to charge. This area of the box is recessed, making the button less likely to get accidentally
triggered while the device is in my bag. Opposite the button and USB A port (PowerBoost) are the solar
panel DC port and USB mini B port (solar charger).

Solar Class: Page 42


Solder Capacitor to Solar Charger

The solar charger board comes with most of the components soldered to the board already, with the
exception of the large filtering capacitor. Look for the large circle on the circuit board, with holes matching
the capacitor's lead spacing.

The capacitor's polarity is important! The negative side of the capacitor is labeled with a white stripe and
minus symbol, and the negative lead is typically shorter. The positive side of the capacitor is not labeled,
and the leg is typically longer.

Line up the positive lead to the hole marked +, and the negative lead to the hole marked -.

If your enclosure doesn't have enough space to fit the height of this large capacitor, you may bend it over
slightly before soldering, or use wires (and heat shrink tubing) to move it to another part of your enclosure.
According to the official assembly instructions (https://learn.adafruit.com/usb-dc-and-solar-lipoly-
charger/solar-charger-preparation?view=all#solar-charger-preparation), you should be careful to avoid
contact with the hot chip in the center of the board.

To learn how to solder, check out the soldering lesson (https://www.instructables.com/lesson/Soldering-1/)


in Randy's free Instructables Electronics Class (https://www.instructables.com/class/Electronics-Class/).

Solar Class: Page 43


Solar Class: Page 44
Assemble PowerBoost

Install the USB port to the PowerBoost circuit board, and be sure it is seated completely and evenly before
soldering the terminals to the board on the underside.

The large clip joints connecting big areas of metal will require longer heating and more solder other solder
joints. Allow to cool in your third hand tool for several minutes before attempting to handle the USB port, as
it will get very hot.

Although the PowerBoost comes with two different connectors for its input power and ground terminals,
we're going to leave those off and solder the JST pigtail wire directly to the circuit board.

Heat up and tin the ends of the wires and the pads marked + and -. Reheat the pad and wire as you bring
them together: red to + and black to -.

Mark & Cut Port Openings

Solar Class: Page 45


Now that your circuit board elements have taken their final shapes, it's time to mark and cut openings for
the ports in your enclosure.

Arrange the components inside your enclosure as you did during test-fit, and trace around the ports and
power button using a pencil or marker.

If you're using double-stick foam tape instead of screws to secure your components, adjust the markings to
accommodate for the width of the tape.

Carefully cut the openings with a sharp craft knife. If you're not using a paper box (for example plastic,
metal, or wood), you may need a drill with a step bit, rotary tool with cutoff wheel accessory, small
hacksaw, or other cutting tools appropriate for the material. If you're using a metal enclosure, line the inside
with adhesive vinyl, thick tape, or other insulating material, to prevent short circuits.

Solar Class: Page 46


Solar Class: Page 47
Connect Power Switch

My switch has a threaded plastic ring that will secure it to the enclosure, so I removed that first.

Tin and solder wires onto the leads of your power switch, and use heat shrink tubing to insulate the
connections.

Since my switch has an internal LED, I'm also wiring up a 220ohm resistor to one of the leads (doesn't
matter which), then a wire onto the opposite resistor lead. The LED is optional— you can leave it off or use
any on/off switch you like (such as a toggle, slide switch, or tactile on/off button).

This on/off switch must be installed from the exterior of the enclosure, and therefore must be installed
before we can solder the other ends of the wires to anything.

Insert the switch with wires through the opening in the enclosure, and thread the nut back onto the switch
and tighten it against the inside of the enclosure.

After the switch is in place, you can solder its wires to the various pins on the PowerBoost board as
described in the circuit diagram. The LED is connected to 5V (LED +) and GND (LED -), and the switch
leads are connected to EN and GND. To attach each wire, trim it a little longer than you think you'll need,
then strip off a bit of the insulation. Twist the wire strands together and lightly tin the wire so the strands
stay together. Insert the tinned end into the hole on the circuit board, and apply heat and solder to connect.
Trim the remaining wire end with flush snips, but be careful not to let bits of loose wire get stuck inside your
enclosure.

Solar Class: Page 48


Solar Class: Page 49
Secure Components Within Enclosure

Before securing the boards, let's test out the circuit! Plug your PowerBoost's JST pigtail cable into the
LOAD port on the solar charger, and your battery into the BATT port.

Toggle your power switch, and the PowerBoost's onboard LED should light up, as well as your power
switch LED if you have one. If yours doesn't, toggle the power back off, disconnect the battery, and double
check your wiring against the circuit diagram
(https://www.instructables.com/lesson/E68428DJ8AGP9LC/#step2), as well as the integrity of your solder
joints. Post a photo in the comments if you still can't get it to work after these troubleshooting steps.

Further check that plugging in a USB cable to the solar charger triggers the battery to start charging, as
indicated by the amber CHRG LED on the circuit board, as well as the red DCIN LED when power is
connected. Verify that the battery keeps charging even when you toggle off the PowerBoost's switch.
Rechargeable batteries usually ship charged, but if you're using a battery from a previous project or
unknown origin, you may need to let it charge for a while before use. When it's finished charging, the green
LED on the solar charging board will light up.

It's better to find any wiring mistakes or cold solder joints now, before attaching everything inside the
enclosure. After you're sure the circuit is working properly, use screws or double stick foam tape to secure
the circuit boards to the enclosure. I used double stick foam tape to hold the battery in place, too.

Solar Class: Page 50


Solar Class: Page 51
Power Up!

Close up your enclosure and take it outside on a sunny day! Plug in your solar panel with a DC barrel jack
adapter. The panel will charge up the battery and power the LOAD port at the same time, if it is getting
enough direct sunlight.

You can put it into charge-only mode by powering down the PowerBoost. Later when your phone's battery
is getting low, you can plug in and power it up.

Consider mounting your solar panel on your backpack to charge the battery while you're outside, or find a
sunny spot outside a window at home. Be careful if you decide to mount a solar panel to the roof of your
car (and consult a professional if you need help to mount it safely).

Make It Your Own

You may wish to extend or change the connector on your solar panel's wire. After all the soldering you
already did to get this far, splicing the cable is no big deal. If you have the extra time, go for it! There's a
step-by-step guide in the Solar Panels lesson
(https://www.instructables.com/preview/EHSVCYQJ8OR23XJ/#step3).

Solar Class: Page 52


You can expand the capacity of this charger by using a bigger battery, and speed up its charge rate with a
bigger 6V solar panel.

If your battery is above 1000mAh and you're using a big panel, you can increase the max charge rate of
the board by soldering a 2.2K resistor across PROG, as detailed in the official product guide
(https://learn.adafruit.com/usb-dc-and-solar-lipoly-charger/solar-charger-preparation?view=all#solar-
charger-preparation).

If you want to charge your battery unattended, it's smart to install the solar charger's optional thermistor.
First clip off the surface mount resistor inside the marking labeled THERM.

Trim the probe wires to an appropriate length to reach your battery inside your enclosure, then strip, tin,
and solder the wires to the holes marked THERM on the solar charger board.

Use tape to connect the probe to the surface of your battery. This prevents the device from charging while
the battery is too hot or too cold.

Solar Class: Page 53


I'd love to see your finished USB charger in the Class Project module below! Are you taking it to the
beach? Adding it to your hurricane kit? Tell us about your version and enclosure. Thanks for following
along!

Solar Class: Page 54


LESSON 5: SOLAR POWERING MICROCONTROLLER PROJECTS

https://vimeo.com/239367141

In this lesson, we're making a solar powered soil moisture monitor. It uses an ESP8266 wifi microcontroller
running low power code, and everything’s waterproof so it can be left outside. You can follow this recipe
exactly, or take from it the useful techniques for your own projects.

Solar Class: Page 55


Solar Class: Page 56
What You'll Need

You’ll need a solar battery charging board and ESP8266 breakout such as the NodeMCU ESP8266
(https://www.amazon.com/dp/B010O1G1ES/?tag=instructabl09-20) or Huzzah
(https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/), as well as a soil sensor, battery, power
switch, some wire, and an enclosure to put your circuit inside.

Here are the components and materials used for the soil moisture monitor:

ESP8266 NodeMCU (https://www.amazon.com/dp/B010O1G1ES/?tag=instructabl09-20) microcontroller (or

similar, Vin must tolerate up to 6V)

Adafruit solar charging board (https://www.adafruit.com/product/390) with optional thermistor

(https://www.adafruit.com/product/372) and 2.2K ohm resistor

2200mAh li-ion battery (https://www.adafruit.com/product/1781)

Perma-proto board (https://www.adafruit.com/product/1609)

Soil moisture/temperature sensor (https://www.adafruit.com/product/1298)


2 cable glands (https://www.adafruit.com/product/762)

Waterproof enclosure (https://www.adafruit.com/product/903)

Waterproof DC power cable pair (https://www.adafruit.com/product/743)

Heat shrink tubing (https://www.amazon.com/dp/B01MFA3OFA/?tag=instructabl09-20)

3.5W (https://www.adafruit.com/product/500) solar panel

Push button power switch (https://www.adafruit.com/product/1400)

Double stick foam tape (https://www.amazon.com/dp/B000789ANS/?tag=instructabl09-20)

Here are the tools you'll need:

Soldering iron (https://www.amazon.com/dp/B01DUPRXCE/?tag=instructabl09-20) and solder

(https://www.adafruit.com/product/145)

Helping hands tool (https://www.amazon.com/dp/B010C504NK/?tag=instructabl09-20)

Wire strippers (https://www.amazon.com/dp/B00FZPHMUG/?tag=instructabl09-20)

Flush snips (https://www.amazon.com/dp/B00FZPDG1K/?tag=instructabl09-20)

Tweezers (https://www.amazon.com/dp/B01HB46J8E/?tag=instructabl09-20) (optional)

Heat gun or lighter

Multimeter (https://www.amazon.com/dp/B0012VYKVQ/?tag=instructabl09-20) (optional but handy for

troubleshooting)

USB A-microB cable (https://www.amazon.com/dp/B0711PVX6Z/?tag=instructabl09-20)

Scissors (https://www.amazon.com/dp/B000P0LNRE/?tag=instructabl09-20)

Step drill (https://www.amazon.com/dp/B01DU3UWXI/?tag=instructabl09-20)

You'll need free accounts on cloud data sites io.adafruit.com (https://io.adafruit.com/) and IFTTT
(http://ifttt.com).

Solar Class: Page 57


Breadboard Prototype

It’s important to create a solderless breadboard prototype for projects like this, so you can make sure your
sensor and code are working before making any permanent connections.

Solar Class: Page 58


In this case, the soil sensor has stranded wires to it was necessary to temporarily attach solid headers to
the ends of the sensor wires using solder, helping hands, and some heat shrink tubing.

Solar Class: Page 59


Follow the circuit diagram to wire up the sensor's power, ground, clock, and data pins (data also gets a
10K pull-up resistor that comes with the soil sensor).

Sensor green wire to GND

Sensor red wire to 3.3V

Sensor yellow wire to NodeMCU pin D5 (GPIO 14)

Sensor blue wire to NodeMCU pin D6 (GPIO 12)


10K pull-up resistor between blue data pin and 3.3V

You can translate this to your preferred microcontroller. If you're using an Arduino Uno or similar, your
board is already supported by the Arduino software. If you're using the ESP8266, please check out my
Internet of Things Class (https://www.instructables.com/lesson/Software-Setup/) for step-by-step help
getting set up with ESP8266 in Arduino (by adding supplemental URLs to the Additional Boards Manager
URLs field in Arduino's preferences, then searching for and selecting new boards from the boards

Solar Class: Page 60


manager). I tend to use the Adafruit ESP8266 Huzzah board type to program the NodeMCU ESP8266
board, but you can also install and use the Generic ESP8266 board support. You'll also need the SiLabs
USB communications chip driver (https://www.silabs.com/products/development-tools/software/usb-to-
uart-bridge-vcp-drivers)(available for Mac/Windows/Linux).

To get the sensor up and running with my Arduino-compatible board, I downloaded the SHT1x Arduino
Library from Practical Arduino's github page (https://github.com/practicalarduino/SHT1x), then unzipped
the file and moved the library folder to my Arduino/libraries folder, then renamed it SHT1x. Open up the
example sketch ReadSHT1xValues and change the pin numbers to 12 (dataPin) and 14 (clockPin), or
copy the modified sketch here:

#include <SHT1x.h>
#define dataPin 12 // NodeMCU pin D6
#define clockPin 14 // NodeMCU pin D5
SHT1x sht1x(dataPin, clockPin); // instantiate SHT1x object

void setup()
{
Serial.begin(38400); // Open serial connection to report values to host
Serial.println("Starting up");
}
void loop()
{
float temp_c;
float temp_f;
float humidity;

temp_c = sht1x.readTemperatureC(); // Read values from the sensor


temp_f = sht1x.readTemperatureF();
humidity = sht1x.readHumidity();

Serial.print("Temperature: "); // Print the values to the serial port


Serial.print(temp_c, DEC);
Serial.print("C / ");
Serial.print(temp_f, DEC);
Serial.print("F. Humidity: ");
Serial.print(humidity);
Serial.println("%");

delay(2000);
}

Upload this code to your board and open up the serial monitor to see the sensor data stream in.

If your code won't compile and complains about SHT1x.h not being found, you haven't got the required
sensor library installed properly. Check your Arduino/libraries folder for one called SHT1x, and if it's
somewhere else, like your downloads folder, move it to your Arduino libraries folder, and rename if it
necessary.

If your code compiles but won't upload to your board, double check your board settings, be sure your board
is plugged in, and select the correct port from the Tools menu.

If your code uploads but your serial monitor input is unrecognizable, double check your baud rate matches
that specified in your sketch (38400 in this case).

If your serial monitor input doesn't seem correct, double check your wiring against the circuit diagram. Is
your 10K pull-up resistor in place between the data pin and 3.3V? Are data and clock connected to the
correct pins? Are power and ground connected as they should be throughout the circuit? Do not proceed
until this simple sketch is working!

The next step is specific to the ESP8266 and configures the optional wireless sensor reporting portion of
the sample project. If you're using a standard (non-wireless) Arduino-compatible microcontroller, continue
Solar Class: Page 61
to develop your final Arduino sketch and skip to Prepare Solar Charging Board
(https://www.instructables.com/preview/EDJV9EYJ8AGQ8B0/#step4).

Software Setup

To compile the code for this lesson's sample project with the ESP8266, you'll need to install a few more
Arduino libraries (available through the library manager):

Adafruit IO Arduino (https://github.com/adafruit/Adafruit_IO_Arduino)

Adafruit MQTT (https://github.com/adafruit/Adafruit_MQTT_Library)

ArduinoHttpClient (https://github.com/arduino-libraries/ArduinoHttpClient)

Download the code attached to this step


(https://cdn.instructables.com/ORIG/F6C/XVJN/J8YRIAJF/F6CXVJNJ8YRIAJF.zip), then unzip the file
and open up Solar_Powered_Soil_Moisture_Monitor_Tutorial in your Arduino software.

#include <SHT1x.h>
#include <ESP8266WiFi.h>
#include <AdafruitIO.h>
#include <Adafruit_MQTT.h>
#include <ArduinoHttpClient.h>

// Specify data and clock connections and instantiate SHT1x object


#define dataPin 12 // NodeMCU pin D6
#define clockPin 14 // NodeMCU pin D5
SHT1x sht1x(dataPin, clockPin);

// set up the feed


AdafruitIO_Feed *humidity = io.feed("humidity");
AdafruitIO_Feed *temperature = io.feed("temperature");

const int sleepTime = 15; // 15 minutes

void setup()
{
Serial.begin(115200); // Open serial connection to report values to host
Serial.println("Starting up");
// connect to io.adafruit.com
Serial.print("Connecting to Adafruit IO");
io.connect();

// wait for a connection


while(io.status() < AIO_CONNECTED) {
Serial.print(".");
delay(500);
}

// we are connected
Serial.println();
Serial.println(io.statusText());
}

Solar Class: Page 62


void loop()
{
io.run(); // io.run(); keeps the client connected and is required for all sketches.

float temp_c;
float temp_f;
float moisture;

temp_c = sht1x.readTemperatureC(); // Read values from the sensor


temp_f = sht1x.readTemperatureF();
moisture = sht1x.readHumidity();

Serial.print("Temperature: "); // Print the values to the serial port


Serial.print(temp_c, DEC);
Serial.print("C / ");
Serial.print(temp_f, DEC);
Serial.print("F. Humidity: ");
Serial.print(moisture);
Serial.println("%");

humidity->save(moisture);
temperature->save(temp_f);

Serial.println("ESP8266 is sleeping...");
ESP.deepSleep(sleepTime * 1000000 * 60); // Sleep
}

This code is a mashup of the sensor code from earlier in this lesson and a basic example from the cloud
data service Adafruit IO. The program enters low power mode and sleeps most of the time, but wakes up
every 15 minutes to read the temperature and humidity of the soil, and reports its data to Adafruit IO.
Navigate to the config.h tab and fill in your Adafruit IO username and key, as well as your local wifi network
name and password, then upload the code to your ESP8266 microcontroller.

You'll have to do a bit of prep on io.adafruit.com (https://io.adafruit.com/). After creating feeds for
temperature and humidity, you can create a dashboard for your monitor featuring a graph of the sensor
values and both incoming feeds' data. If you need a refresher on getting started with Adafruit IO, check out
this lesson in my Internet of Things Class (https://www.instructables.com/lesson/Circuit-Triggers-Internet-
Action/#step2).
Download (https://cdn.instructables.com/ORIG/F6C/XVJN/J8YRIAJF/F6CXVJNJ8YRIAJF.zip)
http://www.instructables.com/ORIG/F6C/XVJN/J8YRIAJF/F6CXVJNJ8YRIAJF.zip

(https://cdn.instructables.com/ORIG/F6C/XVJN/J8YRIAJF/F6CXVJNJ8YRIAJF.zip)

Solar Class: Page 63


Prepare Solar Charging Board

Prepare the solar charging board by soldering on its capacitor and some wires to the load output pads. I’m
customizing mine to charge at a faster rate with an optional add-on resistor (2.2K soldered across PROG)
and making it safer to leave unattended by replacing the surface mount resistor with a 10K thermistor
attached to the battery itself. This will limit charging to safe a temperature range. We covered these
modifications in more detail in the previous lesson
(https://www.instructables.com/lesson/E68428DJ8AGP9LC/#step10).

Solar Class: Page 64


Build Microcontroller Circuit

Solar Class: Page 65


Solder up the microcontroller board and power switch to a perma-proto board.

Connect the solar charger power output to the input of your switch, which should be rated for at least 1
amp.

Solar Class: Page 66


Create and solder the breadboard wire connections described in the circuit diagram above (or to your
personal version's specifications), including the 10K pull-up resistor on the sensor's data line.

The solar charger's Load pins will provide 3.7V battery power when no solar power exists, but will be
powered directly from the solar panel if it's plugged in and sunny. Therefore the microcontroller must be
able to tolerate a variety of voltages, as low as 3.7V and up to 6V DC. For those requiring 5V, a
PowerBoost (500 or 1000, depending on the current required) can be used to modulate the Load voltage to
5V (as shown in the previous lesson (https://www.instructables.com/lesson/E68428DJ8AGP9LC/)). Here
are some common boards and their input voltage ranges:

NodeMCU ESP8266 (used in this lesson): 5V USB or 3.7V-10V Vin

Arduino Uno: 5V USB or 7-12V Vin

Adafruit Huzzah ESP8266 Breakout: 5V USB or 3.4-6V VBat

In order to achieve the longest possible battery life, you should take some time to consider and optimize
the total current your current draws. The ESP8266 has a deep sleep feature which we used in the Arduino
sketch to reduce its power consumption dramatically. It wakes up to read the sensor and draws more
current while it connects to the network to report the sensor's value, then goes back to sleep for a specified
amount of time. If your microcontroller draws a lot of power and can't easily be made to sleep, consider
porting your project to a compatible board that draws less power. Drop a question in the Q&A; section
below if you need help identifying which board could be right for your project.
Solar Class: Page 67
Install Cable Glands

To make weatherproof entry points for the solar panel cable and sensor cable, we'll install two cable glands
into the side of the weatherproof enclosure.

Solar Class: Page 68


Test fit your components to identify the ideal placement, then mark and drill holes in a waterproof
enclosure using a step drill (https://www.amazon.com/dp/B01DU3UWXI/?tag=instructabl09-20). Install the
two cable glands.

Solar Class: Page 69


Complete Circuit Assembly

Insert the port side of a waterproof power cable into one and solder it to the solar charger’s DC input (red to
+ and black to -).

Solar Class: Page 70


Insert the soil sensor through the other gland, and connect it up to the perma-proto as per the circuit
diagram.

Solar Class: Page 71


Tape the thermistor probe to the battery. This will limit charging to a safe temperature range while the
project is left unattended outside.

Solar Class: Page 72


Charging while too hot or too cold could damage the battery or start a fire. Exposure to extreme
temperatures can cause damage and shorten the battery's life, so bring it inside if it's below freezing or
above 45 /113F.

Solar Class: Page 73


Tighten the cable glands to make a weatherproof seal around their respective cables.

Solar Class: Page 74


https://vimeo.com/239241131

Prepare Solar Panel

Follow the instructions from the Solar Panels Lesson to splice the cable
(https://www.instructables.com/lesson/EHSVCYQJ8OR23XJ/#step3) for your solar panel with the plug
side of the waterproof DC power cable set.

Solar Class: Page 75


Test It

Plug in your battery and turn on the circuit by pressing the power switch.

Solar Class: Page 76


Test it out and be sure it's reporting to the internet before closing up the enclosure and installing the sensor
in your herb garden, precious potted plant, or other soil within signal range of your wifi network.

Once the data from the sensor is being logged online, it’s easy to set up a recipe for email or text alerts on
the API gateway site If This Then That. I configured mine to email me if the soil moisture level drops below
50.

To test it without waiting for my plant to dry out, I manually entered a data point to my humidity feed on
Adafruit IO that fell below the threshold. A few moments later, the email arrives! If the soil's levels fall
below my specified level, I'll get an email every time the feed is updated until I water the soil. For my
sanity, I updated my code to sample the soil much less often than every 15 minutes.

Solar Class: Page 77


Solar Class: Page 78
Use It Outside!

This is a fun project to customize based on your plant’s hydration needs, and it’s easy to swap out or add
sensors or integrate the solar power features into your other Arduino projects.

Thank you so much for enrolling in my Solar Class! I'd love to see any solar project you build in the Class
Project section below, and to hear your feedback. If you liked this class, you may also enjoy:

LEDs & Lighting (https://www.instructables.com/class/LEDs-and-Lighting-Class/)

(https://www.instructables.com/class/LEDs-and-Lighting-Class/)Arduino

(https://www.instructables.com/class/Arduino-Class/)

3D Printing with Circuits (https://www.instructables.com/class/3D-Printing-With-Circuits-Class/)

Electronics (https://www.instructables.com/class/Electronics-Class/)

Internet of Things (https://www.instructables.com/class/Internet-of-Things-Class/)

Raspberry Pi (https://www.instructables.com/class/Raspberry-Pi-Class/)

Circuit Board Design (https://www.instructables.com/class/Circuit-Board-Design-Class/)

Rockets (https://www.instructables.com/class/Rockets-Class/)

Solar Class: Page 79

You might also like