Show Posts
Pages: [1] 2 3 ... 78
1  Using Arduino / General Electronics / Re: what resister values to use with a transister NOT gate? on: April 17, 2014, 04:05:12 pm
First, you shouldn't need a logic inverter on the Arduino output (or input).   You can invert the state in software... smiley-wink

And, when you need an inverter, it's more common to use an inverter chip (or other gate wired as an inverter) than to use a transistor.   The 7404 (and 74LS04, etc.) is the "original" inverter chip.

250 Ohms is OK for the base resistor (1k would probably work too).  The resistors depends on how much current you need out of the circuit.  

Quote website said most gates can only handle 20mA of current,
That's probably a good rule-of-thumb for a logic chip.   The Arduino is rated for 40mA maximum.    If you look at the transistor's datasheet, I'm sure it can handle more.  (And, you should check the datasheet before you use a logic chip.)

The way a transistor works as a "switch" is that it has current gain, and you want to "saturate" the transistor so the calculated collector-emitter current is more than the current allowed by the collector-resistor.     A typical transistor has a gain (hfe) of around 100.    

 - Let's say we have a 50 Ohm "load" (or a 50 Ohm collector resistor).   At 5V, that's 100mA.

 - If the transistor has a current gain of 100, you need 1mA into the transistor's base.   That's 5k Ohms.

 - Since we want to be darn-sure to saturate the transistor, it's a good idea to cut the base resistance in half.

 - With a 2.5k base resistor, the we can be sure the transistor will remain saturated with loads of 50 Ohms or more (collector current of 100mA or less).
2  Using Arduino / General Electronics / Re: Help identifying ground lead and signal of switch. on: April 17, 2014, 03:45:40 pm
This is a single-pole, double-throw switch (SPDT).  We don't know anything about how you want to use it...

It's not unusual to use only two of the terminals with a microswitch  (common and normally open or common and normally closed).  With two terminals it works like an ordinary on-off switch.

If... the 3 connections are power, ground and "signal", signal would go to common ("C").   The power probably goes to normally open ("NO") and ground probably goes to normally closed ("NC").    If it seems to work "backwards", reverse the power & ground.   

If power AND ground go the the same switch, NEVER connect power OR ground to common.
3  Using Arduino / Audio / Re: Small Class D amplifier on: April 17, 2014, 01:19:46 pm
i am hoping I can put several in parallel to dropthe eff resistance to whatever the minimum the amp can handle
A Bad, bad, bad, idea! smiley-sad   The general rule is NEVER connect outputs together. (That's why you use an audio mixer to mix audio signals.)   Solid state amplifiers have very low internal source impedance (often less than one Ohm).   The output of one amp "shorts out" the output of the other.

The most common "trick" is to make a bridge amplifier.    That doubles your peak-to-peak output voltage (theoretically 26V P-P = 9V RMS) with a 13V power supply) and that gives you 4 times the power into the same load.  Doubling the voltage doubles the current, so an 8-Ohm speaker "looks like" a 4-Ohm speaker to each amplifier.   In theory you can get about 10W into 8 Ohms, but there is some voltage drop across the transistor/MOSFET and you can't actually get the full power supply voltage across the speaker.

High power automotive amplifiers have a voltage-boosting power supply.

4  Using Arduino / General Electronics / Re: Will this voltage doubler works with DC input? on: April 17, 2014, 12:28:42 pm
What's the voltage used for and how much current do you need? 

For a "signal" (very low current) you can double a voltage with a simple op-amp circuit, but you need to power the op-amp with slightly more than you are trying to get out of it.

There are fairly simple capacitor-oscillator based voltage doublers if you need a small amount of power and you don't need efficiency (they do require a chip or other active circuitry).   

If you need to "power" a circuit, you need an inductor-based voltage booster (again they require active circuitry).   These are very efficient, but of course  you can't get more power out than you put in...  So if you double the voltage, you cut the current (approximately) in half.   But normally if you are gong to power something, you start-out with enough voltage...  Boosting (or inverting) the power supply voltage is usually a "last resort", like if you need to run something off a car battery and it needs more than 12V, etc.

Actually its a pretty small circuit so I'm using 2AA battery.  I need about 6v in my application
4 AA batteries. smiley-wink
5  Using Arduino / Project Guidance / Re: Driving a 150 ohm speaker on: April 16, 2014, 06:56:34 pm
First - You should NOT connect an 8-Ohm speaker directly to the Arduino!  If you are using an 8-Ohm speaker, you need a series resistor to limit the current.  (This will also reduce speaker volume.)

A 150 Ohm speaker will simply draw less current.   You don't have to change the software (sketch).

The Arduino is rated for 40mA maximum.   From Ohm's Law, 5V/8 Ohms = 0.625 Amps (625 milliamps).   You're not actually going to get 625mA... But Ohm's Law is ALWAYS true...  The voltage is going to drop, and the Arduino is going to overheat and possible get fried.   

...and the only commercially available speakers (digikey) have 150 ohm resistance.
As my old boss used to say, "Stranger than truth!" smiley-grin   Most speakers are 8 Ohms.  Most car stereo speakers are 4 Ohms.
6  Using Arduino / General Electronics / Re: Amplifying Audio signal for use with TIP31 power transistor and LED array on: April 16, 2014, 03:21:21 pm
You can turn on & off* LEDs with a transistor, but making a linear amplifier requires a few resistors & capacitors, and some careful design.   Depending on how much gain and you need, you may need multiple stages (with at least one transistor in each stage).   Here is an example. 

Sure, in the "old days" amplifiers were designed with discrete transistors but it's a LOT easier to use op-amps.   With an op-amp circuit you just need two resistors to set the gain.  (But most op-amps only about enough current capability to drive one LED.)

* With PWM (built-into the Arduino) you are turning the voltage on & off rapidly and that allows you to dim an LED (or appear dim, or off, to the human eye).    With PWM, you can use a single transistor or MOSFET in a simple circuit to "boost" the voltage/current and dim/control multiple LEDs.
7  Using Arduino / General Electronics / Re: Is it necessary to have both a digital and analog oscilloscope? on: April 15, 2014, 06:45:00 pm
I don' think you can even buy a new analog 'scope from a "serious" test & measurement company like Tektronix or Agilent.    Where I work, our last analog Tektronix 'scope died several years ago and I've never missed it.
8  Using Arduino / General Electronics / Re: Limiting current to motor? on: April 15, 2014, 06:36:16 pm
Oh, and I'm going to be controlling this motor with PWM.
PWM will do the trick!  ...Wth a transistor or MOSFET to "boost" the voltage & current...  You can't run a motor directly from the Arduino output.

A resistor will work, but it will have to dissipate power (heat) so you have to have the a big enough resistor and it's inefficient.  And, you'll probably have to try a few different resistor values to determine what value you need.

Ie, how would it affect the speed and torque?
Torque, speed, and load are related.  Often in an "unpredictable" way...  For example, if you limit the current to a fan-motor it will slow-down.   But if you remove the fan, there is less load and the motor will run faster.    If you want to precisely control the speed of a DC motor, you need some sort of RPM sensor.
9  Using Arduino / General Electronics / Re: Uno's analog pins and short circuits on: April 14, 2014, 02:51:41 pm
It's generally OK to "short" input pins because they are simply "reading" or "sensing" a voltage.   As long as you don't connect an input pin to a negative voltage, or a voltage greater than 5V, you are safe.    You can safely connect two inputs together, although you shouldn't have a need for that very often.

However, you should never short outputs.  For example if you connect (short) an output pin to ground, you'll get excessive current and possible damage when software tries to make the output pin go high.   Or, vice-versa if you connect an output pin to +5V (or any fixed voltage).   Or if you connect two outputs together,  one output may be trying to go high while the other is trying to go low, they will "fight" and again excessive current and potential damage.

The above is true for both analog and digital inputs/outputs.      The question comes-up in audio once in awhile.... It's OK to connect the inputs of two amplifiers together to run two amplifiers from one CD player, but it's NOT OK to connect the outputs of two CD players together to run two CD players into one amplifier  (for that you need an audio mixer).
10  Using Arduino / Audio / Re: Does a Customize-able Led Visual Music Display Exist? on: April 10, 2014, 06:14:29 pm
What you are looking for is called a spectrum analyzer.  A spectrum analyzer is actually a scientific/engineering instrument, but I think you want a spectrum analyzer effect.  (You are not trying to make accurate measurements.)

With an LED spectrum analyzer, each column of LEDs represents a frequency band with low frequencies (bass) on the left and high frequencies (treble) on the right.

DISCLAIMER - I've never made a spectrum analyzer.

This is going to be a part of a larger project, and all 4 LEDs in each blue square can be connected to one output pin.
So, that's 6 frequency-bands.    There is a nifty 7-band chip called the MSGEQ7 (available from SparkFun).   It takes a line-level signal, filters and "measures" the levels in 7 different bands, and multiplexes 7 varying DC voltages into one Arduino input.    It requires some special programming to "read" the 7 voltages at the right time and keep them straight, but you can download it and it's a LOT simpler than FFT.   and, one chip takes care of all the circuitry on the input-side (two chips if you want stereo).

If you don't want to use all 7 bands, you'll still get good "LED action" out of whatever bands you use.

Sacrificing 18 pins will be hard (one for each 2x2), so if this is possible to do this with any less I'll take that opportunity.
If you don't need dimming and you don't need to control RGB LEDs, The most common solution is a shift register.   A shift register takes-in  serial data (a sequence of ones & zeros) into one pin  (plus a couple of control pins).   The output comes-out in parallel with as many bits (or LEDs) as you wish.   Here is some information to get you started.    I recommend that you experiment (and learn) about shift registers before you jump-in and try to build the whole project.

I know that most of them usually involve having an audio file set-up before hand.
Usually not...  Especially an effect like a spectrum analyzer that's supposed to look like it's controlled by the music.  You might find something like that pre-programmed when the show is repeated over-and-over, such as a stage play, a big concert tour, or a show at Disneyland, etc.  But most "dance" lighting effects are sound-activated.   Most "dance" lighting effects that you buy (such as American DJ or Chauvet) can be either sound activated or DMX controlled.    DMX can be programmed, but DMX lights (and stage lighting) are usually operated by a human at the "lighting board", sometimes along with with some programming. 

I built an 8-foot tall  "Giant VU meter" effect with 24 LEDs in each channel (left & right).   (It only works off the volume, nothing is frequency activated.)   I used 3 MAX6978 chips cascaded together in each channel.   I only needed 4 Arduino outputs and I can individually control/address 48 LEDs.   Each channel has it's own data pin, but the clock and latch pins are shared.   Since I have a microcontroller and I can address the LEDs individually.... This effect randomly runs in the normal "bar" mode, "dot" mode (one LED on at a time), it runs in reverse (top to bottom), and inverted (LEDs turned-off with sound instead of on), and it does 7 other sequencing effects with many different patterns & options.

11  Using Arduino / Audio / Re: audio input and volume on: April 09, 2014, 01:51:52 pm
What's powering the speakers? Typically you'd already have a receiver (or preamp or integrated amp) with an input-selection switch.*   And, hopefully you have an amp for each room, or a 70.7V constant-voltage system?   (Connecting a bunch of speakers in parallel lowers the impedance and that can damage your amplifier, and you need separate amps if each room can select different audio sources..)

For the inputs can I use 4 relays?
Yes.  A double-pole double throw relay for each input.  Or, you could also use a digitally controlled Analog Switches.    (If you are going to build this thing, I'd add a couple extra inputs for unknown future requirements. smiley-wink )

how can I reduce and increase volume?
A Digital Pots, assuming you are controlling line-level signals (not the speaker outputs).  A digital pot won't "increase" the volume, but you shouldn't an additional gain stage.

Im absolutely new to hardware, and want to get started
I suggest you tackle one part at a time.   I have a feeling the IR remote is the most difficult part and I'd start by turning on & off an LED (and then maybe dimming the LED).

You can also build & test the relay switching separately, and the digital-pot volume control separately.   There are at least 3 different kinds of digital pot.   I've never used a digital pot, but I believe there is a type that you simply feed-in an up-down pulse and that seems like the simplest to interface & "program".

* It's OK to connect more than one input together.. So for example, you can use Y-Adapters (splitters) to connect the CD player output into 4 amplifiers/receivers.   However, it's NOT OK to connect multiple outputs together, so you can't connect the CD-player output to the radio output.    For that you need relays to select one output at a time, or a mixer to mix the audio signals.

12  Using Arduino / Audio / Re: Mic input and Speaker output using arduino, NOTHING ELSE on: April 08, 2014, 02:47:02 pm
It would be fine if the voice is not recorded and just a mic system is created which will not record sound but output it as it is input at the same time.
For that you can use an Amplifier Chip.  You don't need a programmable microcontroller.  You'll probably want one where you can adjust the gain.   You'll need a gain of around 100 (40dB) depending on how loud the sound hitting the microphone is and the sensitivity of the mic.  Then, you may want to add a pot at the input to adjust the volume.

Typically, you'd have 2-stages, a preamp to boost the microphone signal (millivolts) to line level (about 1V), and a second "power amplifier" stage to drive the speaker(s).     But, you can probably get enough gain with a power amp chip.

BTW - You also need a preamp with the Arduino (or a microphone breakout board with a mic and preamp).
13  Using Arduino / Audio / Re: Read amplitude from piezo buzzer on: April 07, 2014, 03:07:07 pm
If you are not using a pot, there's not much point in "reading" the level since your software should already know.

A 50% duty cycle will give you the loudest sound (with a fixed 5V square/rectangular wave).  A duty cycle of zero or near 100% will be silent.

This will also change the harmonic content, so it will change the "character" of the sound (without changing fundamental or perceived the pitch).   You might not notice the change of character with high-frequencies & piezo, but you'd notice it with lower frequencies and a speaker.
14  Using Arduino / General Electronics / Re: Help with peak detector circuit... on: April 07, 2014, 02:58:50 pm
This particular design uses comparators instead of op-amps.  The principal is the same, but the output is pulled-up bu the 10K & 4.7K resistors, instead of an internal transistor.   This is slightly "safer" because the capacitor charging-current is limited by the resistors.  With an op-amp, you can get excessive current through the output stage when the output switches and the capacitor suddenly starts charging.  The downside is that the capacitors charge more slowly and you might not "detect" some short-term peaks.

Note that the feedback to the -input (pin-2) is connected to the diode's cathode.  The voltage here is your reference voltage and it's also the (unbuffered) peak-detector output output.

The 2nd amplifier stage is a buffer amplifier.  It has a gain of one, so whatever voltage is on pin-5 also appears at pin-7.  The buffer amplifier has high input impedance.  The purpose of the buffer stage is to "isolate" the capacitor at pin-2 so that it discharges into the 100K resistor ONLY and the discharge time is unaffected by the load (whatever is connected to pin-7).

With that background... Here's how it works -
Starting with an output of zero, let's say you apply 1V to the input (pin-3).   The positive voltage on pin-3 is greater than the zero-voltage on your reference, so the op-amp's output (pin-1) swings positive.   The voltage rises until the voltage on the other side of the diode (the output & reference voltage) hits 1V.    The output/reference won't go above 1V because if the - input is greater than the + input, the op-amp's output swings negative.

Now when the input drops below 1V (or goes negative), the op-amp's output (pin-1) swings negative, but no current flows through the diode.  The capacitor at pin-2 holds the peak-detector's output-voltage (the input to the buffer stage) and it "slowly" discharges into the 100K resistor. 

At 0.1uF and 100k, you have an RC time constant of 1/100th of a second.   That's "slow" for electronics, but it's a little fast for humans & digital voltmeters.     For audio peak-detection (to control lighting effects) I use a larger resistor (maybe 1M or 10M) so the capacitor discharges more slowly and the voltage is "held" longer. 

Some peak detector circults leave out the resistor that's in parallel with the holding-capacitor and replace it with a switch.   In that case, the peak is held indefinitely until it's shorted-out with the switch (or until the capacitor self-discharges).

Even though I did some research about it and some others peak detector circuit I didn't found nothing that would explain how this really works.
If you know how op-amps and comparators work, and you understand inverting & non-inverting amplifiers, and buffers work, you should be able to figure-out what this circuit is doing,
15  Using Arduino / Project Guidance / Re: Guitar Pickup Winder on: April 03, 2014, 10:33:43 pm
I figured steppers because I don't care if it takes 4 hours to wind or 20 minutes,
That's a design decision and it's up to you!  A stepper (or servo) would be appropriate for the back-and-forth movement.     Rotating the winder with a stepper would mean that you don't need a mechanism to count the rotations because the software can count the steps.    On the other hand,  you don't need the 1.8 degree precision of a stepper, a DC motor is easier to power, and it will run faster.

So I guess I will have to settle for an approximate resistance target based on either revolutions and/or approximate length of wire used.
It would be the length of wire used.  The number of rotations doesn't affect resistance except as it relates to the length of wire used.     If you measure the length accurately, the resistance calculation should be very-accurate.    It would be less accurate if you try to estimate the length from the number of turns, but you might be able to get close enough.   

Or if you are willing to take the time, you can wind-on a little extra wire, measure the resistance, then pull-off several turns cut wire and take another resistance measurement,  and repeat 'til you hit the target resistance.

OK..  I've got a CRAZY IDEA!

If you can figure-out a way to make connections to both ends of the wire while it's spinning....  The resistance from end-to-end isn't going to change but the inductance is going to increase as you add turns.     So, you could measure the inductance while you wind.

You'd have to figure-out how to measure inductance.  It would require a high-frequency oscillator and measuring current and/or voltage get the inductive reactance and calculate the inductance.

And, you might have to re-spool the supply reel onto a larger (non-magnetic) spool, to minimize the inductance of the supply spool.
Pages: [1] 2 3 ... 78