Show Posts
Pages: 1 ... 38 39 [40] 41 42 ... 86
586  Using Arduino / General Electronics / Re: Convert 48V Phantom Power to 9V on: April 29, 2013, 06:01:54 pm
Is it possible that the sound card phantom power isn't able to sink enough current to make work properly the 7809 or LM317HVT converters?
The regulator itself (with no load) doesn't require any significant current.  You need to be concerned with the voltage into the regulator, the voltage dropped across the regulator, and the current through the regulator to the load.

And, I would guess that the current required for an electret microphone is no problem either.  If you start "pulling" significant current, the regulator can overheat since you are dropping 30V across it.  (Heat = Power = Volts x Amps).  If you don't know the current required, and if you can't measure it, you'll just have to try it.  If the regulator gets too hot to touch, you need a heatsink or some other solution.   

I agree with Mark, and I'd stay-away from switching regulators in a microphone preamp circuit (where you want the lowest possible noise).
587  Using Arduino / General Electronics / Re: Lighting 8-12v RGB led with arduino on: April 29, 2013, 03:53:05 pm
No...  A voltage divider won't work!

With a high-power LED (1W or more) the best solution is a special constant-current LED power supply. (You can build one or buy one.)   

If you connect anything to a voltage divider that requires significant current, the resistance of whatever you hook-up, messes-up your calculated voltage.  Voltage dividers work fine for low current "signals", but not as power supplies.   LEDs make the situation worse since the resistance of an LED is not constant.

LEDs are not powered (properly) by a constant voltage.  You need to supply a constant (or approximately constant) current with enough voltage available to turn-on the LED.

You can create an approximately-constant current source, by using a series resistor (the voltage gets divided a lot like a regular voltage divider).   You subtract the rated LED voltage from your supply voltage to find the voltage across the resistor.    Then you use Ohm's Law to calculate the required resistance from the required current and the voltage across the resistor.  (In a series circuit, the voltage is divided among the series components but the same current flows through all components.)   

For best results, the supply voltage should be twice the LED voltage, so the voltage across the resistor is at least equal to the voltage across the LED.  The more voltage you have across the resistor, the closer you are to a constant current source.

A series resistor works fine for regular low-power LEDs.  For high-power LEDs, you need a high-power resistor.  Power is calculated as Voltage x Current.   So, with 12V across the resistor, it will have to dissipate the same (approximately) 3W as each LED element.

It's inefficient, the resistors get hot, and this is the main reason for using a proper constant-current switching power supply.
588  Using Arduino / Audio / Re: Using a microphone with Arduino on: April 29, 2013, 02:04:54 pm
The signal from a microphone is typically too weak (usually a few millivolts).   You can get more signal (maybe one volt) with loud sounds, such as with a microphone in front of a kick-drum or in front of a guitar amplifier.

You can make a microphone preamplifier yourself or use something like this.  (Condenser mics also require a power supply.    The mic input on a computer puts-out 5V to power an electret condenser.)

Another consideration is the AC signal.  The Arduino can't handle signals that go negative.    I believe the SparkFun board puts a 2.5V bias on the signal, so that it can be used directly, and it also provides the power to the condenser mic.

Another question, how would the Arduino tell the difference  between a 2 shouts and 2 claps, they are both loud and short?
I'd try to do it with timing 1st.  It's hard to shout for a time period as short as a clap.    Look for a sound that doesn't last long (probably less than 1/10th of a second) followed by another sound that doesn't last long.    If that doesn't work, there are FFT software libraries that analyze the sound spectrum.  (I've never used FFT myself.)

A simple R-C high pass filter might help too (to knock-down low-pitch sounds).   But, a high pass filter would kill the 2.5V bias if you use the SparkFun board, and that surfact-mount board might be difficult to modify.

589  Using Arduino / Project Guidance / Re: Hardware reliability question on: April 29, 2013, 01:36:53 pm
I'm going to guess that's OK.   There may be some rare cases where the input to an unpowered device may present a low impedance and stress the source/driving device.   

If you have a multimeter, you can measure the current from the Arduino's power supply to see if it jumps with the LCD powered-off.  You need to be masuring the current into the Arduino only, not the LCD or anything else.   (The Arduino's outputs are rated at 40mA, so if the current draw jumps by 40mA or more, that could indicate a problem.)   
590  Using Arduino / General Electronics / Re: Power supply outputs 0mA ?? on: April 25, 2013, 05:43:28 pm
I was surprised by one of them, which should output 9VDC and 350 mA as written on the sticker, but in reality it outputs 16VDC and 600mA, nearly the double ... Before I measured it, I used it to power the Arduino, hopefully only for a few minutes, and I will never use it again for this purpose...
A power supply does NOT push-out current, and a power supply of the proper voltage and a very-high current rating will not harm your Arduino!    The current rating on a power supply is the maximum that you should take from it, and the actual current depends on what you've connected.

You can usually get more current out of a power supply than it's maximum rating... But, it might burn up.   

Per Ohm's Law, current flow depends on voltage and resistance (or impedance).   Resistance means "resistance to current flow".

In the USA household power is 120 VAC (RMS), and most power outlets are rated at 15 Amps.  With nothing connected the 120 Volts is there, but there is zero current.    A 100W light bulb "draws" about 1 Amp.  (100W/120V = 0.83 Amps).    A toaster or hair dryer might require the full 15 Amps.  If you run a toaster and a hair dryer at the same time from the same circuit, you'll "pull" more than 15 Amps, 'till the circuit breaker blows.

With nothing connected, there is infinite resistance and zero current.  With a short circuit (zero ohms) you theoretically get infinite current (as long as there is some voltage).   In the real world there is no such thing as zero-resistance.  The power supply has an internal resistance and if you short the output, the voltage will drop to zero and you may burn-up the power supply.    (Ohm's law is always true, so the voltage must drop if the power supply can't supply the "calculated" current .)   
591  Using Arduino / General Electronics / Re: Does input via optocoupler need a pullup resistor ? on: April 25, 2013, 04:59:06 pm
So you are saying that the 5V+ and the Ground should be separated / split between the Arduino and the external sensor.
If there is any electrical connection between either side of the opto-isolator, it's not isolated.   

It can "work", but the LED-side of the optoisolator needs it's own separate power supply and it's own separate ground, or else you're not electrically isolated. 

However, the Arduino on-board pull-up resistors are of little use, as the wire from the sensor is effectively isolated from the Arduino.
The internal pull-up should work fine with the optoisolator.

If your "sensor" is shown accurately as a pair of contacts (and if you don't need isolation) the sensor should also work directly into the Arduino with the internal pull-up (and no other components).  i.e. If it can pull-down the LED inside the optoisolator and turn it on, it should be able to pull-down the (internally pulled-up) Arduino-input.   It's actually "easier" to pull-down the Arduino input than to turn-on the optoisolator's LED (it takes less current).

If it's truly a relay and there are no other connections to the contacts, it's already isolated.   A relay provides mechanical isolation, since there is no connection between the relay-coil and the relay-contacts.
592  Using Arduino / General Electronics / Re: My ground wire was on fire please help me on: April 24, 2013, 07:33:08 pm
OK... Heat is caused by current-through-resistance.    So you are correct that a smaller wire (with higher resistnce) wil heat-up more than a large wire.

If everything is wired correctly, the problem could be at the wire terminations.   I assume there is some sort of crimp-on terminal at the wire end(s)?   If you have some corrosion, or if the crimp started to come loose for some reason, you'll have a high(er) resistance connection and you'll get heat.   In that case, it might be apparent which end of the wire is burning-up.   Although if the insulation completely burned-off, it might be hard to tell where the fire started.   If you replace the crimp-on terminals, you might consider crimping and soldering,

If the resistance is OK, the other option is excess current.   If the the only current path is for that wire is through the motor (and if your relays are not shorting-out the motor), you shouldn't get excess current.   If you put a load on the motor, it draws more current.  But I assume you should be able to stall the motor withotu starting a fire!     As long as the motor is still working, I would assume the motor is not drawing excess current.

smiley-grin Doesn't that Barbie Jeep come with a Barbie fire extinguisher?   Maybe Ken has one in his Jeep!   smiley-grin
593  Using Arduino / Project Guidance / Re: RS-485 Circuit, isolated & stable, well as much as possible! on: April 24, 2013, 07:02:27 pm
If you are sure you need isolation, a quick search turned up the LTC1535.  Since RS-485 is differential, it has fairly good noise immunity and you may not need isolation.

...but I'm not sure what isolation (diodes, or whatever)
There are 3 isolation methods -   Optical, electromagnetic (transformers), and mechanical (relays).  Optical is usually the best & cheapest.   Transformers have a limited bandwidth (i.e. They don't work at all with DC).  Relays only work with DC.
594  Using Arduino / Audio / Re: [start] arduino to rec only certain sound (activation trigger on spectrum) on: April 24, 2013, 05:58:28 pm
...Sounds like DSP to me! smiley-wink

I know there's an FFT library, but I've never done any DSP.

What you are trying to do is not that easy.   For example, every time the dog barks you get a slightly different sound at a different volume.   

It can probably be done...  There is voice recognition and speech recognition.  But, I don't know if it can be done on an Arduino.   And there will be "false alarms" (false positives) and "misses" (false negatives).   So, it becomes a matter of trying to minimize the errors,  and balancing  (or biasing) the remaining errors to build a useful system.
595  Using Arduino / Audio / Re: audio to relay on: April 24, 2013, 03:48:32 pm
Simply use digitalWrite() instead of analogWrite().  And, take-out any code that sets the "analog" PWM values.
596  Using Arduino / Audio / Re: start circuit with condenser mic on: April 24, 2013, 03:44:50 pm
if is exactly right.   if is the most common way for a program to "make a decision".     But somehow you've made a mistake in your code.  Can we see it?

Don't put a semicolon at the end of your if-statement.
And if the true-condition is supposed to execute more than one line of code, use curly-brackets.

Something like:
if(analogRead(1) > 200)
   digitalWrite(13, HIGH);   // Turns-on LED

(I haven't checked that code snippet, so I hope I didn't make a stupid mistake myself.   But that's the general idea.)

You can troubleshoot your code by simplifying...  For example, turn on an LED instead of the motor.  Or, take-out the if-statement, or force the if-statement to always return true by changing it to if(1), etc.

You'll also have to decide what to do after turning-on the relay...    For example, delay and hold the relay on for awhile.  If you run your if-statement in a tight loop, the Arduino's output will switch on & off when the level goes over/under 200 and the relay will either "chatter" or never come on, since mechanical relays don't come-on instantly.

597  Using Arduino / Project Guidance / Re: Use 9v battery on Uno +4 9g servos--would it be a problem? on: April 24, 2013, 02:46:14 pm
You need to check the current rating (mA) on the servos.  Your total current draw is the sum of the servo currents plus the Arduino current.    That will tell you about how long your battery will last, and if you can use the on-board regulator.

I read another thread saying he used 9v battery and it ruined the board? I am scared.
If you want to be safe, do what CrossRoads says and don't power the servos from the Arduino...[/b]  Just sent the control pluse from the Arduino to the servo.    It's best not to power anything other than a few LEDs from the Arduino's voltage regulator and if you need to power more stuff (like motors), you'll need to make some calculations to see if it's possible.    I would guess that when you make the calculations, you'll find that the 4 servos are over-stressing the Arduino's regulator.

The more current you draw through the Arduino's voltage regulator, the hotter it gets.   And the more voltage you "drop" across the regulator, the hotter it gets.   (Power is calculated as Voltage x Current, and the power is dissipated as heat.)

Of course, any power wasted/dissipated in the regulator has to come from the power supply or battery.  This shortens battery life.    With 9V into a linear regulator and 5V used in your circuit, you are wasting almost as much power as you are using in the Arduino & servo.

Switching regulators are more complicated, but they can be almost 100% efficient.   Under normal conditions, you'll get more current-out of a switching regulator than goes-in.  (It's not more than 100% efficient and the voltage-out is less than the voltage going-in, which is the whole point of a voltage regulator.)   

The energy in a battery is related to it's milliamp-hour rating.   A 9V Energizer battery is rated at about 500mAh.   So at 100mA, it can go for about 5 hours.*    At 500mA, the milliamp-hour rating is reduced, and you can go less than one hour.

* IIRC A battery is considered "good" down to about 80% of it's full-charge voltage.   So, you'd be at about 7V and the battery could power the Arduino for awhile longer.
598  Using Arduino / General Electronics / Re: Opamp mystery on: April 24, 2013, 12:30:15 pm
What's the voltage gain of your circuit?  My "gut feeling" is that gains of 1000 or more are "difficult".   And DC is more difficult than AC, since with AC it's easy to filter-out offset & drift.

when I substitute a very low Vio opamp (OP07A, Vio = 10uV) for the original LM358 I used, the output errors are more like 1 volt!
In a high gain circuit, that might be "normal".   How would you characterize that error?   If it's a constant DC offset (bias), you should be able to calibrate it out (in hardware or software).

There are 4 or 5 different types of error in a measurement like this:
1. Offset -    This is a constant-voltage or constant-count error.    For example when you are measuring volts, you might always read 1 Volt high.   It is normally calibrated-out by "zeroing" (adjusting your system so that zero reads zero).

2. Gain -   This is percentage-of-reading error.  For example, your reading may be a constant 10% high.   This is normally calibrated-out by adjusting the gain so that the maximum-range reads correctly (after zeroing).

(Offest and gain adjustments are standard in just about every measurement calibration.)

3. Nonlinearity - Once the zero & maximum are reading correctly, intermediate readings may be high or low.  With software, you can make one or more different gain adjustments to different sections along the range.  But, this kind of calibration-adjustment is not that common.  It's usually not needed and it's only used when high-precision is required.  And, it's only useful when noise & drift are lower than the non-linearity.  Where I work, we have a digital-to-analog converter that's calibrated at 100 or more points along the slope.     (This can get tricky, because there can be discontinuities where the gain suddenly changes.)

4. Noise - Random variations.    Sometimes you can reduce the noise pickup/input, sometimes you have to build a lower-noise circuit (if possible).

5. Drift - Slower variations or lower-frequency noise.   The system may read high for awhile, and then start reading low.    Again, you have to build a better circuit (if possible).
599  Using Arduino / Project Guidance / Re: Battery operated servo! UNO on: April 23, 2013, 07:22:41 pm
You could use three big diodes in series to drop the voltage to the servo from ~6v to ~3.9v.
It's a cheap-and-dirty solution, but I'll admit I've done something like that.*   But I don't feel  good about it! smiley-grin     

The problem is, that you are regulating the voltage drop (and not regulating it very well) instead of regulating the voltage supply to the servo.    So as the battery voltage drops over time, the servo voltage will also drop.   And as a percentage drop, the servo drop is worse!!!    When the battery voltage drops by 1V (from 6V to 5V),  that's a 17% voltage reduction.  But with an approximately-constant 3V drop across the diodes and the batteries down to 5V, you'll only have 2V remaining for the servo.  That's a 33% voltage reduction to the servo.     

So, you end-up with something that's the opposite of a voltage regulator!   The output-voltage has more variation than the input-voltage (as a percentage).

* I used a string of "big" diodes in front of a some linear regulators to reduce the voltage, so that the regulators would run cooler.      But switching regulators would have been a much better solution.   And if I ever build one of those gizmos again, or if I rebuild that one, I'll do it right!
600  Using Arduino / General Electronics / Re: Zero crossing detector on: April 23, 2013, 02:10:13 pm
I assume the input to your comparator is isolated from the AC?  i.e. From the secondary of a transformer?

But so far the i have tried using basic zero crossing circuits like comparator comparing the sine wave with a ground but to no avail.

That's how I did it... Is the comparator "firing"? (Is the output changing state?)   If the comparator is running from a single supply, it might not work near ground.    If the comparator is running from positive & negative supplies, it should work fine and put-out a square wave.     

If you have a single supply, you can set the reference voltage higher, and calculate when the actual zero--crossing occurs.

Actually, it's probably better if you set the comparator reference to around 45 degrees (half the peak AC voltage).      The actual-exact zero-crossing is difficult to detect.  If your detection circuit is detecting small voltages, a little noise on the AC line near the true zero-crossing can give you a false-trigger.   The peak is even more difficult, since the AC voltage vaires a bit.   Somewhere in-between is more ideal.
Pages: 1 ... 38 39 [40] 41 42 ... 86