Close
0%
0%

A DC27 CircuitPython Shitty Add-On V1.69BIS Totem

Use CircuitPython to control up to 4 Shitty Add-Ons (SAO) with the V1.69BIS "standard" connectors

Similar projects worth following
This is our "WeBadge" for DefCon 27. Its a Shitty Add-On Totem using the V1.69BIS "standard" supporting up to 4 add-ons all with I2C and GPIO support using CircuitPython 4.0. This means no drivers or compilers needed, just connect over USB and change the Python code to start messing with add-ons. In Python, you can power them on or off, even use the PulseIO library to PWM the power. Half of the GPIO pins support analog inputs and there's 2 shared i2c buses for the four connectors. There's some solder jumpers on the board too if you want to change a few of the hardware properties. You can close jumpers to always supply power to the add-ons or enable the I2C pull-up resistors. We're hoping this gives you a super easy way to configure and display a bunch of SAO bling. We've got a number to hand out, so ask if you see someone wearing it.

The basic BOM

  • (1) ‎ATSAMD21G18A
  • (4) 2x3 Female PIN Headers (Keyed preferred)
  • (12)  SUNLED LED 2PLCC SMD (‎XZM2CYK45WT)
  • (6) ‎BC817 NPN Transistor
  • (1) Micro-USB ‎10118194-0001LF
  • (1) Polulo 3.3V Step-Up Voltage Regulator U1V11F3
  • (1) PhotoResistor
  • (2) AA Batteries

XZM2CYK45WT.kicad_mod

Kicad Footprint for SunLED bottom entry LEDs (XZM2CYK45WT)

kicad_mod - 1.07 kB - 07/05/2019 at 16:15

Download

  • Badges in Vegas, Challenge on boards

    Corey Benn08/08/2019 at 04:49 0 comments

    DefCon is here! And so are most of the badges. Nothing like a little last minute hotel room soldering sessions to help justify the TS80 purchase and finish off some of the boards that didn't survive the journey. We're starting to hand these out at the conference. If you see anyone walking around with these before Friday night, ask how they got one. 

    I'm also excited to see who solves the challenge first. We might post some hints later, but this is a great time to brush up on your CircuitPython basics. I'm pretty sure dis wont work correctly for CircuitPython code, but there's other ways around that issue :-)

  • Bend a Pin for VDDCore

    Corey Benn07/18/2019 at 04:25 0 comments

    That pin is meant to be bent. For those of you that get one of these badges, you might look really close at the microcontroller. You might wonder "hum, that pin doesn't look like its touching anything"... and you'd be right. That's the pin for VDDCore and if it touches the 3.3 volt trace below it, your badge will not have a good time over USB. It still should power up via battery and you can still flash the chip over the debug connector. However, trying to edit the CircuitPython code via the mounted USB drive will either show up as an unknown device or lock up while editing files.

    How did we get here? So it seems I copied the initial schematic from our previous CircuitPython badge design we used at the local makerspace. This was before my friend Bill noticed our mistake of tying all the VDD lines together. Apparently VDDCore is not like all the other VDD lines on the SAMD21 and has an internal regulator to drop it to 1.2 volts instead of the 3.3 volts. He fixed this on our previous boards because he's a good person and actually reads the datasheet before ordering PCBs. But this should have been caught in the one run of prototype boards for this project... except with my totally professional hand soldering skills, it turns out I missed soldering just that one pin. Everything worked out fine on the prototype board, so I just made my other changes and ordered the final 100 boards.

    Fortunately it seems for what we're doing, everything works fine if that pin is left disconnected. Normally I'd try to cut the trace on the PCB, except for that trace is really short and very close to traces that are needed. It was much faster and more reliable to just bend that pin up so that it doesn't make contact with the pad. Plus if you want to match the datasheet, you could get a 0402 cap in there between the bent pin and the ground pin right next to it... maybe that the solution for Challenge #2... or maybe I just need to RTFM. I'm sensing a trend here.

  • RTFM, always RTFM

    Corey Benn07/11/2019 at 04:28 0 comments

    I've heard stories about always double checking the data sheets and never assuming anything... well it bit my butt this time. I'm mainly using Yellow SunLED 3.2x2.8mm PLCC2 SMD LED for the badges, but figured I'd do one with their Blue LED instead for a special one off. Realized the forward voltage would be a bit different and adjusted my resistors for that, but didn't double check the polarity mark on them. Cause ... what sort of Monster would switch the polarity mark for the same LED casing from the same manufacture??? when the only difference is the LED color??? 

    After trouble shooting reflow connections for a half hour, popped up the datasheets. Yup, for Yellow LEDs the polarity mark is on the anode, but for Blue LEDs it's on the cathode. Enjoy.

    So sorry about the footprint model here if you're not using the Yellow SunLED PLCC2 LEDs. For the "XZFBB45S" you'll want to flip that polarity dot around. RTFM MF. RTFM 4ver.

  • Lessons Learned - KiCad Footprints and I2C "invalid pins"

    Corey Benn07/05/2019 at 16:23 0 comments

    While saving a lot of details for DefCon, wanted to document a few of the issue we've had in the prototyping stage (still waiting on the final batch of PCBs which we're reflowing/assembling ourselves... we still have like 4 weeks until heading to Vegas right?)

    The LEDs

    It was my first time looking for and using "Bottom Entry" LEDs which shine through the PCB. Looking at other badges, the SunLED SMD LEDs (XZM2CYK45WT) seemed a popular choice. Also first time doing an area of the PCB which should have no copper, mask, or silk-screen on either side, so was great to find a footprint layout on the KiCad forum.

    https://forum.kicad.info/t/how-to-make-no-copper-no-mask-complex-shape/11651/13

    This worked well for hand soldering, but has a very narrow window on how the LED can be positioned to reach both pads. Then when reflowing, I noticed a number of them being pulled all the way to one pad and sometimes connecting to the copper around the keep-out area during the reflow (did I mention it's a home built toaster oven?). Since I'm not using any filled zones around these LEDs, I dropped the copper around there and moved the pads a little closer while shrinking their total size. This might make it a little harder for hand-soldering, but getting much better results from the reflow. Also included the polarization dot in the silk-screen (lets just make this easy to remember during the light night last minute assembly)

    Here's my updated footprint for Kicad XZM2CYK45WT.kicad_mod 

    (module "XZM2CYK45WT" (layer F.Cu) (tedit 5D1D1705)
      (fp_text reference "D2" (at 0 -3.2) (layer B.SilkS)
        (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
      )
      (fp_text value "LED" (at -1 -3) (layer B.Fab)
        (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
      )
      (fp_poly (pts (xy -1 1.75) (xy 1 1.75) (xy 1.75 0.75) (xy 1.75 -0.75)
        (xy 1 -1.75) (xy -1 -1.75) (xy -1.75 -0.75) (xy -1.75 0.75)) (layer B.Mask) (width 0.15))
      (fp_line (start 0.575 2.825) (end 0.575 4.125) (layer B.SilkS) (width 0.25))
      (fp_line (start -0.325 2.825) (end -0.325 4.025) (layer B.SilkS) (width 0.25))
      (fp_line (start -0.325 4.025) (end 0.475 3.425) (layer B.SilkS) (width 0.25))
      (fp_line (start 0.475 3.425) (end -0.325 2.825) (layer B.SilkS) (width 0.25))
      (fp_text user "." (at -1.016 2.286) (layer B.SilkS)
        (effects (font (size 1.5 1.5) (thickness 0.15)))
      )
      (pad "2" smd rect (at -2.5 0) (size 1.1 2.6) (layers "B.Cu" "B.Paste" "B.SilkS" "B.Mask"))
      (pad "1" smd rect (at 2.5 0) (size 1.1 2.6) (layers "B.Cu" "B.Paste" "B.SilkS" "B.Mask"))
    )

    All The I2C's

    We thought it would be bad-ass to have full support for all the pins on the SAO's connectors, even though few of them make use of anything other than power and ground. We also though it would be great if we could support turning an Add-On on or off via code. Routing though quickly became an issue as this was just a 2 layer board and we wanted to keep traces off from the front layer (its just a big pretty ground plane... you can barely notice the vias). So a small compromise is that are two shared i2c buses, instead of each connector getting its own. In the end, we're routing 32 of the 44 SAMD21 pins with just two 0 Ohms resistors (cheating a little there, but for me, that was a cool accomplishment).

    Here's the rub, while the SAMD21 supports a number SERCOMs accross different pins, for I2C there are "fixed" pads. So the SDA line can only be on a PAD 0 and a SCL line only on a PAD 1. CircuitPython is great about throwing an "Invalid pins" message when you screw this up like I did on the prototype boards. Adafruit again goes into the details in this blog post which I probably should have fully read first.

View all 4 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates