StoryBox - Page 1
Forum section: electronics / projects

author: android
author_rank: Regular Contributor
timestamp: December 10, 2015, 05:08:25 am
content: I've just finished making a Chrissy present for my 3 year old grand niece...all in all a very enjoyable project! ... not all that challenging electrically, but that's ok with me...sorry about spending too much time on the artworkBasically, it plays pre-recorded audio (fairy tales at the moment) that I've programmed onto SOIC8 flash chips. Maximum of 25 minutes of mono at 11025 samples/sec - less with 22050 or 44100 samples per second. The flash chips have been potted in casting resin inside a mouse-like toy originally intended to amuse cats! (See piccy below). The interface is pretty simple (kinda has to be for a 3yo)...all she needs to do is pick a mouse (aka StoryMouse) and plug it into an RJ45 socket on the box. The PIC MCU detects the mouse insertion an begins to playback the flash contents as audio. There is a button on the front to pause playback in case of (3yo) emergencies.I'm fairly pleased with a few of the design points...1. Flash insertion detection is done by keeping the _HOLD pin weakly low, and having a 10k pullup on each StoryMouse to effectively signal insertion. When the StoryMouse is plugged in, it drives the _HOLD pin high and playback can begin (because it is not being held). When the StoryMouse is not plugged in, the internal flash (used for the "personality" audio...i.e. the prompter) can still be used by forcing the _HOLD pin high. Works like a charm.2. The R2R ladder (a Bourns 4310 10K SIL array) is connected directly across the RB0-RB7 pins...and then to VDD (instead of VSS which is the usual case). That makes it really easy to output DAC values. The result is that the audio output is 180 degrees out of phase with the input (i.e. a high number becomes a low voltage)...but that has no effect on the audio output.3. I've invented "null-terminated-audio"...just like null-terminated strings except with 8-bit audio samples. All I needed to do was pre-process the PCM audio (before writing to the flash chips) so that all zero values are converted to 0x01 (nobody would notice the difference) and append a trailing 0x00. Playback consists of setting the Flash read address and just keep reading until a 0x00 is found!I have to admit struggling to draw the schematic with Eagle. I always seem to be battling with Eagle. I've attached a schematic PDF showing how far I've got, but it still looks messy to me...I can't even find a AA battery holder symbol, and don't really know how to handle off-board components like the wall plate mounted RJ45 socket. Any Eagle tips would be welcome.Cheers,Andrew.

author: pmbrunelle
author_rank: Regular Contributor
timestamp: December 10, 2015, 05:36:38 am
content: This is cool.I like the low parts-count DAC; nicely integrated with the microcontroller.Is the audio signed or unsigned? I'm thinking, if the audio is signed, then you'll be adding a possibly significant amount of noise. If the audio is unsigned (I think this is better), then you're just clipping the bottom of the range a little earlier than usual, which would make the range become [-127, +127] rather than the original [-128, +127] non-symmetric range anyway.The pullup probably works well enough right now, though I wonder how the insertion detection will work with connector wear, and with 3-year-old hands pushing sideways on the connector. In theory, this kind of detection circuit would need the insertion detection contact to make only after all others have already made contact. In the RJ-45 connector, all the contacts are identical. Will the software handle glitches with the insertion detection?

author: android
author_rank: Regular Contributor
timestamp: December 10, 2015, 09:19:35 pm
content: Quote from: pmbrunelle on December 10, 2015, 05:36:38 amIt's unsigned...so 0 is the most negative swing and 255 is the most positive. I was thinking of stealing the 0xFF value and using it to mean something like a time marker (so you could skip forward to particular parts of a story, for example)...but then I remembered the KISS principleAs for RJ45 connector wear, I fear you may be right ... it may not survive the raw power of a determined 3yo. Having said that, I work in one of these so-called "agile" workplaces that requires everyone to setup their laptop each morning and pack it up at end of day. That's a lot of plugging and unplugging but I haven't had any ports die yet.The particular socket that I chose has a rather firm snapping action on insertion (which allowed me to dispense with the plastic locking tab on each plug) ... I'm hoping that means that the plug its guided into position better than your average socket. Time will tell.