Introduction: Arduino Halloween Pumpkin

Hi it's me Captain Arghuino! Let's continue from where we left off last week with our lesson on transistors and let's make a nightlight or a colorful pumpkin for Halloween. Follow Leddy and Darling as they explain how you can use transistors to amplify the current necessary to power RGB LED strips. These LED strips are very cool and you can use them in all kinds of projects.

In our first lesson you learned how transistors can amplify a small current entering the base and have the flow between the collector and emitter be much larger. In order to control powerful LEDs like the LED strips, you need to add transistors between your microcontroller and the LEDs.

You will need for this project:

  • 1 Arduino board
  • 1 Arduino prototype shield (or a custom RGB LED shield)
  • 3 NPN transistors (i.e. 2N3904)
  • 3 4K7 Ohms resistors
  • 3 5V RGB LED strips
  • Wooden lamp structure (optional)
  • 1 pumpkin
  • 1 AC Arduino Adapter

This lesson is an extract of Volume 7 of the Island of PodPi, a series of adventures in learning STEM. The first comic book series on teaching kids JavaScript and Electronics.

Step 1: Why Do I Need Transistors?

Using your Arduino board, you can control all sorts of components from LEDs, sensors and servo motors. However, your board can only supply a maximum of 40mA per pin and a total of 400mA per board. While this may be enough for a few LEDs for testing and learning, it is not powerful enough to control a full LED strip.

Depending on the strip you use each LED may add 15mA to 20mA. If you have a strip with 8 LED, this can amount to 160mA, way above what the Arduino is able to produce per digital pins.

Why is that? The Arduino digital pins are not designed to power components. They are designed to receive and send digital signals with low current at fast speeds. Transistors or other power devices are then used to interface the microcontroller with components that consume larger amounts of current.

Order a few transistors. They always come in handy.

Step 2: How Do I Connect My Transistors?

Refer to our previous Instructable on how to setup your very first transistor. In the picture above Darling provides you with the schematic (the logical connections) and the physical layout of the components of the Arduino prototype shield.

Each color in the RGB strip (Red, Green and Blue) will have its own channel. That is, each transistor will power a single color with multiple LEDs. In this configuration, we decided to use 5V LED strips to avoid using a separate power supply. Some LED strips come in configurations of 6V and 12V. These strips required an external power supply to power the LEDs. For our project, the 5V work very well.

Access the high-resolution comic here.

Step 3: Let's Connect the RGB Strip

It's now time to connect the RGB strip to our breadboard. Now you can test each color by holding the wires going to the base of the transistors and the 5V power supply. Each transistor will amplify the current enough that you can control each color with just your fingers. Try it out, it's fun! (Use the same concept as the High-Five Instructable)

Access the high-resolution comic here.

Step 4: Connect Your Arduino Digital Pins

Now, it's time to connect the transistor bases to the the Arduino digital pins. This will allow you to control each color using the Arduino software. We will use pins 9, 10 and 11. These pins are PWM enabled. PWM allows you to pulse the colors to make smooth transitions. In this step, add a 4K7 Ohms resistors to each transistor base and connect the other side to one of the digital pins.

Access the high-resolution comic here.

Step 5: What Is an Arduino Shield?

An Arduino shield is a custom electronic board that connects on top of the Arduino to provide custom functionality. In this Instructable, the RGB LED shield already has the transistors, resistors and connections to the digital pins so that you can use your Arduino board as a nightlight or as a light source for your Halloween pumpkins.

Access the high-resolution comic here.

If you want to solder your own boards, Captain Arghuino shared the design on OshPark.

If you want to order a complete kit including the Arduino, you can find it in my stash.

Step 6: (Optional) Add the Lamp Structure

Assemble the lamp structure (optional) if you want to use it as a nightlight. For your pumpkins, you can use it or skip this step.

Access the high-resolution comic here.

Step 7: Program Your Lamp

It's now time to program you lamp. We suggest using the code attached from Clay Shirky.

For questions, visit Captain Arghuino at http://www.podpi.com

Step 8:

Comments

author
ZIGMA44 made it! (author)2016-10-24

Hey people of /Ins/ I have a question, Please reply. If you can only download instructables like this in pdf format ( when you're a pro member only), then why There vast of websites that offers converting webpages into various formats, say a pdf format, not to mention we've got a legal sofware "HTTrack" that save the full website for offline viewing. ??

1.)Is it legal to download into pdf format even though you are a Pleb?

2.) Does the developer of Ins knows this? I mean it's Like Youtube with her Youtube Pirates, it makes no sense buying something you can get for free.