Motherboard Hardware DesignI'm not sure there's a lot to say about the schematics for this device, a lot of it is based on the Chip Pro dev-kit, which I did a proof-of-concept system with, before making the schematic and the pcb design. The main thing I did there, was to connect the microphone pin of the trrs jack to the lradc input of the Chip Pro which allows me to detect keypresses on android-compatible headsets. If you didn't know this already, there is a standardized way of wiring these buttons up which can then be detected by a low-resolution and slow ADC. That's it for the audio side.
In the final design there's a lot of features that have been cut however, in order to cut costs as well as allowing the use of a smaller enclosure.
The initial design had a max3221e 3.3V-uart-to-rs232 level converter with esd protection, as well as an external 5-pin DIN connector. Five pins because that would allow me to have +5V for charging, as well as automatically powering the device on for configuration, and of course the RX+TX+GND for the serial communication. The din connectors that were rated for enough amperage to charge however weren't exactly cheap, and using them not only for configuration, but charging as well, meant that I would need to buy one similarly expensive plug for each device I would want to charge in parallel as well. The jack is somewhat bulky too and needs a quite large drill diameter.
So I revised the design, moving the charging to a standard barrel jack, and the serial io and remote power-on to a second trrs jack.
Further revisions of the hardware removed the external serial jack entirely, which means one hole less to get lined up and drill, less things to fit in the enclosure, and lower component cost. As for serial configuration being more difficult, my thoughts along the line that it should either be possible to do over wifi, e.g. by attempting to connect to a known network just after boot, or in the event of the actual need for serial configuration and troubleshooting, it will probably be in use cases where somebody knowledgeable enough about the device is needed, that opening the box and plugging in a few wire headers will not be a big problem. I put some esd protection diodes on the port however just to be safe.
Another thing that changed through the revisions are the battery protection circuitry. The Chip Pro has circuitry for charging lithium based rechargeables on-board, so I decided to power it all by two 18650 cells in parallel. This is not entirely without risk, and over-current protection (and ideally under-voltage protection as well) is needed. Looking up battery protection methods I found the I found the bq297xx and started to add the reference design from the datasheet to my schematic. After a while I realized that there's probably no way I'm going to be able to hand-solder this, not with my current iron at least, and went through design iterations with glass fuses as well as polyfuses, before returning to the bq297xx based design and buying a cheap hot-air station on ebay.
Apart from the difficulties related to the size of small components, there were a bit of difficulties related to the size of large components. To begin with, the Chip Pro is a smt device with castellated pads and components on both sides of its board. This means that the motherboard will need to have a large cutout in which nothing can be routed. (Although I guess you could connect the castellated sides with pin headers, but this would increase the total assembly height, and I'm trying to mount this in a quite constrained space.)
Combine this with the battery holder being mounted on the other side of the board, across the rectangular hole, so that the positive and negative pins end up on opposite sides, and that the battery protection circuitry need to be connected to both battery poles, and you will end up having to give some thought to how you're going to layout the power distribution nets. I seriously considered running air-wires for a while, but in the end I think I managed to come up with something that should work.
|After ordering components, but before ordering the actual pcb, I cut a piece of paper to the dimensions of the pcb and placed it in the enclosure to ensure that things would fit. They did, snugly, and with pretty much no margin, but they fit.|
Still, I have dived far too deep into this project to not see at least one trial unit brought to completion, just to see if it will work. And if it does, and if I can get Next Thing Co to sell me additional Chip Pro units, I'll build a few more, to see if, or rather how well they will talk to each other. And then we will have enough units to evaluate functionality in the intended use-case.