HackerBox 0041: CircuitPython

by HackerBoxes in Circuits > Microcontrollers

10453 Views, 13 Favorites, 0 Comments

HackerBox 0041: CircuitPython

WholeBoxInstruct0041.png

Greetings to HackerBox Hackers around the world. HackerBox 0041 brings us CircuitPython, MakeCode Arcade, the Atari Punk Console, and much more. This Instructable contains information for getting started with HackerBox 0041, which can be purchased here while supplies last. If you would like to receive a HackerBox like this right in your mailbox each month, please subscribe at HackerBoxes.com and join the revolution!

Topics and Learning Objectives for HackerBox 0041:

  • Exploring the SAMD51 ARM Cortex M4
  • Embedded programming with CircuitPython
  • Retro game design for MakeCode Arcade
  • Assembling the Atari Punk Console Synth

HackerBoxes is the monthly subscription box service for DIY electronics and computer technology. We are hobbyists, makers, and experimenters. We are the dreamers of dreams.

HACK THE PLANET

Content List for HackerBox 0041

HackerBox 0041 CircuitPython
  • Adafruit ItsyBitsy M4 Express
  • Exclusive MakeCode Arcade PCB
  • Exclusive Atari Punk Console PCB
  • Two Electronic Component Packs
  • Color Display 128x160 Pixel TFT
  • CR2032 Coin Cell Five Pack
  • RGB 12 LED Ring Module
  • SG90 Micro Servo Motor
  • 400 Point Clear Breadboard
  • DuPont Jumper Wires Male-Male
  • Braided MicroUSB Cable
  • Exclusive Circuit Python Decal
  • Exclusive HackerBox Maker Decal
  • Exclusive HackerBox Iron-On Patch

Some other things that will be helpful:

  • Soldering iron, solder, and basic soldering tools
  • Computer for running software tools

Most importantly, you will need a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.

There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we really appreciate your taking a few minutes to read the FAQ.

Electronic Component Packs

Components.png

Familiarize yourself with the components shown here. Note the suggested allocation of these components according to the color coded blocks.

HackerBox 0041 includes these components packed in two resealable poly bags. Please note the components are only separated into two bags for ease of packaging and there is no meaning to the placement of the components into one or the other of the two bags.

Adafruit ItsyBitsy M4 Express

Itsy Bitsy M4 Inst.png

The Adafruit ItsyBitsy M4 Express features the Microchip ATSAMD51 ARM Cortex M4 (datasheet) processor running at 120 MHz. The microcontroller has floating point support, 512KB Flash, and 192KB RAM.

While the ItsyBitsy M4 can be used with the Arduino IDE, it ships with CircuitPython on board. When you plug it in, it will show up as a small disk drive with main.py on it. Edit main.py with your favorite text editor to build your project using Python, the most popular programming language. No installs, IDE or compiler needed, so you can use it on any computer, even ChromeBooks or computers you can't install software on.

CircuitPython

CircPyth Inst.png

CircuitPython is a programming language designed to simplify experimenting and learning to program on low-cost microcontroller boards. CircuitPython is an open source derivative of the MicroPython programming language. It is a software implementation of the Python 3 programming language and has been ported to run on several modern microcontrollers. (see Wikipedia)

The Adafruit Welcome to CircuitPython page is the best starting point.

The solderless breadboard, jumper wires, and various other items from HackerBox 0041 are useful while working through to the Adafruit CircuitPython Essentials demo experiments.

MakeCode Arcade

Arcade Inst.png

MakeCode Arcade is a web-based, beginner-friendly platform for creating retro arcade games for the web and for microcontrollers. Using the exclusive HackerBox MakeCode Arcade PCB, the Adafruit ItsyBitsy M4 Express, a color TFT display, and seven pushbuttons, you can assemble your own handheld MakeCode Arcade platform.

ASSEMBLY NOTES: Start with the PCB side including the text "ItsyBitsy" in the silkscreen facing up. All of the components go on this side of the PCB. There is a piezo buzzer in the PCB design wired to the ItsyBitsy. However, support for that output doesn't appear to be implemented in the Arcade code yet, so soldering the buzzer on is optional at this time. The 40pin female header can be broken down into two 14 pin sections to create a "socket" for the ItsyBitsy. Socketing the ItsyBitsy supports popping the module on and off of the Arcade PCB and the solderless breadboard as necessary for various projects. Of course, if you end up using both platforms for the ItsyBitsy with much frequency, you might want to pick up another ItsyBitsy and solder it directly to the Arcade PCB.

PROGRAMMING: See the details on MakeCode Arcade for the SAMD51.

Battery Power for the MakeCode Arcade PCB

LiPo Inst.png

By default, the MakeCode Arcade PCB is powered through the microUSB port on the ItsyBitsy. USB power can be provided by a computer USB port, a wall wart, etc.

For a portable Arcade platform, the USB port can be powered using a USB power bank. Optionally, a clean solution for integrating LiPo battery power is the Adafruit LiIon/LiPoly Backpack shown in the photo. This backpack can be combined with a LiPo Battery and optionally an on/off button. Note from the photo that the LiPo Backpack can be neatly positioned on the backside of the arcade PCB. It helps to leave the relevant three pins of the ItsyBitsy if you plan to trim the other pins off after soldering.

Atari Punk Console Badge

Atari Punk Inst.png

The Atari Punk Console is a popular circuit that utilizes two 555 timer ICs or a single 556 dual timer IC. The original circuit was published in a Radio Shack booklet in 1980. Its designer, Forrest M. Mims III, called the circuit a "Stepped Tone Generator" in his booklet "Engineer's Mini-Notebook - 555 Circuits".

The circuit is often called the "Atari Punk Console" because its "low-fi" sounds resemble classic Atari console games from the 1980s, with a square wave output similar to the Atari 2600. Technically it is an astable square wave oscillator driving a monostable oscillator that creates a single (square) pulse.

ASSEMBLY NOTES:

  • Two coin cell clips go on the back of the board
  • All other components go on the front of the board
  • Tin all three pads for each clip to ensure good contact with the coin cell
  • A 1K resistor R2 is located just below the IC
  • The DIP switches control power to the oscillators and the LEDs separately
  • C1 and C2 are 0.1uF Caps
  • C3 is a 10uF Cap
  • For all three caps, mind the polarity marking on the board by placing the longer pin towards the + mark
  • For the clear, self-flashing LEDs the shorter pin goes in the hole near the flat edge of the board circle
  • There is a + mark on the PCB for the speaker
  • The IC (and its socket) should be oriented according to the half-circle marking on the board
  • Solder the IC socket without the chip in and then put the IC in the socket once cool
  • The 1Mohm potentiometers are marked "B105" on the bottom. In some versions of the parts kit, 500Kohm potentiometers are provided instead. These are marked "B504".
  • The 5Kohm potentiometer is marked "B502". In some versions of the parts kit, a 1Kohm potentiometer is provided instead. It is marked "B102".

Wikipedia Atari Punk Console Page

Jameco Electronics Atari Punk Console Page

Livin' the HackLife

Patch Signoff.png

We hope you have enjoyed this month's voyage into DIY electronics. Reach out and share your success in the comments below or on the HackerBoxes Facebook Group. Certainly let us know if you have any questions or need some help with anything.

Join the revolution. Live the HackLife. You can get a cool box of hackable electronics and computer tech projects delivered right to your mailbox each month. Just surf over to HackerBoxes.com and subscribe to the monthly HackerBox service.