Thanks @MLXXXp. I’m definitely in the mood for Muntzing with this design so I won’t include an audio amp. I decided to test something basic and it seems to have worked. I took an Arduino M0 and got it playing a short tune using the tones() library (on repeat - I have almost gone potty listening to it). Having read around a bit my main aim was to control the voltage peaks so that the headphone line voltage would result in a) no damage to headphones and b) acceptable volume - not too high for my children but still decent.
Some of the reading suggested using a series capacitor:
I haven’t tried this but am open to the idea. The high series resistor value in my design means I don’t think the absence of a capacitor is a significant issue as even if the pin were left high, the leakage current would be less than 0.5mA.
As I was playing with the voltage divider idea, I thought about how nice it might be to have software controlled headphone volume, so that I could get rid of the need for a nice wheel potentiometer. So I have comandeered two unused GPIOs to act as high impedence inputs or grounded current sinks, thereby varying the line voltage and resultant volume. I have tested this with some standard Apple earbuds and I have three voltages/volumes available. I will probably set volume to medium as default and perhaps add a momentary push button to cycle through the three modes. This can all live in a separate library or become part of the Arduboy2 SAMD port, depending on whether people want headphones and volume control via software.
The battery holders will hopefully contribute to the ergonomics. Speaker, inductor, IR LED, IR rx, 3.5mm jack and SWD header are all on the rear, as they take up more height than other components on the front (apart from the control buttons which are supposed to sit proud of the other components!). I’m thinking of sticking the OLED on top of the passives, using double sided foam tape and maybe some kapton for insulation if needed. The slot at the top is for the oled flat flex.