Skip to content
Nick Poole edited this page Aug 5, 2022 · 5 revisions

Building Your Own BeanCounter

Building your own BeanCounter breaks down into the following steps: Get PCBs, Get a Printed Chassis, Populate the PCB, Final Assembly, and Programming.

Get PCBs

You can find the Eagle design files for the PCBs in the hardware directory of this repo. Because the two boards are combined in one Eagle design for reference, you won't be able to generate production files directly from this Eagle board file. You'll need to either separate the two boards or you can use the production Gerber files in the production subdirectory which contain panelized parts for two BeanCounters. I recommend the second option, because it's always good to have backup PCBs. There are a wide variety of PCB manufacturers available for your consideration, but we've partnered with PCBWay for the Crowd Supply campaign fulfillment.

Get a Printed Chassis

The 3D Printed portion of the BeanCounter can be SLA printed from any resin that isn't transparent. The darker and more opaque that you can make this part, the better the display contrast will be. You can find the Fusion 360 design files as well as various mesh file formats ready for printing in the hardware/cad directory of this repo. If you don't have access to an SLA printer, you can order prints from a variety of online services. We've partnered with Wenext for the Crowd Supply campaign fulfillment.

Populate the PCB

You should reference the Eagle design files while assembling the PCB, but I've also prepared an Assembly Sheet for easy reference. You can find the assembly sheet in the docs directory of this repo. If you have experience with reflow soldering, I recommend ordering a stencil from your PCB manufacturer and reflow soldering the assembly. If you don't have the tools or experience to reflow solder the board, you may be able to solder it with an iron, the only challenge will be the ATtiny, which is a small leadless package. You should be able to manage by tinning the pads with solder and then using a hot air soldering station to keep the solder molten while mounting the package with tweezers. It will be tricky, but it's possible.

The following is a list of parts that you'll need to populate the boards. The parts marked with an asterisk (*) are parts that would be difficult to substitute. Everything else on the list could easily be substituted for an equivalent part from a different manufacturer. The battery holder is not included on this BOM. If you want to use the coin cell battery you'll need a Linx Technologies BAT-HLD-001-TR or equivalent battery holder. Otherwise, you can use whatever battery holder you'd like, attach it with strong mounting tape, and solder the leads to the GND and 3V external power pins. Also not included below are the header pins necessary to solder the two boards together. You can use header pins pulled out of the plastic spacer of male breakaway header strips or any sufficiently stiff wire.

Bill of Materials

Qty Manufacturer Mfg Part # Description / Value
3 Samsung Electro-Mechanics CL10B104KB8NNNL CAP CER 0.1UF 50V X7R 0603
2 Harvatek Corporation B19H1IR—20C000114U1930 Infrared (IR) Emitter 940nm 1.2V 65mA 0.4mW/sr
2 Harvatek Corporation B19H1PT—H9C000214U1930 Phototransistors 940nm Top View
21 Würth Elektronik 150060SS55040 LED RED DIFFUSED 0603 SMD
3 Diodes Incorporated BSS138W-7-F MOSFET N-CH 50V 200MA SOT323
8 Stackpole Electronics Inc RMCF0603JT1K00 RES 1K OHM 5% 1/10W 0603
7 Stackpole Electronics Inc RMCF0603JT680R RES 680 OHM 5% 1/10W 0603
2 C&K PTS526SM20SMTR21 LFS SWITCH TACT SMT 5.2MM 160GF LONG
1 Nidec Copal Electronics CUS-12TB SWITCH SLIDE SPDT 300MA 4V
1 Microchip Technology ATTINY861V-10MU MCU AVR 8K FLASH 512B EE 512B SRAM

Final Assembly

With the PCBs each populated, you need to mount them in the chassis. This should be as simple as snapping them into place and then soldering some pin headers. Every through-hole on the front PCB has a mate on the back PCB and a pin should be soldered through all of them (although on production units, the GND and 3V pins next to the lanyard hole will not have pins through them) The only electrically necessary pins are the two above the BeanCounter logo, which carry power to the IR LEDs. The rest of the pins are used as mechanical fasteners. You should take care to press the two boards together while soldering the pins in place so that they are seated as firmly in the chassis as possible.

Programming

The firmware for BeanCounter is written in Arduino and can be found in the firmware folder of this repo. In order to program your BreanCounter, you'll need to have an appropriate hardware programmer, such as a Pocket AVR Programmer, Atmel ICE, or an Arduino-compatible board running the ArduinoISP sketch. There is a standard 6-pin AVRISP header on the bottom of the BeanCounter to which you'll attach your programmer. You'll also need to install the brilliant ATTinyCore boards package for your Arduino IDE, which can now be done through Arduino's Board Manager. With the BeanCounter sketch open, you should select "ATtiny261/461/861(a)" from the boards menu. Now select the following board settings:

  • Chip: ATtiny861(a)
  • Clock Source: 16MHz (PLL)
  • Pin Mapping: New Style (down each side)
  • Timer 1 Clock: CPU (CPU Frequency)
  • LTO: Enabled
  • tinyNeoPixel Port: Port A
  • millis()/micros(): Enabled
  • Save EEPROM: EEPROM Retained
  • B.O.D. Level: B.O.D. Disabled

Ensure that your programmer is selected and then, with the hardware programmer connected to the BeanCounter, press "Burn Bootloader." There is no bootloader, of course, but this runs the commands necessary to set the fuse bits in the ATtiny. Once this completes successfully, press "Upload using Programmer" from the sketch menu. Once this is completed, your BeanCounter should be programmed. Enjoy!