Show Posts
Pages: 1 ... 70 71 [72] 73 74 ... 91
1066  Forum 2005-2010 (read only) / Interfacing / Re: Why are op amps used in sound circuits? on: August 18, 2010, 02:32:19 am
Why do people use logic ICs like Arduino when you could do the same thing with several thousand logic gates?

That's not what I was asking though.  

What I was asking was: Why use an op amp when you can use a single transistor?

The answer to why use a logic IC when you could do the same thing with several thousand logic gates is obvious.  But if all I need is to limit current to an LED, you wouldn't tell me to use a resistor ladder because resistor ladders can do much more than a single resistor can.

And my understanding of transistors, though severely limited, is that they can act like a digital switch, or they can vary voltage in an analog manner.  And in both cases, the portion of the circuit they control can potentially have a lot more current flowing through it than the portion of the circuit that controls the transistor.  

And that sounds like exactly the sort of thing I need to drive a speaker.

But then of course, there is the op-amp.  Completely mysterious to me, yet people seem to use them all the time in audio circuits to perform a task, which to my understanding, could be done by a single transistor.  But why use a (relatively) expensive chip when a single transistor costing pennies seems like it would do the job just fine?  That was my question.

And folks here have tried to answer that, though I'm still not 100% convinced an op-amp is needed here.  

I'm not doing high-fidelity sound playback.  And I don't think I need to ability to tailor the gain in voltage with two resistors, because I'm guessing if I put in 5v, the  DAC will output 5v.  And I don't need something which is versatile and can do "differentiation, integration, smoothing, summing, filtering, comparison".

But I understand this:
Yep, you could bang together some transistors and components to do this. Two stages of voltage amplifier for impedance match feeding into a complimentary pair of transistors and all the resistor dividers to get the bias correct along with proper feedback, interstage coupling capacitors and power decoupling capacitors. --> Or simply an op amp and a 100uF output capacitor as was done here

Even if I don't know enough about transistors to know why I'd need two of them, or interstage coupling capacitors, or power decoupling capacitors.  In fact, I'd assume I wouldn't need a decoupling capacitor on a couple transitors, but I've been told to use one on every IC, so I'd think one would be needed for the op-amp.

So I guess you could say that the reason for my initial question was that I didn't know so mny components would be needed to perform a seemingly basic function like taking the low current variable voltage output from my dac and converting it to a high current variable voltage output.  I thought I could just stick a transistor on there and maybe a diode or a resistor or two and be done with it.

I mean take a look at this example:

One diode, one transistor and it drives a motor.  How is driving a speaker all that different from driving a motor?  

I dunno!

That's why I asked. :-)
1067  Forum 2005-2010 (read only) / Interfacing / Re: Why are op amps used in sound circuits? on: August 17, 2010, 09:10:07 pm
I'm aware of how current, voltage, and resistance are related to one another.  I used an ohms law calculator I found online quite a bit when designing my last circuit.

The reason I was confused about how the op amp was driving the speaker was because the device was mysterious to me, and Wikipedia made no mention of it being a device which allows one to boost current.  It only spoke of voltage and multiplying it millions of times, and I couldn't see why one would need to multiply a 5v input millions of times, and why you couldn't just use a transistor if all you needed to to was increase the current.
1068  Forum 2005-2010 (read only) / Interfacing / Re: Why are op amps used in sound circuits? on: August 17, 2010, 02:28:47 pm
Thanks for all the info!

So if I understand you all correctly, the op amp not only can increase the voltage level if it's very low, but it also increases the current, and the current is what drives the speaker.
1069  Forum 2005-2010 (read only) / Interfacing / Re: Why are op amps used in sound circuits? on: August 16, 2010, 10:17:55 pm
"Audio levels are typically less than 1 volt."

Even if the input to the op amp is from a dac in my circuit, which is being supplied with the same 5v logic as the rest of the circuit?

I stil don't understand why you need to multiply the voltage.  I mean I guess if you did have 1v input to it you might want to raise that to say 5v or maybe even 12v, but would you really run a speaker in your circuit on 1000 volts?  I've never heard of such a thing being done.

My question here pertains to how the wave shield is using it.  So what is it doing in that circuit?

All the page on it says is this:
"The analog signal then goes into a high-output, rail-to-rail opamp. This op-amp can provide up to 100mA per channel. The two channels are hooked up in parallel for up to 200mA output (at 5V). This means it can provide 1/8 W into an 8ohm speaker (or 1/4 W into 4ohm speaker). This isn't enough for a boom-box but its good for headphones and small speakers."

So it sounds like the Op Amp is putting out only 5v.  So is the DAC putting out 5v, or 1v?  And if all it is doing is increasing the current, again, why can't a simple transistor do that?  A transistor does work in an analog manner doesn't it?  Wikipedia seems to indicate as much.  If the problem here is that the dac can't put out enough current to drive the speaker why isn't a transistor the solution?

I know you said an op amp has many transistors, but that doesn't tell me why you even need more than one to do this.
1070  Forum 2005-2010 (read only) / Interfacing / Why are op amps used in sound circuits? on: August 16, 2010, 07:44:59 pm
I was loking at the wave shield because I was thinking of adding sound to my project and I noticed they have an op amp:

Wikipedia says op amps can multiply a voltage difference millions of times.  But other than that it's not very helpful.  And that doesn't seem to make a lot of sense to me either.  Is it saying my 9v input will be multiplied by millions of times? I kinda doubt the wave shield has 9 million volts running through it.  Or even 5 million.  So what does an op amp really do?

Also, why use an op amp?  Why not a transistor?  Can transistors not vary output voltage with input voltage?  Or do they just do a crummy job of doing it smoothly or quickly that it doesn't work well for sound generation?
1071  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 25, 2010, 02:56:07 am
"So where is the retract button?"

The wings extended as long as the touch switch was held.  They retracted when it was released.

"It would be simple to have a left button for extend and a right button for retract, with the wings moving while button is depressed and stopping when released, with the servos just being used as gear motors."

That is one of the four modes of operation the user will be able to select with the dip switches.  

"Using a single servo on its side one could also drive the LED pot off of the servo horn."

That's an interesting idea, but the folks who'll be using this all want different methods of control, and besides it would be kinda difficult to mount a potentiometer so the servo horn would drive it without custom mounting brackets and gears or something.

I'd rather stick with the atmega though for this.  I would like to include accurate sound and though the chances of making that work are kinda slim, I need the microcontroller to try.  And if that fails, I still may be able to do arpeggios with the beeps to get something a little better than plain beeps.

"The long handle looks like 8 AAA batterys might fit, or even AA batterys."

That's something I'll be looking into.  I won't have the shell for another couple days to check, but I have a fullsize printout.  I'm not too confident 8 AAA's will fit in there though.  I've seen someone stuff a 9v in there sideways and it looked like it just barely fit.  So I think I'd be looking at 4 AAAs at most.  Maybe 4 AA's.  
1072  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 25, 2010, 01:42:54 am
Where/what are the specifications for being "movie accurate"?

Movie accurate simply means the the prop looks and behaves very closely to the way it did in the film.  There's no precise definition of what that means.  

If this gizmo is from ghostbusters, did they have arduinos or pic servo controllers back then?

Did they have microcontrollers in 1984?  No, I don't think so. :-)  

They didn't need them though.  The way this prop behaved was when you touched the left resistive touch switch, the wings would extend fully, and then you touched the right one, the wings would extend halfway.  This could possibly have been accomplished with a single 555 timer that could be set to two different speeds.  A second 555 timer paired with a 4017 decade counter would then provide the animation for the wings and screen.  That timer's speed was adjusted with the knob on the back.

Why aren't I doing things that way?  Well, they don't exactly play up that the speed of the lights is controlled by the knob on the back in the film.  Nor do they make it obvious the wings can only go to two different heights and these are controlled by the touch switches.  So what I'm making is an "idealized" meter.  One which behaves like the one in the film, but also behaves like you might imagine the device would behave if it were real.  

A real PKE wouldn't detect only two levels of activity.  And the wing height and speed of the lights would likely be tied together.  So I want to offer the user the option of using the PKE that way, because it'll be more fun to use.  The user can however change some dip switches to set the meter to prop-accurate mode where it would behave just like the original prop did.

Where are the electrical schematics for the gizmo pictured? How do you not know that the gizmo is not just an R/C setup controlled by a prop man off camera? How do you know that you are not trying to real world duplicate "movie magic" (is your gizmo also going to detect ghost and such like in the movie?). I looked at the film clip and I saw the wings move and the LEDs blink, but that is simple to duplicate without servos and such. Where is the technical basis for your duplication efforts?

The real prop was a rental prop, and if you go to the page that image is from:

You will see that a fan rented it and then took detailed notes on how it worked.  Unfortunately (or fotunately) he did not dismantle the circuit board, so nobody knows exactly how it functioned, but if I were a betting man, I'd say that it functions exactly as I described above with the 555 timer and 4017 chip.  Because that is the simplest and most likely setup and that is how the Proton Pack lights functioned.  (We do have schematics for those.)

So as far as movie magic goes, there is none in how the meter looks and functions visually.  It actually does everything you see in the film and is operated by the actor using the touch switches and knob on the back.  The only bit of movie magic with it is the sound.  But I kinda gotta try to replicate that. :-)
1073  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 11:17:21 pm
So all the current for everything in the circuit besides the servos would need to pass through this one diode then and as a result there would be a voltage drop?  And the capacitor is behind this diode with everything else?

It's kinda hard to search for axial diodes on Mouser when all they list are a hundred different packages many of which are SMT and I have no idea which is which, so I just searched the DO packages which I knew were axial and I found this one which they've got like 52K of:

Does that look like the right sort of diode to use?  It's a schottky, which I think the fellow in the other thread reccomended.  The voltage drop is only .47v.  It says it can handle 1A continuous, which I think should be plenty for my needs on the microcontroller side.  

Overall it looks perfect to me.  A little expensive, but I only need one.  What do you think?
1074  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 09:44:12 pm
Forget the caps stuff, just wire everything to a 12vdc car battery with a strap to carry it like a back pack. Paint it weird colors and tell them it's a nuclear reactor power supply.

Haha!  I live in an apartment building any my neighbor sees me building all this GB stuff all the time.  About two weeks ago, he says "I gotta ask... what's the car battery for?"  I'd left my car's battery charging in the hall cause it was dead and he thought I had it hooked up to some electronics project in my apartment.  

I had a good laugh cause it was a reasonable question.  I would do something like that. :-)
1075  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 09:36:06 pm
No, no, and no.  They are small  They are cheap (<$2) and they are not dangerous.

Huh.  I'd looked for some on Mouser and Digikey I think, but I was only able to find really large expensive ones.

Those are definitely interesting.  I don't have a clue how to translate farads into how many mA I'll get out for how many seconds at what voltage, but I'l try to figure it out to see where I might best make use of those.

You would feed it through a diode from the battery so that the servo motors couldn't draw any power from it.

I think I understand.  Would it need to be a special diode with a low voltage drop, or any old diode?

Dunno what the "50 capacitors" thing is about?

Oh I was just thinking if I needed a capacitor on every led or something.  Space on this board is so tight I gotta keep the number of caps and resistors as low as possible.  I've gone so far as to find 2mm headers and receptacles for the 8 conductor cables I need to run to each wing, and have even been considering SIP switches instead of DIP switches just to get that little extra bit of room.  

Think I may eventually need to learn how to solder surface mount components, but that's for another project.  (I did price out how much it would cost to have the PCB house do it.  Like $1500 for only 30 components on 10 boards!  Ouch!)
1076  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 09:06:39 pm
I've tried 47uf and 100uf caps.  And I asked folks here about how big of caps I'd need and they indicated they'd need to be positively enormous.  Due to space limitations I probably couldn't afford more than one cap about a half inch across and a half inch tall.  I dunno how much power such a cap would have but I don't think even it would be enough to smooth out the power spikes.

Even if I could find a supercapacitor small enough for my needs, I suspect one capable of supplying so much current would be expensive.  Might even be dangerous.

What's this about a seperate feed using a diode though?  Would said srotage capacitor be connected in parallel like a decoupling cap?  I think someone posted a schematic in my other thread which had a diode and a cap.  I think the diode was placed such that the capacitor was wired in parrallel and the diode was placed such that the cap could only feed one side of the circuit when it discharged.  They needed a zener diode or something with a low votlage drop.  Are you talking something like that?

Such a setup might work with the leds.  Don't think it could supply enough power to the audio and microcontroller though.  Not with the small caps I'd have to use.  

Would add a million more ways I could screw the circuit up too.  I try to keep these things as simple as possible cause I hardly know what I'm doing. :-)

Hm...I think I'm probably going to have to make the two battery solution work.  I mean I can't add 50 capacitors to the circuit just to make the leds not dim when the servos move.  That would take more space than the voltage regulator.  I'm fairly certain there's room for enough batteries.
1077  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 08:42:37 pm
I think your looking for a magic bullet to solve your basic problem, inadequate battery current capacity. Standard 9vdc batteries will never solve a current draw problem, they are just too wimpy (and expensive). While adding expense, rechargeable cells of higher current capacity is most likely the best solution. Nicads and nihm (as well as li-po) can be had in many different package sizes and can supply higher peak current then most non-rechargeable batteries.

So you are dealing with two battery constrains, higher enough current capacity to run the total static (baseline Arduino draw + support components) and peak (when the servos have to move) current and a desired battery duration time. There is no magic here just fundamental engineering calculations and trade-off decisions.

I'm not looking for a magic bullet, I understand there are tradeoffs which need to be made.  For example, if I stuck a resistor on there that would probably slow the servos down.  But in this case the servos don't need to move fast, so I could live with that tradeoff.  I can also live with short battery life if I have to.  But I can't ask people to pay $20 for a battery charger, and I don't want to add $10-$20 to the cost of the meters by having to ship rechargables with them.  I also don't want to do anything funky like solder the batteries together which would make it impossible for the end user to change them.

At this point I've already got a working prototype.  You can see that here:

And if I need to, I can go the two battery route.  The prototype there is running off 9v for the servos and USB power for the atmega.  

I just want to make sure there's not another solution I've overlooked.  I mean maybe a coil would help.  Or maybe instead of sticking big capacitors on the servos I could stick smaller ones across the leds.  I dunno.  There's so many things I still don't know about designing circuits.

I guess the extra battery route would be the least likely to have problems with different brands of servos though.

While I'm on the subject of a seperate battery again... anyone know of a through-hole voltage regulator which would be smaller than a TO-220 package would be when laid flat on the board, but could handle say 200mA of current?  I looked at tranistor shaped ones and those didn't seem to be able to handle that much current.  And I think the metal can ones weren't much better and were much more expensive to boot.  Are there any others I've missed?
1078  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 08:28:26 pm
Do the side-arm things need to be able to move at different rates/times? That is, could you get by with a single servo moving both arms? If so, that might reduce your power requirements, and free up some space for more batteries or other things...

I wish I could.  If I was making the plastic shells I'd go that route.  But the shells are made by other people, and they're not all the same, so the cheapest and most obvious solution wouldn't necessarily work for everyone.  The safest route to go is to use two servos because that can be made to work with most setups.  Most setups expect the wings to be mounted directly onto the servo horns for ease of installation.
1079  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 08:22:35 pm
Ah, the old startrek phazer/tricorder stage prop from post some time back! Waaaaaaay over done. The only thing it needs electronic is one of the below LED chase lits for the converging LEDs. To make the little arm things on the sides move, just make a simple thumb slide to make them flip around to the front, with a rubberband to pull the slide back when released. Lot simpler ways to get it done.

What?  Star Trek?!  BITE YOUR TONGUE MAN!

What I'm trying to do here is create the most accurate PKE meter available to date.  And it's hardly overdone, there's only one other fellow who makes the circuits and his aren't quite movie accurate.

The original prop used resistive touch switches and servos, so that's what I'm using.  To do otherwise would miss the point.

I wish I could save the trouble of having trimpots on the board for the servos to make sure the wings line up, and reduce my current needs by half by using a single servo, but the folks who make the plastic shells made them to be used with two servos and it would be hard to gear the wings together.

Rubber bands ain't gonna cut it. :-)
1080  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 05:35:44 pm
My power supply at the moment is either a 9v battery, or 6 AAA's.

I am building a replica of this prop:

Or rather, the circuitry that goes inside it.  As you can see, the space inside is very limited.  The circuit itself will need to be around 2"x4" to fit in there.   And the servos I'm using as much smaller than those there, but even so, I'm having trouble powering them and my board, and things are only likely to get worse because I want to try adding a dac, an amp, and a small speaker so I can play back more than simple beeps.

As I am building these props for other people, I can't simply solder together rechargable batteires as they've done here.  Rechargables are too expensive and require a charger, and the batteries would eventually need to be replaced even if I found a way to recharge them in place.  So, I need to use battery snaps or holders.

I've been considering sticking one 9v in the handle and another under the circuit board, though a 9v won't last very long with the servos drawing as much current as they do.  I think my last test indicated the battery would drop by about a volt after activating the servos 100 times.  I don't want folks to have to change the battery every day, so if I can fit 6 AAA's in there I will, but I'm still waiting on the shell to determine exactly how much space I have.  I think I might be able to fit six AAA's in there if I put them in a 3x2 configuration across the bottom.

The thing is, even 6 AAA's couldn't prevent the leds from dimming for a moment when the servos activated.  And if I include a 9v in the handle to power the Atmega and the leds (assuming one will even fit), then I'll have to have two TO-220 style voltage regulators on the board.  An LM317 to provide 4.8v to the servos, and a 7805 to provide 5v to the Arduino.  And having already laid the chips out on a board that is roughly the size I'll need, I know that I could really use the space that second regulator would take up for something else.  The chips are packed in like sardines as it is.

So if there is some simple method I could use which wouldn't take up much space on the board and would let me limit the servo's current, that's definitely something to consider.  It may not take up less space than the second voltage regulator, but I'm just hedging my bets in case I can't fit those extra batteries in there.  

And besides, I'm just curious if it can be done.  Maybe I won't need the solution now, but in a later circuit, who knows?
Pages: 1 ... 70 71 [72] 73 74 ... 91