Output Devices

For this assignment, I decided to use my project PCB board, which is also the one I made during the electronics design week. Since project focuses more on programming and some electronics, I wanted to concentrate on the functionality and behavior of a Neopixel as an output device. Therefore, I will use a button to change different patterns, movements, colors, etc., when is pressed.

PCB

As I mentioned earlier, I will use the board from my previous design, which has an integrated ESP32S3. The board has traces where the common ground passes and headers with 5V outputs to connect the strip. The data pin chosen is port D5.

This will be the board we use. It has a button that interacts with a strip of 8 LEDs.

Neopixel

What are Neopixels?

Neopixels are individually addressable RGB LEDs developed by Adafruit. Each LED contains a microcontroller that allows independent control of the color and intensity of each LED on the strip. This means you can create complex lighting effects with a simple digital signal.

What do Neopixels do?

Neopixels can produce a wide range of colors by mixing the three basic colors: red, green, and blue (RGB). With the ability to control each LED separately, you can create animated light patterns, color-changing effects, and visual responses to different inputs. They are widely used in art projects, decorative lighting, costumes, and interactive devices.

Power Consumption

The power consumption of Neopixels varies depending on the color and intensity of the LEDs. On average:

  • Each LED consumes approximately 60 mA when at full intensity in white color (all colors at maximum brightness).
  • In individual colors (red, green, or blue), the current consumption is lower, around 20 mA per LED.
  • For example, a strip of 8 LEDs will consume about 480 mA in total when all LEDs are in white at maximum intensity.
Configuration Current per LED (mA) Total Current (8 LEDs) (mA)
All in red 20 160
All in green 20 160
All in blue 20 160
All in white 60 480

I tested turning the NeoPixel strip red, and it seems my laptop's power supply is sufficient. Holding the button turns off the lights.

Examples

Changing Patron Rainbow

As a first example in discovering the functioning and programming, I wanted to experiment by creating a pattern that changes the position of the LED lights. To maintain the rainbow colors, there is a function in Arduino called Rainbow that lights up the LEDs with rainbow colors.

Code

Video

Traffic light

For this example, I wanted to replicate the idea of a traffic light. When you press the button, the sequence will start. The idea is that it first lights up in green, waits for 3 seconds, switches to yellow, waits for 3 seconds, and then switches to red. Pressing the button again will restart the traffic light cycle.

Code

Video