1 of 31

ELECTRONICS 201 FOR COSPLAY: PROGRAMMABLE, INTERACTABLE, AND SMART WEARABLES

Emily Anthony

Magfest 2024

2 of 31

Introduction

MS Mechatronic Systems Engineering

BS Mechanical Engineering

Masters Level Cosplayer competing at international competitions at the Crown Championship of Cosplay and International Cosplay League

Swadge team at MAGfest

Arcade staff

3 of 31

EXAMPLES OF MY WORK

4 of 31

Reminders before we get started

  • Please do not interrupt the panelist – raise your hand
  • I am proficient but I am not omniscient
  • This panel will not make you an expert after 1hr

5 of 31

Agenda

  • Safety
  • Microcontrollers
  • Signal Interfaces
  • Lights
  • Sound
  • Screens
  • Recommended Resources

6 of 31

SAFETY

Because we love you. You deserve to be safe and fulfilled in this hobby

7 of 31

Safety: Electronics Hurt ☹

  • The human body conducts electricity!
  • Electronics can:
    • Burn your skin
    • Burn your retinas
    • Vaporize your hair
    • Cause internal issue damage
    • Cause interference with your heart
    • Kill you
  • “Voltage hurts, amperage kills” … well, not really. You need a lot of at least one, and both is deadly.
  • ALWAYS use isolating techniques to protect yourself when working with electronics, such as commercial power adapters which transform AC wall voltage into safe, low voltage DC power or simply UNPLUG IT

8 of 31

Safety: Electronics Hurt ☹

  • Batteries can:
    • Burn you
    • Explode
    • Leak nasty chemicals
  • To be safe with batteries:
    • Isolate your + and – terminals to avoid loose wires, metal, or your body touching both
    • Use commercial USB lithium power bricks
    • Make a hard case for loose lithium pouches to avoid puncture
    • Do not over-charge or over-discharge lithium batteries
    • Take your batteries out of your costume when not in use

9 of 31

Safety: PPE (Personal Protection Equipment)

  • When working with electronics, always wear:
    • Eye protection
    • When soldering or melting plastic, a mask
    • Consider an anti-static bracelet and grounding cable
  • Consider buying:
    • Non-leaded solder
    • Air filters with carbon filters to run next to your solder station
    • Rubber gloves
  • Know where these things are:
    • Fire extinguisher or other fire suppression items

10 of 31

What is a microcontroller?

  • A microcontroller is an advanced component that is used in an electrical device and is programmed to perform a task
  • It is placed on a printed circuit board with auxiliary circuits for signal processing, voltage regulation, and more
  • Microcontrollers are used in many devices from Arduino to the smart thermostat in your house and in cars, planes, and heavy machinery
  • Items like Arduinos are known as “dev boards” and integrate a microcontroller with other functional devices for hobby and prototyping

11 of 31

Microcontroller types

ESP32

    • Massively popular, high performance
    • Its on the swadge!

SAMD21 M0

    • Common in Adafruit products

ATMEGA 328

    • The brain of the Arduino Uno

… and many, many more

    • Pic32
    • ESP8266
    • RISC-V
    • Etc etc etc

12 of 31

Brand versus Brain

Brands

    • Brains

Arduino

    • ATMEGA
    • ESP32

Adafruit

    • Arm Cortex M4, M0
    • ESP32 and ESP8266

SeeedStudio

    • ESP32
    • Arm Cortex M4

Raspberry Pi

    • Arm Cortex M0
    • ESP32

Sparkfun

    • ATMEGA
    • ESP32

13 of 31

Boards can come in many shapes and sizes

14 of 31

Signal Types

  • Digital Signal – for simple communication
    • PWM
    • On/Off
  • Digital Data – for communicating complicated information
    • I2C
    • SPI
    • I2S

15 of 31

PWM

  • Pulse-Width-Modulation sends pulses of voltage
  • The more frequent the pulses, the higher the average voltage
  • Used for controlling items which can be variable in speed, brightness, etc such as LEDS and motors. Can also generate sounds – this is how the swadge makes noise

16 of 31

I2C

  • I2C is a slow, two wire (SDA and SCL) communication protocol for two devices to communicate with each other
  • I2C is very versatile and is used with a lot of peripherals such as screens, motion sensors, GPS boards, motor drivers… basically anything that would want to communicate information

17 of 31

SPI

  • 4 wire SPI is a faster communication protocol
  • Good for high data rate applications, such as controlling full color displays and communicating camera image data

18 of 31

I2S

  • 3 wire communication interface for transmission of sound data only
  • Isn’t used much, but you may encounter it if you want to make sound effects!
  • Very similar to I2C, it was developed by the same company and released around the same time

19 of 31

Selecting A Microcontroller and Board for your project

  • Power - what kind of battery do I need? How do I connect it?
  • Speed – how much processing is it doing? Do I have enough memory?
  • Communications – I2C, SPI, digital signals.. How many are required?
  • Programming – is it supported in an environment I know? Are there examples and libraries available?

20 of 31

Not all dev boards are created equal

  • The Adafruit “Trinket” has 8k of flash memory for programming, has a USB input for power (or soldered connections), and has 5 IO pins
  • The Adafruit “Feather ESP32” has 8M of flash memory, USB or a plug for a battery, and has over 20 IO pins
  • Both have I2S and SPI
  • The Feather is “better” but the Trinket can be more than enough for your project

21 of 31

Lights

  • Non Programmable
  • Lamps
  • Fairy Lights
  • “LED Noodles”
  • EL Wire
  • Programmable
  • NeoPixels
  • DotStars

22 of 31

Non Programmable lights

  • Some, usually single LEDs, can be dimmed or blinked with a PWM digital signal
  • Strips of LEDs, EL wire, and fairy lights usually have their own power source
  • Usually do not need an Arduino or similar to integrate into a cosplay

23 of 31

Programmable Lights

  • “Addressable” LEDs can be communicated with using a single or dual wire data connection. Each LED can have a different color and brightness
  • Brand Names include:
    • NeoPixel
    • DotStar
  • Have many form factors, from single lamps to strips and more
  • These require an Arduino or similar to control. Some programming required

24 of 31

Picking your light

  • Do I need one light or many?
  • EL Wire/panels requires a high-frequency driver and special power requirements
  • Fairy lights are generally hard to modify and cut, unlike strips or single LEDs

25 of 31

Sound

  • Sound is usually integrated into cosplays with “breakout boards”
  • Considerations for sound:
    • How am I storing the sound files?
    • How loud does it have to be?
    • Do I need a microphone?
    • Does the sound have a trigger or is it continuous?
    • Am I playing sound over PWM or I2S?

26 of 31

Sound – selecting an amplifier

  • Most amplifiers for this application are “Class D” pre-built breakouts
  • The breakout boards will specify the wattage – 1W, 2W, etc
  • Some have adjustable “gain”, which determines the volume and range of volume
  • Some have more than one output for stereo sound
  • Some support I2S, some only support PWM

27 of 31

Sound – selecting a speaker

  • Speakers are specified in Wattage and Impedance
    • Please don’t put 10W of power into a 1W speaker ☹
    • Lower impedance = higher quality speaker

28 of 31

Screens

  • Character LCD
    • Older type of display
    • Low resolution
    • I2C
  • OLED
    • Usually one or a few colors
    • Most dev boards can handle this
    • I2C or SPI
  • TFT LCD
    • Highest power requirements
    • Full color
    • Touch screen compatible
    • SPI
  • Segment displays
    • Easy to integrate

29 of 31

How to choose a screen

  • What do I need it to do?
  • How much space do I have?
  • Do I need I2C or SPI?

30 of 31

Resources

  • Please check under your seat for a post it
    • Make It, Wear It: Wearable Electronics for Makers, Crafters, and Cosplayers
    • Fabric and Fiber Inventions: Sew, Knit, Print, and Electrify Your Own Designs to Wear, Use, and Play With
    • Make: Wearable Electronics: Design, prototype, and wear your own interactive garments
  • Adafruit.com and sparkfun.com
  • Cosplay Help and Advice group on Facebook
  • Contact me! Emily.Anthony@magfest.org

31 of 31

Please consider attending my other events this weekend

Date

Start Time

End Time

Activity / Panel

Location (Room)

Thursday, January 18

6:00 PM

7:00 PM

Electronics 101 for Cosplay: Safety, Vocabulary, and Good Practices of Wearable Electronics

Makerspace Classroom (Eastern Shore 1)

Friday, January 19

3:30 PM

5:30 PM

Super Cosplay Contest (Judge)

Panels 2 (Woodrow Wilson Ballroom A)

Friday, January 19

7:30 PM

8:30 PM

YNG SLLVN Presents: Taskmaster!

Panels 2 (Woodrow Wilson Ballroom A)

Saturday, January 20

10:00 AM

11:30 AM

Soldering Workshop

Makerspace Classroom (Eastern Shore 1)

Saturday, January 20

5:30 PM

6:30 PM

Electronics 201 for Cosplay: Programmable, Interactable, and Smart Wearables

Makerspace Classroom (Eastern Shore 1)

Sunday, January 21

11:30 AM

12:30 PM

The Cardinal Sins I've made with my 3D printers for Cosplay

Makerspace Classroom (Eastern Shore 1)