Pages: 1 [2]   Go Down
Author Topic: Valentine's Day project - Animatronic stuffed animal - Need ideas  (Read 2160 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: February 13, 2013, 08:43:55 am by Retroplayer » Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3413
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3413
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 181
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What you need to do is use a little voodoo to transfer a human soul into the doll.  I hear it works really well, they made a movie about it. Child's Play I think was the name of it.
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3413
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What you need to do is use a little voodoo to transfer a human soul into the doll.  I hear it works really well, they made a movie about it. Child's Play I think was the name of it.
Yea but that, you have to make sure the soul your using is not from a psychotic serial killer. Having a killer doll will ruin anyones day.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The desired effect is to make her go "awwww", not "EEEEEEK!" lol
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Anyway, attaching pictures of the limit switch upgrade.


* pooh 004.jpg (71.51 KB, 431x371 - viewed 23 times.)

* pooh 005.jpg (193.99 KB, 612x816 - viewed 22 times.)

* pooh 007.jpg (116.61 KB, 607x500 - viewed 21 times.)

* pooh 008.jpg (82.66 KB, 604x450 - viewed 21 times.)
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: February 14, 2013, 05:39:06 am by Retroplayer » Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.)


* pooh 014.jpg (95.84 KB, 584x417 - viewed 22 times.)
Logged

Pages: 1 [2]   Go Up
Jump to: