Skip to content

A/B Day LED Sign

Description

This project is a simple LED sign that displays whether it is an A day or B day. It is designed to be used in a school setting to help students remember which day it is. The sign is controlled by an ESP32-WROOM-32E and uses a 8x8 RGB LED color matrix display.

Student Info

Alvera Syed

  • 2024-25

Parts List

  • ESP32-WROOM-32E
  • 8x8 RGB LED Matrix Display

Technologies Used

  • MicroPython
  • WIFI
    • To get the current day of the week
  • Claude.ai (3.5 Sonnet)

Code

python
import machine
import neopixel
import time
import urequests

# Set up the neopixel
np = neopixel.NeoPixel(machine.Pin(4), 64)

# Get the current day of the week
response = urequests.get('http://worldclockapi.com/api/json/est/now')
day = response.json()['dayOfTheWeek']

# Set the color based on the day of the week
if day == 'Monday':
    color = (255, 0, 0)
elif day == 'Tuesday':
    color = (0, 255, 0)
elif day == 'Wednesday':
    color = (0, 0, 255)
elif day == 'Thursday':
    color = (255, 255, 0)
elif day == 'Friday':
    color = (255, 0, 255)
elif day == 'Saturday':
    color = (0, 255, 255)
elif day == 'Sunday':
    color = (255, 255, 255)

# Set the color of the neopixel
for i in range(64):
    np[i] = color
np.write()

Libraries Used

  • neopixel - for the LED display
  • urequests - for the worldclockapi
  • machine - for the ESP32-WROOM-32E
  • time - for the delay

Top 3 Challenges

  1. Getting the ESP32-WROOM-32E to connect to the WIFI and get the current day of the week. I had to use the urequests library to make a request to the worldclockapi to get the current day of the week.
  2. Setting up the neopixel library to control the LED display. It wasn't filling in the correct pixels at first, but I was able to fix it by changing the range of the for loop.
  3. Having to use ChatGPT instead of Claude.ai to generate code at the end. ChatGPT struggles at quality code generation.