09/09/2017

Dreams of a wireless intercom system (continued: HW)

Motherboard Hardware Design

I'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.
Board detail, bottom side, mirrored; the four component clusters are: battery protection to the left and right (one group for each battery), close to the bottom is the transistor switch for the status leds, as well as three esd diodes, and the topmost group is powering and filtering of the microphone input. The width of the board is 50mm.
The 3D render of the board (top side shown) shows just how much space is consumed by the battery holder (BT201, big silkscreen rectangle) and the hole needed to mount the Chip Pro. You can also just barely make out the wide power trace forming a something like a backwards Ç or F around the hole (the tail being hidden below the silkscreen rectangle), going from the top pins of the battery holder, down to the protection circuitry on the other side, with a set of three vias on the right branching off to supply power to the SBC.
I have used kicad to draw the schematic and route the board, and while it in general has been a pleasant experience I would wish that it would be possible to have multiple custom grids and grid origins, without having to reenter them each time. I should probably place a caveat on the "pleasant experience", but dealing with trying to align components and traces where measurements are alternating between mil and mm, sometimes in the same component, is a pain. This is no fault of kicad however, but simply the nature of the thing.
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.
When I arrived at the initial bill-of-materials I was somewhat disheartened. As anyone with this hobby knows, electronics development is not cheap. Building something that I'm going to be putting in the hands of someone else leaves no room for compromise regarding e.g. enclosure choice, and counting units in the singular digits places you pretty far from the economy of numbers. And that's fine, hobbies are meant for enjoyment and possibly learning, but I'm not really comfortable with asking the group to foot the bill for five or ten units. Not when this is a one-of-a-kind solution with a bus factor of one as well as the need for a server to bounce against, and not when you can get COTS radios (removing the server need and bus factor) with higher audio quality than what we are currently using for the same money as investing in this project.

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.

No comments:

Post a Comment