Tonight, I will be adding microswitches into the mouth mechanism in order to sense when the mouth is open or closed. I decided I needed to do this because there are times when I want to have the mouth left open, for example when singing. I can really only envision needing to know when it is open, not when it is closed, but while I am in there, I will just add both.

Microswitches are ridiculously expensive even on the surplus market (unless you order from china). I will be scavenging the switches from old CDROM drives or other equipment.

Some simple mods to my controlling code is all that will be needed to sense the mouth movements and I can still "run" it (just cycling open and closed) while ignoring the switches for normal talking.

I will also be installing the speaker in the head while I am in there. I will also throw together an amp circuit on breadboard tonight. Final circuit will use SMD components and a properly laid out board.

I have also started working on the serial command format that will be encoded in the left audio track.

Right now, there is only: Thinking logically here, the idea is to sync movements to the audio. So, at the bare miminum, all that would be required is periods of mouth running and not running. Adding in commands for opening/closing the book would also be useful.

Once I add switches for sensing opened/closed state of the mouth, this would add two other commands. To seem moderately realistic there are times when opening the mouth and keeping it open for a period of time would better match the audio. For singing, this would be appropriate.

I have no current plans for speed control, though that is a possibility for a little more syncing realism. That would require encoding speed data on the audio as well.

Some experiments might be to even listen to the audio and do some auto-lipsyncing. This would probably be fairly straightforward for talking, but with singing, you would have to distinguish between vocals and instruments. Or have one track with only the vocals. Measuring the beat frequency would indicate speed, amplitude would indicate how open or closed to make the mouth. Though, without linear feedback, I imagine the code would be fairly simple. Again, cleanly separating vocals from background noise/instruments is the real issue. Thankfully that could be processed ahead of time.

Moving along, but still open to great ideas and suggestions. What would you do with this project?

I was thinking about your solution for the mouth, you want to use just switches? But that will give you only open and close, not inbetween. Why not use a pot, or a flex sensor, that way you will be able to see exactly where the mouth is.

I was thinking about your solution for the mouth, you want to use just switches? But that will give you only open and close, not inbetween. Why not use a pot, or a flex sensor, that way you will be able to see exactly where the mouth is.

Because I don't really think it is necessary for this application. The mouth movement is so small anyway and would be barely noticeable in in-between states. Second, there is difficulty to adding a pot to the mechanism. Adding limit switches is pretty simple. I will just glue them at the point of the levers so the levers themselves actuate them at extreme position.

If I *were* to add a pot, I would probably be best disassembling the gearbox and finding a common gear. Remember that the single motor runs both the mouth and the book open/close. So either one pot could be on the common gear for both movements, or one on the outputs of either movement.

It's not impossible, but I don't really think the effort will result in any noticeable difference.

I will have this appart again tonight, so I will take some pictures of the various mechanisms.

Well if you use a flex sensor, you can just glue that to the mouth lever or somewhere that moves with the mouth and that will work just like a pot, without the mess.

True. I can look into that. But, again, I don't think it will add all that much to know exact position of the mouth. Once you add the fur and the stuffing, the movement of the mouth will be very very small. As it is, I can't really tell if the mouth is in-between fully open or fully closed just by looking at it.

The switch idea was just meant to stop the cycle at either extreme so I don't just keep cycling the mouth movement on points where the voice is 'sustained' like when you are singing, shouting, or adding emphasis to something. Or stopping the mouth on the fully open position when the voice pauses.

The flex sensor would make it easy to measure exact position, though. I wouldn't mind picking one up to play with anyway.

I added the limit switches to the mouth. I managed to find 2 identical switches with long levers which made them easy to install. A dab of superglue gel, and tada! I now have feedback whether the mouth is open or closed. I am holding off on installing the speaker yet. I stopped at a thrift store and found a pair of USB powered speakers for $5. It would cost that much in parts to make my own amp. I may just gut those and use them. Not sure yet, they also make handy prototyping speakers as I can power them right off my breadboard.

Well, "mouth opened" work perfectly, but not "mouth closed". When I reassembled, I noticed that the body of one of the switches is in the way of a screwpost on the motor gearbox. I will need to tweak things a bit. I also will add bump-stops to one side of each of the switches so they are more reliable when pushed together.

Got the library done for the MP3 module. You can now install it on any pin, not just a serial pin. Having some issues with the way the module works, though (not my code, I don't think.) Already see some enhancements I can make to the library.

When you select an MP3 that doesn't exist, it just plays a random one. These modules have no feedback for number of files or errors, so you have to keep your code tight and file naming of the MP3s well controlled.

I decided to go with a MM74HC942 300-baud single-chip modem IC for storing and retrieving the data in an audio track. This chip is a bit hard to find (and may even be obsolete), but it does all the things that I need and comes in a prototype friendly DIP package as well as surface mount.

For a mini-tutorial, I will likely revisit this using more common and easily-sourced components. The advantage to using a special purpose IC is that it is simple to build a circuit and write code. The disadvantage is that these types of chips tend to go obsolete quickly and are hard to find. A discrete method (using common parts) is not especially complicated, but requires a lot of components.

The other advantage to using a single-chip modem is that I can use it to transmit as well and just record the output directly to the audio. No need for a program to handle it.

Using the 74HC942, all you need is a 3.58Mhz crystal, some caps and a few resistors. You may or may not need some audio amp ICs depending on what you are interfacing with. In my particular case, the MP3 module output is max at 200mVpp, which happens to be about perfect.

The SPACE and MARK frequencies are 1070Hz and 2025Hz (SPACE = 0, MARK = 1) since this uses the BELL 103 standard

I also ordered an RTC module. One that will be easy to mount in a remote location so I can access the battery externally. It is using the DS1307 chip. I will be replacing that chip with a MCP7940 once I can get sample ordering from Microchip to work (or breakdown and place an order with Digikey.)

I guess I should give up on asking for more ideas. Nobody has even been following this thread in quite a while. But, hey, if you stumble in here and have some, I'd still love to hear them. Until then, plugging away...

Hmm... I found this while poking around: http://code.google.com/p/arms22/downloads/detail?name=SoftModem-005.zip&can=2&q=

Softmodem implements a software FSK modem on the arduino using the analog inputs. Stripping it down and specializing it could do the decoding of data from audio without a modem IC. I'll give this a bit of a look while I am waiting for the ICs to arrive.

I had to move the bottom limit switch over to the other side. Also added hot-glue as bumpers to dampen one side of the switches so it had something to push against. This made them more reliable. I also added an LDR, a microphne, and some tilt switches inside the head. I forgot to add some IR LEDs to the eyes, so I will do that next time I have him opened up.

I also finished the library for the MP3 module (I posted it in the audio forum.)