# Op amp circuit



## Otaku

Hi all,
I don't know if anyone else can use this, but I needed an amplifier circuit to be able to operate a toy DC motor like the kind you find in talking heads and the like. I use this with MP3 players, which typically have a very low signal output voltage. This circuit boosts the signal 10X. Here's the circuit:










To use this, you connect the amplified output to a transistor or an IRF510 MOSFET to switch the higher DC voltage for the motor, lights or whatever. I send a "beep" track to the circuit; this helps keep the output signal clean with clear definition between the spoken words. A 10K linear pot in series with the output allows you to adjust the signal strength.


----------



## halstaff

Looks like that will come in handy!


----------



## Otaku

A couple of other points - the TLE2022 is a single-supply op amp, and runs on voltage from 5VDC to 20VDC. When this IC does not have an active high input, the output pin defaults to the supply voltage (5 - 20VDC) minus ~ 0.7VDC. If the sound source is going to be shut off between triggers, you should use a controller to switch power to both the circuit and the sound source at the same time. Otherwise the motor or whatever you have attached to the output transistor will be under power. If you're using the sound source in a loop mode, no problem. The only place I can find the TLE2022 is Digi-Key, but all the other parts are at AE.


----------



## hedg12

Very cool! Much cheaper an easier than a "toy motor" circuit. I have a few Gemmy skulls that will be called into service with these.


----------



## Otaku

BTW, some of the parts not shown in the schematic are a 1/8" stereo jack and the perf board; both are found at RS and AE . The circuit easily fits on the board with plenty of room for the MOSFET and a T-block for the connection of a motor or lights. I tested the circuit with a 4AA battery pack.
As soon as I get the time, I'll post a pic of the complete circuit.


----------



## pshort

If the circuit is to have 4X gain, I think that you meant to use a 150KΩ resistor instead of 150Ω.


----------



## pshort

Oops, mis-read, you wanted 10X. However, using a 470KΩ together with 150Ω looks unusual.


----------



## pshort

The TLE2022 is also available from mouser.


----------



## Otaku

If you need more than the 10X, you can reduce the 470K down to a 330K but I haven't tested it below that value. I originally designed this for use with testing thermocouple junctions. The amp'd voltage would then go to a LM339 comparator to determine if the temp was above a particular threshold.


----------



## Otaku

Here are the pix I promised. The T-block holding the LED would be replaced with a MOSFET or other transistor for powering a relay or a small motor. The other T-block is the power supply input - I tested the circuit with a 4AA pack. The 1/8" stereo jack is available at R-S. It has two shunt pins that are disabled when a plug is inserted. Make sure that you don't solder to these pins or you won't get a signal. I located those pins and bent them down flat. The jack doesn't fit a 0.1" board very well so you will need to open up the holes a bit to get it to fit. When using a MP3 player, record a "beep" track on one channel to get the best output signal definition.


----------



## hedg12

Thanks Otaku!


----------



## Otaku

In an earlier post about this circuit I mentioned that the default output state (no input signal) for the TLE2022 chip is high. With a 6VDC source, I'm getting ~1.9VDC at the output pin (#1), pretty close to what's needed to turn on a FET. To lower this voltage I attached a 2K pull-down resistor from pin 3 (signal input) to ground, so it is not left floating. Now when the MP3 player is off, the output voltage is ~.77VDC. Not as good as 0VDC, but below the FET gate threshold.


----------



## Otaku

Here's the revised schematic.


----------



## Otaku

Here's the latest iteration of the circuit. I added a second stereo jack to provide a way to connect computer speakers to the board. The circuit now runs on a single 9 volt source, battery or regulated wart. A 4AA battery pack will also work, but may not power the jaw motor sufficiently due to the voltage drop across the circuit. The motor power is now switched through an IRF510 MOSFET. I also added a 5K linear pot to adjust the jaw action in case the motor is overdriven. The DPDT switch is handy if you use a beep track to drive the jaw action. If you have the beep track on the incorrect channel, just flip the switch instead of editing the sound file. If you don't need to use a beep track, just put the voice track on both channels of the sound file. Now that I have it finalized I'll put together a sourced parts list.


----------



## Otaku

Oooops! Found another error - sometimes I hate Visio. Here's the corrected drawing.


----------



## halstaff

For those that prefer to see this laid out on a board or who struggle with converting from a schematic to the board like I do, here is the circuit on a Radio Shack 276-150 board. A couple of caveats, the program I'm using doesn't have the exact layout so you'll see that I have one row of the unconnected points crossed out. Everything above that just drops down 1 row. The program also is limited in the components available and the orientation options so I had to make some adjustments. The switch and the stereo jacks will be changed once I build the board but this still shows the correct connections.
The green wire links represent solder bridges that will be done on the underside of the board.


----------



## halstaff

I just completed mine and it works great. Here are the photos of the front and back of the board.


----------



## halstaff

This ran me about $12.60 to build. I've included my sourced parts list but Gary seems to have been able to trim the cost a bit by getting most of his parts at AllElectronics.
The time consuming part was figuring out the layout. Once that was done, I spent about an hour soldering it up.

PARTS LIST FOR AUDIO DRIVER FOR TOY MOTOR

PART NUMBER	PART NUMBER SUPPLIER COST
1.	Op-Amp 595- TLE2022CP Mouser $1.92
2.	PC Board 276-150 Radio Shack 2.19
3.	Slide Switch 275-007 Radio Shack 2.19
4.	Stereo Jack(2) 568392 Jameco 1.49
5.	5K Pot 43078 Jameco 1.25
6.	IRF510 Transistor	209234 Jameco .79
7.	8 Pin Socket 112206 Jameco .13
8.	0.1 Capacitor(2)	15229 Jameco .06
9.	0.022 Capacitor	15245 Jameco .08
10.	100ohm Resistor	690620 Jameco .02	
11.	150ohm Resistor	690662 Jameco .02	
12.	470K Resistor 691500 Jameco .03	
13.	2K Resistor 690937 Jameco .03	
14.	Header 160882 Jameco .59
15.	9V Battery Clip	109154 Jameco .26
16.	Assorted Wire Links


----------



## halstaff

I forgot to add the battery connector.
15.	9V Battery Clip	109154 Jameco .26


----------



## JeffHaas

For talking skulls, can you use this circuit plus an appropriate motor to make the jaw move? So far all I've seen is how to refit an existing prop, but it seems that you could get a skull, appropriate motor and this board.


----------



## Otaku

Good question, Jeff. I don't know what motor would be appropiate for a Bucky skull due to the weight of the jaw, and you'd need to build in the spring lever (similar to the Boris mechanism). Given the cost of a HiTec 425BB servo and a driver board, it might be worth exploring. Hmmm...


----------



## JeffHaas

Is there any reason to use a Bucky, or could you get away with a cheaper, lighter skull? (Thus making the weight of the jaw lower.)

For example, these guys seem to have used a cheapo skull, watch their video:
http://www.instructables.com/id/Talking-Arduino-Halloween-Skeleton/

But then I guess it might not last that long.


----------



## Otaku

Nice project, but way pricey. Yeah, a skull like that would do the trick. As for durability, I've been using three hacked Boris skulls for a few years now with no breakdowns. The only tricky part is hingeing and springing the jaw for a smooth return. Mounting the motor doesn't seem to pose any serious issues.
I gotta look into this.


----------



## fritz42_male

My Talking Boris electronics died a few years ago. Not having come across the motor drive circuit, I put a servo in - it was a very easy mod as the servo fitted perfectly between 2 raised areas on the inside. A bent wire link to the arm formerly driven by the motor was all I needed to do.

I used the Cowlacious Scary Terry board but hope to do another with a op-amp/picaxe circuit (with Steve/Halstaff)


Cost would be under $20 for the picaxe side and whatever you can pick a servo up for


----------



## Otaku

An update on this circuit - I sent the schematic to Jeff Wheat (a haunters best friend) at www.simplecircuitboards.com and he burned a board for me to test. I built it out and it works perfectly. Jeff will be adding this item to his product line; the price is $7.00 for one board ($2.00 shipping) and $5.00 each for additional boards in the same order.
I'm putting together a parts list (many thanks to Halstaff for his previous parts list) and I'm trying to get everything from one source (DigiKey) to reduce shipping costs. Right now, the total cost of the board is <$12.00 without shipping charges. It'll take me some time to cross-reference the parts but I should have the list posted in a couple of days.
More to come...


----------



## fritz42_male

Hi Otaku,

Link was wrong - http://www.simplecircuitboards.com/

Steve - maybe a few minor mods to your circuit and then send to Jeff Wheat for a price for a custom board?

I see Pin 3 (In3) is available on your last design - maybe connect up a pot and use to adjust the response e.g. make the setting on 3 responsible for the delay or start point of the servo movement?


----------



## Otaku

Ooops! Thanks, Mike!


----------



## halstaff

fritz42_male said:


> Hi Otaku,
> 
> Link was wrong - http://www.simplecircuitboards.com/
> 
> Steve - maybe a few minor mods to your circuit and then send to Jeff Wheat for a price for a custom board?
> 
> I see Pin 3 (In3) is available on your last design - maybe connect up a pot and use to adjust the response e.g. make the setting on 3 responsible for the delay or start point of the servo movement?


I'm hoping Jeff will be interested once we come up with the final design. I haven't used pin 3 before but another pot to fine tune the movement would be great. Also it would be nice to have everything on one board.


----------



## halstaff

I just tried the circuit on one of my Douglas Firs that didn't have an auxiliary jack and it worked great!
I'll now be able to put those 2 props to work thanks to this new circuit. I'll be ordering a couple of these from Jeff soon.
Thanks Otaku for all the work on this.


----------



## fritz42_male

I picked up 4 cheesy 'dracula' talking heads for $5 each last year. Electronics flaky in all but 1 but should be able to reanimate them with this circuit if I get time!


----------



## Otaku

halstaff said:


> I just tried the circuit on one of my Douglas Firs that didn't have an auxiliary jack and it worked great!
> I'll now be able to put those 2 props to work thanks to this new circuit. I'll be ordering a couple of these from Jeff soon.
> Thanks Otaku for all the work on this.


Hey, that's great! I never thought of all those Dougies without aux jacks. Glad to hear that it works for them.


----------



## JeffHaas

Hey, how did things work out on this circuit?

Did Jeff at SimpleCircuits add this board to his stock?
Do you have the final parts list?

And how does this compare to the Picaxe version by Halstaff?


----------



## Otaku

JeffHaas said:


> Hey, how did things work out on this circuit?
> 
> Did Jeff at SimpleCircuits add this board to his stock?
> Do you have the final parts list?
> 
> And how does this compare to the Picaxe version by Halstaff?


It works well for amplifying an audio source to drive a toy motor, such as Gemmy skulls and their ilk. AFAIK, Jeff has the boards available, but don't know the price. I should have a parts list somewhere, since I have ordered parts to build out a couple of the boards. It's probably on my work computer, I can look for it in the morning. I don't know about the comparison to Halstaff's board, but I think he's used both and could answer this one.


----------



## JeffHaas

Sounds good, I just got a couple of the Gemmy skulls on clearance for ten bucks each. And I've got a few of the op amps available.


----------



## JeffHaas

Otaku, Jeff at Simple Circuits still has that board for $7.00 shipped.

Can you put up your parts list?


----------



## Otaku

Will do, its on my machine at work. I'll post it here on Monday morning. I think I also have pics of a finished board.


----------



## JeffHaas

Hey Otaku, have you had time to dig this stuff out?


----------



## Otaku

JeffHaas said:


> Hey Otaku, have you had time to dig this stuff out?


Still looking for the bloody parts list. It's different for the SCB board than for the perf board version. I do have a couple of pics of a built-out board, that may help with parts identification. I'm going to email Jeff to see if he has any info on the parts needed.


----------



## pshort

Do you have the schematic or board layout? It shouldn't be hard to regenerate a p/l from either one.


----------



## Otaku

Just heard back from Jeff, he has the parts list but is traveling right now and will send it to me when he returns to FL.


----------



## JeffHaas

Thanks for checking into this!


----------



## Otaku

Just got the parts list from Jeff. I think most of this can be had at All Electronics, so I'll do some cross-referencing on the parts. The board that Jeff has is designed to use the Jameco stereo jacks and that's the only place I know of that has that part. The 5K pot is a flat 3-pin trimmer, I'll take a look in my parts stash to see if I have any of those left over to see which one it is - I don't have the specific Jameco p/n. The MOSFET can also be found at Radio Shack. Jeff has the 2-position T-blocks as coming from Allied Elec. but I think AE has the same part. More to come.

2-position terminal block
Allied p/n 742-1602
2 ea.

Capacitor, disc, 0.1uF
1 ea.

Capacitor, disc, 0.022uF
1 ea.

DIP socket, 8 pin
1 ea.

MOSFET, IRF510
1 ea.

Potentiometer, 5K*
1 ea.

Resistors:
100 ohm - 1 ea.
470K ohm - 1 ea.
2K ohm - 1 ea.
150 ohm - 1 ea.

Slide switch
Jameco - p/n 161817
1 ea.

Stereo jack
Jameco p/n 2081772
2 ea.

Jumper
Mouser p/n 291-0-RC
2 ea.

Op-amp IC
Mouser p/n 595-TLE2022CP
1 ea.


----------



## JeffHaas

Thanks! I live two freeway exits away from Jameco, so I usually get everything there.

If you can post a picture or two of the final board that would be helpful too.


----------



## pshort

Otaku,

Have you looked into cheaper op-amps? The MCP6002 from Microchip is a lot less expensive, and I think that it would work just as well. It has a lower gain-bandwidth product than the part that you specified, but that shouldn't matter in your circuit. Its output should also go lower than the TLE2022 part, which is a benefit.


----------



## pshort

I think that the STX3120-3 is the ROHS replacement for that Jameco audio jack, although I haven't downloaded the datasheet to check the footprint. Mouser has them in stock.


----------



## Otaku

I like cheaper. The other issue with the TLE2022 is availability, I've only found it at Mouser and DigiKey. Jameco has it, but only in SOIC form. I wonder if it can be used as a direct replacement for the TLE2022 on Jeff's existing board? I gotta check the pinout.

Later that same day...
Just compared the pinouts and the MCP6002 looks to be a direct replacement, the pin functions match. And Jameco has the thru-hole version in stock. The TLE2022 is a bit more forgiving on the supply voltage where the MCP6002 has a max supply voltage of 6VDC. Might have to play with the cap and/or resistor values. Phil, your thoughts?


----------



## pshort

I don't think that the external component values would need to change. Is the 6V p/s limit going to be a problem?


----------



## Lunatic

Wow...this is a great thread and how-to! This is the first time i saw it. Thanks Otaku and Halstaff!


----------



## Otaku

pshort said:


> I don't think that the external component values would need to change. Is the 6V p/s limit going to be a problem?


Shouldn't be a problem to run on 6VDC, but I need to take a look at the circuit again to be sure. I haven't used one of these for quite a while, but I seem to remember that there was a significant voltage drop across the circuit that required 9VDC as the p/s.


----------



## pshort

Actually, I think that even a lowly LM358 would work here.

Edit - LM158, as it has a wider temperature range.


----------



## Otaku

Phil, you're probably right - I'm just concerned about the pinout of the possible replacements and whether they'll work with the existing board. It probably wouldn't be too difficult to re-design around a new IC, though.


----------



## pshort

I think that virtually every dual op-amp that will physically fit on the board will have the correct pinout. At least, that's been my experience.


----------



## Otaku

After another look at the pinouts, I agree. Time to grab some boards and order some parts, I have a couple of skulls that need to start talkin'.


----------



## Otaku

I ordered a couple of boards from Jeff and will build them out with LM358's. I have an idea for a way to use these to drive a Bucky skull jaw, replacing the current servo motor and driver board with a small DC motor.


----------



## JeffHaas

I ordered a couple of the boards from Jeff the other day and got them today. Really fast service!

Otaku - Did you figure out which 5k pot it is? It looks like the Jameco part number is 43078.


----------



## Otaku

Yep, Jeff, thats the one. I found some in my parts stash this morning.


----------



## JeffHaas

And here's a few pics of the first build...

The boards, from Jeff at Simple Circuits. Very professional!









Parts list, from this forum:









Box 'o parts, including new bagged stuff from Jameco:









And the first one is done!


----------



## JeffHaas

Hey Otaku, I just noticed something...how do you make the eyes flash when the skull talks?


----------



## Otaku

Sweet! I ordered mine over the weekend, so they should be here in a couple of days. I already have the parts, so I'm ready to start the builds. I don't remember if I mentioned it anywhere in this thread (and I'm too lazy to go back and look) but I found that using a "beep" track works best with this circuit.


----------



## Otaku

JeffHaas said:


> Hey Otaku, I just noticed something...how do you make the eyes flash when the skull talks?


Good question...I never looked at doing that. I've never really been a fan of the flashing eyes thing, but you could try wiring the LED eyes into the motor output terminal. There may be enough current there to drive the eyes. This board typically runs on 9VDC so you may need to change the resistor(s) on the eyes.


----------



## JeffHaas

I just tested the eyes...they're wired in series, so 4.5 volts (from the internal battery box) lights them up fine, and they don't seem to have a resistor.

How much voltage is the board putting out to run the motor?


----------



## Otaku

Depends on your power source. There is a small voltage drop in the circuit, but if I remember correctly the MOSFET pretty much switches whatever the voltage is at the source. If you use a 9 volt battery, you'll get close to 9 volts at the motor terminals. I'd play it safe and check the voltage with a DMM. I've used this board successfully with both 6VDC and 9VDC on the same Gemmy skull with no apparent issues.


----------



## JeffHaas

OK, there is something off about this board for me. I measure the current output at the "motor" connection, and as soon as an mp3 starts playing, it turns on to about 9 volts and stays there while the mp3 is going. It doesn't vary much at all. And only after the mp3 is done for a few seconds does the current drop off back to zero.

So the skull opens its mouth and keeps it open.

Did the values on the parts list come out right? It's like there's a capacitor that charges up and takes a long time to discharge, instead of holding a very brief charge for part of a second.


----------



## Otaku

Jeff, I got your PM about this. That's definitely odd behaviour, and not something that I saw with the board I built out a while back. I no longer have that board, it went to a friend as part of a prop trade last year. After I get my boards from Jeff I'll build one and see if I can get the same thing to happen.


----------



## JeffHaas

Thanks, let me know what happens when you build yours out.


----------



## JeffHaas

More info...

I put the circuit together on a breadboard. Same result!

Would you believe that the problem is the mp3 player? I have a few, some of them put out a signal that causes the circuit to be "on" and the multimeter to read a voltage, even if the music is paused. Others, like my old iPod Nano, work correctly. Hooking it to a computer works mostly but there is some noise and you can see the multimeter registering something even when no music is playing.

I got the same results with the breadboard and the finished versions. Now to do some more testing...does the Tenda board put out the "high" audio signal all the time? I hope not...


----------



## corey872

I haven't been following this terribly close, or have seen a schematic of this circuit, but it won't stop me from speculating!

In normal life, the MP3 player would expect to have a low resistance / low impedance (single to low double digit ohms from headphones/speaker) across the output terminal. If you are measuring voltage with just the meter attached, that represents a very high impedance likely 50-100 megaohms or higher. It might be possible the MP3 amplifier, especially if made cheaply, can't deliver a full range of voltage if the outputs are essentially 'open' as they would be when attached to a voltage meter. Likewise if you are putting the signal directly into an opamp, it may represent a high impedance sink which the MP3 can't 'play' the full voltage against. Think of it as a bathtub with no drain...you can fill it full once, but even shutting off the water doesn't make the level go low again.

It might be possible you need to add a low resistance across the MP3 outputs to see the full voltage range. This would act as the drain, let you see full voltage for the 'on' stage but also let the voltage go low during the 'off' state.


----------



## Otaku

I was going to ask about which player you were using. I have a bunch of the old $5 cheapo's that were around a few years back. They're a pain to trigger, but for looping sounds they're great. They worked fine with this circuit, but that's the only player I tested with. Glad you found the issue. BTW, a small voltage at the output may be ok, as long as it's below the gate threshold for the MOSFET. Hopefully the Tenda boards will work. I plan to use some of the USB boards that Electronics123 sells with the skulls I'm modding.


----------



## Otaku

Hey Corey - there's a schematic in post #15 in this thread. I did add a 2K resistor to the circuit to correct this issue, that value may need to be different depending on the player one is using.


----------



## JeffHaas

I haven't gotten it working yet, I still have to test with the Tenda board. But now I know that I can try different resistors in place of the 2K one and that should help.


----------



## pshort

The tenda boards (at least the TDB380) have a capacitively coupled output that puts out 'nothing' when it isn't triggered to play.


----------



## Otaku

pshort said:


> The tenda boards (at least the TDB380) have a capacitively coupled output that puts out 'nothing' when it isn't triggered to play.


Sounds like thats gonna work.


----------



## JeffHaas

More progress...

pshort was right, the Tenda board doesn't put out any noise while paused.

But I'm still running into a problem. While I can measure the board passing current through, it's not enough to activate the skull's jaw. I can touch the ends of the wires to a 9V battery and get the jaw motor to work, but the circuit doesn't pass enough juice through.

I tried it using a 9V Jameco power supply, and the multimeter showed that the most that was going through (sometimes) was 6V. And that's just not enough to get the jaw to move.

Is there a resistor I should change that's keeping enough current from passing through?


----------



## Otaku

The only thing that the op amp circuit is doing is amplifying the low voltage signal from the MP3 player up to something that can easily turn on the MOSFET gate pin. I assume that you've adjusted the 5K trimmer to minimum and are still having a problem? You can reduce the 2K resistor down to a 1K and see if that helps. I'm confused about a couple of things here - that the circuit is passing such a low voltage and that ~6VDC isn't enough to drive the jaw motor. I'm still waiting for my boards to arrive, so I can't try to duplicate this problem yet.
Another option may be to power the circuit and the motor separately; I'll try doing this when I get one built. Sorry to hear about this problem. It's not something that I've run into with this board in the past.


----------



## JeffHaas

It doesn't matter how I set the 5K pot, the circuit still acts the same.

I just tried a 6V DC wall supply, the skull moves, but only a little. It doesn't go to its full open position. Which is weird, because I got two and the other one (still in the package) only uses three AA batteries and it opens its jaw all the way.


----------



## pshort

I've been meaning to ask - what tone are you using to use as the trigger? Frequency and amplitude...


----------



## Otaku

Phil beat me to it. I got the best results with this board when using a beep track to drive the op amp.

Edit - If you are still having problems getting the motor to react properly, there is an alternate power scheme that you can try. You use a 4AA (6VDC) battery pack to power the board and a 9 volt battery to power the motor. The additional wiring isn't complicated; I can send you a pic of this layout if you want to try it out. I'd like to optimize it using the current boards after I get one built, though.


----------



## JeffHaas

I generated beeps in Audacity, but I'd have to go back to the software to see what frequency/amplitude they are. Any recommendations for best performance?

Also, I've tried flipping the switch so that the talking goes to the op-amp instead of the beep tones; same result.

Otaku, thanks for the help. I'll wait until you figure out how to adapt the board to a wider range before I tinker with it any more.


----------



## pshort

Actually, my question was for Otaku. My bad for not being more specific...


----------



## Otaku

I'll have to go home and check the MP3 files in Goldwave to see what I used. My best guess right now is that the beep amplitude was approx. twice that of the voice track. Frequency unknown at this time, but I used one of the built-in dial tones for the beeps.


----------



## Otaku

Here's a pic of the alternate motor wiring that I tested. The board is running on 6VDC and the 12VDC test motor is using a 9 volt battery. The two power sources share a common ground (necessary), but the MOSFET is only switching the 9VDC to the motor. To prevent damaging the lower voltage skull jaw motor you'll want to swap the power sources, and possibly go down to a 4.5-5VDC source for the jaw. The board runs on 5VDC - 20VDC so 9 volts is no problem. When I get my boards I'll optimize the configuration. This test was done on a proto version of the board, but the only differences between this board and the one from SCB are the slide switch and the stereo output jack.


----------



## Otaku

Here's a link to the test video. The motor was being driven by just the voice track and the rotation was very robust.

Opamptest.mp4 video by Otaku1031 - Photobucket


----------



## Otaku

Here's a pic of the op amp test file. It's the one that's running in the video. The beeps are considerably higher amplitude than the voice track. Still waiting for my boards to come in...


----------



## pshort

I think that the frequency of the trigger tone is quite important. As I view the circuit, the op-amp has a gain of about 3000 at DC (1 + (470,000/150)), and starts rolling off at 15 hz or so (1/(2π * 470KΩ * .022μF)). The promised gain of 10 occurs at about 4500 Hz. If you double the frequency, the gain would go down by a factor of two, and halving the frequency would double the gain.


----------



## JeffHaas

pshort, thanks. Can you translate that into steps needed to generate the optimal tone for triggering the circuit?


----------



## Otaku

Phil, you rock. I used the function generator in Goldwave to insert a 4500Hz tone in the test file I'll use when I get the boards built. This is extremely useful info, thanks!


----------



## pshort

Otaku, I'm not sure that we're on the same wavelength (so to speak). Did you use 4500 Hz in the previous tests? Or are you using what I wrote as the basis for future testing? I'm a bit confused now. I was more or less just thinking out loud in the post above, trying to deduce the frequency that you used from the bits and pieces that you've posted in this thread.


----------



## Otaku

The original test file used a tone similar to what you hear when you press the "5" button on a telephone. Goldwave has a number of built-in selections for generic tones. The frequency of this tone is unknown. For future testing, I've used the program's Expression Evaluator to generate a true 4500Hz tone and will create a new test file that has a beep track with this frequency.


----------



## pshort

According to the wikipedia DTMF article, the tones for '5' are 770 and 1336 hz, which are a lot lower than the 4500 Hz mentioned above. A lower frequency would have a higher gain in your circuit, so you might want to use a lower frequency.


----------



## Otaku

Hey, you're right, thats probably why I got a good result on the initial testing. I should try using a lower frequency tone and see what happens. I'm still waiting on the boards, but I've made some interesting progress on using a toy motor for animating a Bucky jaw. I'll start a new thread for that when its done.


----------



## JeffHaas

Hey Otaku, how's this coming along?

Jeff


----------



## Otaku

Slowly, its been way crazy at work and thats where I have the tools to work on the board. I've been collaborating a bit with pshort as to where we need to go with this. More to come.


----------



## JeffHaas

Cool! Looking forward to what you guys come up with.


----------



## Otaku

A quick update - with pshort's advice and guidance, I re-designed the circuit. I'm testing various configs at this time but so far so good, the prototype is working really well. Pshort's advice has been very valuable in helping me to understand the requirements for designing a robust and reliable op amp circuit.
The existing board (from SCB) probably can be modded to accept the new components - I haven't gotten to that part yet. More to come.


----------



## JeffHaas

Good to hear! When you have something stable, let me know - I have the old circuit breadboarded, I'm happy to test the new one with my skulls. Then we can figure out how to adapt the SCB board.


----------



## Otaku

More news (not just a bump lol). Phil (pshort) has sent me a revised circuit schematic that I'm testing with various skulls - I have 3 or 4 that I want to test - and with various tone track frequencies. The results are very consistent using a 100KHz tone, no motor vibration (singing) and very crisp definition on the jaw movement.
I use Goldwave as my audio editor; I haven't figured out how to save a file as a MP3 in Audacity. Any pointers from the Audacity gurus on this would be appreciated.
Anyway, so far so good. I want to thank pshort for all the help and tutoring over the past few weeks, this latest circuit really is his design. I'm still looking at how the existing SCB board might be modded to accept the new design/parts, as well as how LED eyes (if present) could be sync'd to the jaw movement.


----------



## JeffHaas

Saving a file as an MP3 in Audacity is easy. Get the current version (2.0.2 as of this writing) from the website, http://audacity.sourceforge.net/

Load your file, edit it, apply effects, etc.

Then click...

FILE > EXPORT

The EXPORT dialog will allow you to pick a type of audio file to export to. Use the "Save as type:" button. Note the OPTIONS button, which allows you to set bit rate, etc for the type of file you picked.


----------



## Otaku

I don't want to go off-topic, but what I get when I export the Audacity file as an MP3, I get a file with .aup extension, not .mp3. I must be missing something?


----------



## JeffHaas

You should get an .aup file (Audacity format) if you do Save as...

Farther down the menu is Export.


----------



## halstaff

Have you downloaded the LAME MP3 Encoder - http://audacity.sourceforge.net/help/faq_i18n?s=install&i=lame-mp3 ?


----------



## Otaku

Problem solved - I had a very old rev of Audacity (1.2.6). Thanks guys!


----------



## Otaku

More update stuff.
Pshort's latest version of the circuit works with all three of the skulls I have, as well as running their LED eyes in sync with the jaw. I get the features that the skulls had before, but now they say what I want them to. There's more work to be done to determine what will be the simplest way to attach the LEDs and jaw motor wiring. And there may be some issues with the LEDs - in all the skulls I have the LEDs were wired in parallel with individual resistors mounted on the OEM board. Since that board went away, I had to cut in a pair of resistors. I guessed and picked 150 ohms as a safe bet. Other skulls probably have parallel-wired LEDs as well, otherwise the voltage drop across the eyes would be a bit high.
So far, so good, but still haven't had a chance to see if the original SCB board can be modded; that's next on the list.


----------



## JeffHaas

Update...

I spent some time with this - Otaku sent me his schematic for the revised circuit, I tested it on a breadboard, where it worked great. So I've had it turned into a PCB by Jeff at SimpleCircuitBoards.com. It's done and working!

You can ask Jeff at SimpleCircuitBoards.com for the "Gemmy Motor Driver V2" board. Here's the parts list, I used Jameco as a reference since they're close to me.

========================
Gemmy Motor Driver, v2
7/2/2013	
Parts list 

Part / Jameco part number / Needed
LM358 OpAmp / 23966 / 1
IC socket, 8 pin / 112206 / 1
Capacitor, disc, 0.1uF (104) 1
MOSFET, IRF510 / 209234 / 1
10k ohm resistor (BRN-BL-OR) 2
100k ohm resistor (BRN-BL-Y) 1
4.7k ohm resistor (Y-PUR-R) 1
1N4148 Diode 1
Slide switch mini DPDT / 161817 / 1
3.5mm stereo jack, PCB mount / 2081772 or 2177740 / 2
9V battery snap / 109154 / 1

Total for parts is $3.66 before tax & shipping, and that's buying the most expensive way (only one of some parts instead of ten).

I'm going to put up an Instructable with more details. I also have the flashing eyes worked out, for my skull they need an additional resistor and are wired in series with the motor.

Jeff


----------



## Otaku

I'd like to give a well-deserved thanks to Phil and Jeff for all their great work with this project. Phil, for wringing out the bugs in the original circuit design and making it solid, and to Jeff for following up on the testing and working with Jeff Wheat at SCB on the final design when I was tied up with a contract job in WA.
I'm picturing an army of Gemmy (and other) skulls now forced to do the evil bidding of haunters everywhere!


----------



## halstaff

JeffHaas said:


> Update...
> 
> I spent some time with this - Otaku sent me his schematic for the revised circuit, I tested it on a breadboard, where it worked great. So I've had it turned into a PCB by Jeff at SimpleCircuitBoards.com. It's done and working!
> 
> You can ask Jeff at SimpleCircuitBoards.com for the "Gemmy Motor Driver V2" board. Here's the parts list, I used Jameco as a reference since they're close to me.
> 
> ========================
> Gemmy Motor Driver, v2
> 7/2/2013
> Parts list
> 
> Part / Jameco part number / Needed
> LM358 OpAmp / 23966 / 1
> IC socket, 8 pin / 112206 / 1
> Capacitor, disc, 0.1uF (104) 1
> MOSFET, IRF510 / 209234 / 1
> 10k ohm resistor (BRN-BL-OR) 2
> 100k ohm resistor (BRN-BL-Y) 1
> 4.7k ohm resistor (Y-PUR-R) 1
> 1N4148 Diode 1
> Slide switch mini DPDT / 161817 / 1
> 3.5mm stereo jack, PCB mount / 2081772 or 2177740 / 2
> 9V battery snap / 109154 / 1
> 
> Total for parts is $3.66 before tax & shipping, and that's buying the most expensive way (only one of some parts instead of ten).
> 
> I'm going to put up an Instructable with more details. I also have the flashing eyes worked out, for my skull they need an additional resistor and are wired in series with the motor.
> 
> Jeff


Too bad we can't source this from somewhere else. I've ordered a lot from Jameco but they have a $10 minimum order (or they charge you $5) and the shipping for the few parts I need to complete this build is $6.27.
I was hoping Tayda would have all the parts but they don't seem to have the right switch. Rats!


----------



## Otaku

The only unique Jameco item is the stereo jack, everything else is available at All Electronics and RS (IRF510 MOSFET). The thru-holes on the Gemmy board are drilled to match that jack.


----------



## halstaff

The boards and parts are on order. 
This will be a cool addition to my haunt.


----------



## JeffHaas

I can't believe that jack is only available at Jameco. There have to be equivalent ones out there. The only requirement is that the three connections are in the same pattern, and that seems to be standard.

For example, this one at Tayda seems to have the same main pins: 
http://www.taydaelectronics.com/3-5mm-stereo-enclosed-socket-chassis-jack.html

You might need to clip off the extra support pins but it should work.

Also, the tiny slide switch isn't a necessity, just a convenience. You could wire jumpers to make the connections, it would just take away the option to have the beep track on the other channel. Or I suppose you could connect the pads on the board to another DPDT switch with wires. Not as neat but it would work.

However, I understand your position, and we should try to figure out equivalent part numbers for other stores.


----------



## Otaku

Yeah, I thought so, too, so I spent an hour cross-referencing that jack. No luck. I did spot the one at Tayda, and you're right, just trim off the support pins and it should be fine. I found the equivalent switch at AE, but they don't have the IRF510 in stock, nor do they have that jack. Everything else is off-the-rack.

Jameco really is the one-stop shop for these parts. They're just across the bay from me, so if there was sufficient interest I could order a mess o' parts and mail out kits to the members here. It'll all fit in a small envelope, so postage would be minimal. Just cover the cost and postage and all's good.


----------



## JeffHaas

I'm thinking that the jack is standard but more common with the support pins. I'll check with Jeff Wheat and see if he can update the board to add a couple of extra holes, drilled to accommodate the support pins.

This way people could get everything at Radio Shack in a pinch. I'd prefer that it was a self-supporting project that didn't need any of us to help. I'm planning on putting up an Instructable to explain it and this is one of the tweaks it needs.


----------



## Otaku

Jeff, what are the dimensions of that board? I was wondering if it could fit inside the bird's perch if I gut out all the other unneeded parts.


----------



## JeffHaas

It's 2" x 2".


----------



## Otaku

Cool, thanks. I'm trying to distill this into a how-to. As I mentioned on the Raven thread, I'm attempting to use a single power source for this hack. Thanks to Homey, I may be able to pull it off.
Your board looks a lot different than the proto I built. I have two T-blocks on my board (prop motor + and -, and motor power + and -). How are the motor and power connected on this board?


----------



## JeffHaas

Motor and power are connected via the red and black wires on the left and right. Motor is on the left. I put a blob of hot glue where the wires come out of the board to reinforce them. I figure this board is so inexpensive that it's going to get fastened in place in a project and never moved out. So why bother with the T-blocks?

My plan is to run the motor wires to a mono phone jack, and then use a long 2-wire cord to connect to the skull, where there's another mono phone jack that connects everything in the skull. This way, you wire up the skull and use its own battery box for powering it. Then you close it up and never have to open it up again, you just plug a connector into the back. And you can make the connecting cable as long as you need so it's easy to hide the microprocessor and mp3 player.


----------



## Otaku

Cool, I kinda think I see how that works. Could you post a pic when you have the wiring hooked up? Thanks!


----------



## halstaff

Not sure what I'm doing wrong but when I hook up the raven to the board, even without adding the 9V battery or hooking up any audio source and turn the switch on, he runs continuously. 
I think I've got him hooked up according to Jeff's drawing although I've tried to simplify it by removing the jacks and the led eye hookups.


----------



## JeffHaas

The Gemmy board uses the Mosfet to turn the power on/off, like a switch, so...

There's a simple way to test it: Connect a multitester to the leads going to the raven or skull, and set it for a continuity check. It should not beep. Then play an mp3 with a beep track through the Gemmy board...the multitester should beep with every beep on the track. (This is something I should've thought of before...I'll add it to the Instructable.)

Then test the raven on its own, you should be able to have a button that connects the raven's battery box to its motor, and be able to turn it on/off that way. I'd also check the actual voltage coming out of the battery box, and put the switch / mosfet in the negative line. Who knows if the wires they used in China are the right colors.


----------



## Otaku

Steve, I had this exact problem with Gemmy skulls when I was testing this board. Try reversing the battery wires. The circuit sinks the current through the MOSFET.


----------



## halstaff

Thanks Gary, that did the trick.
Here's a diagram of how I hooked it up -


----------



## JeffHaas

Small update...

I put an order into Tayda to see what they were like as a resource. I mentioned elsewhere that I got the order in about five days, with everything well-packed. Their web site forgot to tell me that the order was shipped until after I got it, but I figure they'll get that sorted out.

One of the parts I got was their stereo jack:
http://www.taydaelectronics.com/3-5mm-stereo-enclosed-socket-chassis-jack.html

Tonight I assembled a second copy of the board with that jack on it, clipping the extra support pins as mentioned in an earlier post. (If you have the board from SimpleCircuitBoards.com, clip the two pins that don't match up to the holes.) It works great.

Also if you don't want the tiny toggle switch you could just jumper across the holes. You'd lose the ability to swap the voice and beep tracks but as long as you're making your own anyway, it's not essential.


----------



## Otaku

Thanks, Jeff. So we can order all we need (except the board, of course) from Tayda?


----------



## JeffHaas

Yes, I just checked, everything except the mini DPDT switch. Here are the Tayda part numbers:

LM358 OpAmp	A-045
IC socket, 8 pin	A-001
Capacitor, disc, 0.1uF (104)	A-214
MOSFET, IRF510	A-088
10k ohm resistor (BRN-BL-OR)	A-2115
100k ohm resistor (BRN-BL-Y)	A-2071
4.7k ohm resistor (Y-PUR-R)	A-2027
1N4148 Diode	A-157
Slide switch mini DPDT	n/a
3.5mm stereo jack, PCB mount	A-853
9V battery snap	A-656


----------



## halstaff

I was looking at the board design and had a question regarding the unused pins of the op amp. Is it a problem to leave them open or should they be terminated? This may be a situation where I know just enough to be dangerous but wanted to check.


----------



## pshort

My inclination would be to not leave the unused input pins open. While the op-amp in question is not CMOS, and therefore not as susceptible to ESD damage or latch-up, I would still not want to leave the inputs open. My inclination would be to tie the '+' input to ground and connect the '-' input to the output of the same section of the chip. Just my $.02.


----------



## halstaff

I've done some research and am now really confused. However, I did find this which seems to be a common method -










The image on the left is one of the ways if you're using a common power source. How would you determine the size resistors to use?


----------



## pshort

The resistor size is not really critical. I'd choose some fairly large-value resistors, like 100K, just to minimize the current draw through the resistors. If you want the output voltage to be around VDD/2, look up the bias current for the op-amp and make sure the resistors are small enough so that the current through them is perhaps one to two orders of magnitude greater than the bias current. The bias current is about 20nA for those op-amps, so set the resistor current at perhaps 2uA. With a 5V supply the resistors could be as large as 1Mohm, or so. If you don't care about the output voltage of that section of the op-amp, you could make the resistor value even larger.

P.S. none of this is very critical.


----------



## Otaku

Agreed on the issue of leaving those unused pins floating, but I wasn't sure as to what to do with them, either. And once the circuit was working reliably I got lazy and never got around to doing anything about it.
I know the board is in production now, so to speak, but would the better choice have been the LM741 single channel op-amp?


----------



## halstaff

Here's what we came up with to terminate the unused pins -


----------



## JeffHaas

Oh man. NOW you guys tell me.

How much difference is this really going to make?


----------



## Otaku

Hmmm, looks like all of that can be add-ons to the trace side of the board. A couple of resistors and a jumper. Nice!


----------



## pshort

Despite the conversations that I've had, my inclination is to wait until the next rev of the board, and then to just use the second circuit in post #125. The LM358 should be pretty robust, and reworking existing boards would be more likely to cause problems than leaving it alone. My recommendation would be different if more delicate op-amps were used.


----------



## halstaff

The reason I went with the first circuit in post #125, is that I read that it's the proper one to use if you have a common power supply. If the second circuit (which was suggested for a circuit using dual power supplies) would work, it's an even simpler solution than what I showed as you don't have to add any resistors. 
I'm only going by what I read on the internet (and we all know how reliable some of that info is) so I'm just trying to learn the proper way.


----------



## pshort

OK, the two-resistor solution is fine. The output of the second section op-amp will end up at about 2.5V (or 1/2 of the supply voltage, whatever that is), which is not a problem. I'm not sure why the original designer intended that, but it avoids any possible concern with the op-amp output not going all the way to the negative supply rail (but who cares in this situation?)


----------



## JeffHaas

Hey guys, Jeff Wheat of SimpleCircuitBoards.com contacted me - apparently he saw this discussion. He's willing to update the board design he provides. I guess since he does them as one-offs it's easy to tweak things.

What would you suggest we go with? The version with the resistors, or the second one? I'm leaning toward the second one because the Instructable tells people to use a power supply for the board that's different than the one in the skull.

Also, I thought the reason this new design was done was to get rid of the problems the first design (from last year) had, where it shared a power supply with the prop - that one never worked right for me.


----------



## pshort

If the decision has been made to revise the PCB and given that there is already a 100K resistor on the board, I'd go with the first one.


----------



## Indyandy

Uhm, I am lost now. Are we using the diagram on post 128?


----------



## JeffHaas

I set this up on a breadboard and tried both versions of the circuit. They both work fine, there is no difference in performance. So I'll go with Phil's recommended solution and have Jeff Wheat use that for the update.

IndyAndy - Use the schematic on post #128.


----------



## pshort

JeffHaas said:


> I set this up on a breadboard and tried both versions of the circuit. They both work fine, there is no difference in performance. So I'll go with Phil's recommended solution and have Jeff Wheat use that for the update.


That's what I expected, no discernible difference in practice. I'm to used to the splitting of hairs that occurs over on doityourselfchristmas.com, of which I'm also guilty.


> IndyAndy - Use the schematic on post #128.


----------



## Indyandy

Ok, thanks.


----------

