Sofía Aritz dfc511f6da Remove note about Arduinos being already flashed
Both in YH4F 2024 and 38C3 the Arduinos had to be flashed on-site (and sometimes by the ones building the badge), so that comment doesn't apply anymore.
2024-12-31 22:57:34 +00:00
2023-10-09 21:19:02 +02:00
2024-10-29 09:36:54 +01:00

Badge

YH4F 2023 Badge w/ RGB colors

Hardware

The component list is very short:

  • Two parts of acryl glass
  • Arduino Nano-ish microcontroller
  • WS2812B LED strip
  • USB C cable
  • Some jumper wires
  • Screws with nuts

Assembly Instructions

Assembly Sketch

  1. Cut of a long enough part of the LED strip to match the acryl glass' long side. Always make a clean cut at the soldered joint points and try not to steal the next person's precious soldering space.
  2. Find the right end to start soldering: left of the leftmost right pointing arrow (). The direction of the addressed LEDs follows the arrow's direction.
  3. Cut some jumper wires in half to end up with three wires each with one "female" end and one open wire. Prepare your wire's ends by cutting them open and applying a bit of soldering paste on it.
  4. Solder three wires to your LED strip
    • one at the +5V connection for the voltage,
    • one at DIN for the data, and
    • one at GND for the ground connection.
  5. Connect the three wires to your microcontroller:
    • +5V goes to 5V,
    • DIN goes to D5, and
    • GND goes to GND (doesn't matter which one).
  6. Remove the film of the LED strip's back and stick it on one acryl glass.
  7. Lock your Arduino Nano in place, e.g., with some additional glue.
  8. Add the second acryl glass plate and tighten it with some screws.

Build The Example Software

Install PlatformIO

To compile and flash the software, PlatformIO will be used. Thus, start with installing PlatformIO if you haven't already done so.

There are multiple flavours of PlatformIO:

Install whatever you prefer most, this manual continues with PlatformIO Core.

Compile and Flash

The actual code resides in the ./src directory. For starters, a FastLED rainbow animation copied from their examples lies there.

To compile the code, use PlatformIO's command line tool pio:

$ pio run

If there are any errors, first try to read and understand them and finally fix them.

After your code compiles, connect the Arduino Nano with the USB C cable to your machine and flash the code.

$ pio run --target upload

If this fails, try to understand the error:

  • Maybe your board has an old bootloader and you need to change the upload_speed to 57600 in the platformio.ini file.

  • Maybe your user is not privileged enough, which can be fixed under Linux by the documented udev rules. Otherwise, try it again with evaluated privileges (add sudo) which, however, I don't want to recommend anyone.

Sometimes the microcontroller just doesn't feel like being flashed right now. Thus, give it a second try or reconnect it.

When you have successfully flashed your Arduino, the LED strip will be illuminated after an initial delay of three seconds.

Now it's up to you to hack the software for the better. As a first change, you might wanna alter NUM_LEDS to the amount of LEDs on your strip.

Description
Sketch and Code for an FSFE Badge
Readme 1.4 MiB
Languages
C++ 100%