Manufacturing and Promoting Digital Badges Half 1: Designing and Prototyping the board

I wrote this sequence of posts primarily for myself, or not less than somebody who’s making an attempt to make one thing digital to promote. If that’s you then I hope this helps you in your journey! When you simply need to see the tip product then you could find it at https://hortus.dev/products/social-battery.
It is a lengthy put up so I’ve damaged it up into chunks to make it a bit simpler to digest. These are:
Introduction
A 3D render of the design in KiCad
I needed to experiment with JLC PCB’s meeting service – while I’ve designed and manufactured naked PCBs earlier than earlier than inserting and soldering elements manually, I’ve acquired some future initiatives in thoughts that might be impractical to solder up by hand resulting from each the amount and dimension of elements. It’s form of superb how low cost this service is when you consider what’s concerned however it’s nonetheless costly sufficient that it may be a bit daunting handing over your cash then ready to seek out out whether or not you’ve made some mistake that may destroy the tip end result.
I figured I’d get began with one thing easy, one thing I may take a look at the waters of not simply PCB meeting, but in addition e-commerce. My plan was to provide you with a small merchandise that I may realistically design and submit for manufacture in lower than a day, then hopefully promote fairly simply on a market place like Etsy. I used to be anticipating the design and manufacture aspect of issues to be the onerous half and itemizing the product on Etsy to be simple, however it was very a lot the opposite manner round as you will note in case you maintain studying!
The product
I had a fast scan of Etsy to take a look at the sorts of issues folks had been efficiently promoting that I may make. I discovered a few examples of individuals making digital pin badges – the right venture! These principally consisted of LEDs with both a random or pre-set flashing sample on a novelty formed board. These regarded alright to me, however I needed to strive one thing a bit extra interactive and significant that I may promote for sufficient cash to make a wise margin on a small variety of preliminary items.
Trying on the common pin badges being bought on Etsy I noticed a bunch of enamel ‘Social Battery’ pins with a sliding indicator. These instantly jumped out at me as one thing {that a}) I may establish with personally (folks make limitless jokes about my social battery…), b) can be actually enjoyable as an digital model, and c) can be simple to design – only a few LEDs, a swap, and a microcontroller to tie all of it collectively!
Designing and prototyping the board
Assured in my expertise I threw collectively a fast circuit diagram in Kicad. I made a decision to make use of an ATtiny13A – primarily as a result of I had a couple of available from a earlier venture, and since I have a good quantity of expertise with related chips. When you’re not aware of it, the ATtiny13A is a small 8bit microprocessor with 6 IO pins and is a part of the AVR household of MCUs. It’s much like the ATmega chips which have traditionally been on the core of most Arduinos, besides its capabilities are rather more restricted. The profit is that the ATtiny vary of chips are smaller and cheaper, so in case you don’t want quite a lot of reminiscence or perhiperals then they’re nice! (though probably a bit dated now with the limitless number of ARM chips which can be accessible).
I laid out the PCB for my circuit in KiCad then acquired it to spit out the gerbers and drill information (that are used to fabricate the PCB), and the invoice of supplies and placement information (that are used to assemble elements onto PCBs). I submitted them to JLC PCB to see in the event that they had been capable of course of them accurately. The BoM and placement information wanted a little bit of tweaking from the default to get them in the best format (seems I did this the onerous manner, and theres a a lot simpler plugin for KiCad that does the whole lot completely in a single click on).
JLC PCB maintains a pretty big library of elements that they maintain in inventory for meeting orders. Nonetheless in my case the ATtiny13a was not accessible so I needed to organize them in. This was fairly straight ahead utilizing their world sourcing service. I used to be capable of finding the provider with the perfect value for the amount I wanted after which let JLC PCB organize them to their warehouse on my behalf.
While I waited I figured I’d as nicely breadboard my design and begin engaged on the code, and I’m glad I did as a result of I instantly found a problem! My design used 5 of IO pins accessible on the the ATtiny13a to drive the LEDs immediately (with the sixth getting used to watch the button). What I didn’t realise/keep in mind from the final time I made this error (sure, It’s occurred earlier than) was that a kind of IOs can also be the reset pin. You should utilize it, however it’s not capable of provide a lot present, and by tying it to floor by an LED I used to be retaining the chip in a everlasting reset state.
One option to get round that is to burn a fuse on the chip that completely disables the reset performance of the pin reworking it into an everyday IO. The problem with this although is that you would be able to solely program the chip as soon as (until you personal a excessive voltage programmer, which I don’t) and given my propensity for studying issues the onerous manner, that appeared probably fairly wasteful!
The opposite choice is to discover a option to do extra with fewer pins, in order that the reset pin will be left alone. This may be achieved utilizing a method known as charlieplexing which lets you deal with many extra LEDs than the variety of accessible pins. You possibly can then scan by these LEDs, turning them on and off individually at a excessive charge to make it seem as if a number of are on directly by persistence of vision. In my case I’m driving the 4 inexperienced LEDs from 3 pins, and the pink LED with a devoted pin. This isn’t probably the most environment friendly instance of charlieplexing, as I may drive all of the LEDs from the three pins, however retaining pink on a devoted pin permits for easier code in terms of programming.
I revised my circuit diagram and PCB design, then re-exported the mandatory information and despatched them off to JLC PCB to fabricate and assemble an preliminary set of 5 prototypes.
Just a little over every week later I obtained my prototypes and I used to be actually happy with them! There have been a couple of issues that I may see I wanted to alter:
- I hadn’t actually deliberate how I used to be going to program the boards. I had simply damaged out the AVR programming pins and hoped for the perfect. This was superb for 5 prototypes as I may tack the programming wires on with the tiniest little bit of solder however this is able to get very tedious in a short time at scale.
- The spike for the fastener on the again was soldered onto a floor pad. This is able to have been superb besides the thermal mass of the spike and the bottom aircraft on the board made it tough to make a superb be a part of. It additionally stands proud very near the constructive steel cage of the battery holder which meant that there was a superb likelihood of unintended shorts occurring if folks positioned/connected the badge on/to conductive surfaces.
- The detrimental contact for the battery wasn’t distinguished sufficient so I had so as to add a dab of solder to it to make a superb connection. Once more – not the tip of the world for a small variety of prototypes, however a ache if I had to do that for hundreds.
These had been all easy fixes to implement. I added a correct programming header that may very well be used with a pogo pin jig for fast and repeatable programming. I disconnected the spike from the bottom aircraft in order that it was its personal small disconnected island of copper that it could warmth up extra simply, and never trigger shorts. And I expanded the detrimental contact for the battery in order that it could have extra floor space to make a stable connection.
The code is fairly easy. I maintain observe of the mode the badge is wherein is represented by an integer that will get decremented each time the button is pressed. I then loop and blink every LED on my manner spherical as dictated by the mode. When mode 0 is reached I reset it again to the unique quantity after which put the ATtiny into sleep mode. Urgent the button once more triggers the interrupt which wakes the chip and begins the entire course of once more.
General I used to be actually happy with the outcomes, which meant it was time to see if I may promote them! You possibly can examine my expertise doing this in the next post in this series.