Show Posts
Pages: 1 ... 39 40 [41] 42 43 ... 88
601  Using Arduino / General Electronics / Re: LM335 temperature sensors on 10m of speak wire (Help!) on: May 01, 2013, 03:21:53 pm
Quote
So when I go above 45 degrees I get a figure of -40 all because I used int instead of unsigned int...

... just realised that when int is asked to store the number 32800 it rolls over and becomes -32734.
Congratulations for finding that!  It's not easy, because there's nothing special about the number 45.   There's also nothing special about the reading from the ADC, and it will just max-out/clip... The ADC never rolls-over or puts-out any "funny" numbers.

Once you've seen a problem like that, you'll never forget it!  As soon as I read your post, I  was thinking you might have a rollover problem.   Once a million years ago, the company I worked for had a customer with a chart recorder hooked-up to our equipment, and at a particular pressure reading, the chart recorder would go crazy.  As I remember, the digital display was OK but the analog chart recorder output was erratic.   And, I guess there were some customer-configurable gain/range settings because we couldnt duplicate the problem at the factory.   We had no idea what was going-on, but I think the programmer finally figured-out there was a binary number rolling-over somewhere in the code.  Then everything made sense, and I never forgot it!



602  Using Arduino / Audio / Re: One sound sensor for two arduino? on: May 01, 2013, 01:28:29 pm
Quote
  Is it possible to use the microphone as the input for both arduinos if I split the "input" wire
Yes.  The general rule is that it's OK to connect two inputs together, but you should never connect two outputs together.*

Quote
...and the ground to go to both arduinos?  Or would I need to bridge the ground between the arduinos?
Yes Both need a "complete circuit", so both need a ground to the microphone module.   



* This isn't the best analogy, but it's like having one person talk while 10 people listen...  That's no problem.    But if 10 people talk while one person listens, that doesn't work so well.    smiley-wink

With electronics, you can burn stuff up with two or more outputs "fighting" each other.   And as always, there exceptions to the rules.
603  Using Arduino / Project Guidance / Re: Audio Transmission on: May 01, 2013, 01:19:14 pm
If you want to play around with digitizing audio, I'd start with one Arduino 1st.  If you can get that to work with quality that's acceptable to you, you should be able to transmit the digitized audio to another Arduno.

The biggest problem I see is that you need to sample the analog input continuously (actually at regular short intervals).  The timing (sample rate) is very critical.    When your sketch needs to do anything else, like transmit the digital data, you'll have to pause reading of the audio input, or you'l have to do it between sample-reads.  (Computers read audio data at a smooth constant-rate into a buffer, which is part of the soundcard/soundchip.  Then, the buffer is read in a quick-burst when the CPU can get-around to it.) 
604  Using Arduino / General Electronics / Re: Measuring battery life remaining with just an analogue in pin on: April 30, 2013, 07:48:31 pm
That should work just as well as a multimeter.   (If it's over 5V, of course, you'll need a voltage divider.)

Batteries don't discharge linearly, but once you get a feel for the discharge pattern of your particular battery in your particular application, you should get useful results.


smiley-grin My laptop usually thinks there's 3 hours left right before it dies!
605  Using Arduino / Project Guidance / Re: motrcycle turn signal on: April 30, 2013, 06:26:52 pm
Quote
so I can connect: brake light -> trimpot -> arduino input pin?
Do you have a multimeter?  I'd "feel better" if you can measure the output of the trimpot before connecting the Arduino.

And with a pot, you'll need to measure the voltage (or resistance) to adjust it properly anyway.
606  Using Arduino / Project Guidance / Re: analog input alters voltage... doesn't read properly on: April 30, 2013, 05:30:59 pm
Quote
I had it plugged in for like 20 seconds and then when i touched it on removal it was really hot...
How about those missing resistors to the LED display?
607  Using Arduino / Programming Questions / Re: LED Dimmer on: April 30, 2013, 02:01:45 pm
Quote
I think I  need to do some kind of AnalongWright but I am not totally sure.
Just FYI -  Compilers are very-very picky about spelling, capitalization, and syntax.

The Arduino Language Reference is here.   

The Fading Example shows you how to dim an LED.

Quote
I am making an LED lamp that I will be using outside, I would like to able to dim it.
Higher power LEDs cannot be driven directly by the Arduino.   You need a special constant-current LED power supply, which you can buy or build.    And, you'll need to make sure the LED power supply is dimmable via PWM.
608  Using Arduino / Project Guidance / Re: analog input alters voltage... doesn't read properly on: April 30, 2013, 02:19:30 am
Quote
And yes- i am sure i've got a 5v power for the Arduino- tested that a few times, its a V regulator from radioshack... solid as a rock at 5 volts.
5V into the barrel jack is not enough!  There is a voltage drop across the on-board regulator and diode.   You may only have 4V powering the Arduino chip.  (You can measure that on the 5V pin.)   The specs say 6V minimum, with a recommended minimum of 7V.  (Or with an external 5V regulator, you can power the Arduino at the 5V pin.)
 
Less than 5V powering the Arduino chip would cause the protection diodes to kick-in below 5V, clamping/limiting the analog input voltage (at slightly more than the chip-supply voltage).


Also, if you are using an LED 7-Segment display, I don't see any current limiting resistors on your schematic.   Without current limiting resistors, you could be pulling excess current, which could also pull-down the 5V supply on the Arduino-side of the regulator.    And, you can potentially damage your Arduino and/or the LED display.      14.5V into the barrel jack should not have fried you other Arduino, but the lack of current limiting could explain that too.
609  Using Arduino / Project Guidance / Re: analog input alters voltage... doesn't read properly on: April 29, 2013, 07:52:45 pm
Quote
So what is the verdict? What is the solution for this?
I can't think of any reason this is happening.   That's why I didn't answer before...   Maybe figure-out a different way of detecting gear selection?


I don't know why the gear indicator output would be high impedance, yet this is the "obvious" cause of what you are seeing.  (Unless it's not really an "output".)   

Because of it's very-high impedance, the Arduino's input shouldn't affect anything it's connected to, unless the voltage is greater than 5V, or negative.  (Internal protection dioes start conducting when the input goes nevative, or above the power supply voltage.)

Are you sure you have 5V powering the Arduino?   Are you sure the gear-output voltages are not negative?

An op-amp buffer circuit is the usual solution (to increase the input-impedance, or decrease the output impedance).  But, the Arduino already has very-high input impedance.

Quote
"The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less"

Extract from Section 23.6.1 of Atmel doc8161.pdf

...R
That means that the output (source) impedance of whatever is driving the ADC input should be less than 10K.  The Arduino's input impedance is much greater...  The spec sheet (page 377) says 100 Megohms minimum.




610  Using Arduino / General Electronics / Re: Power Wastage. on: April 29, 2013, 06:25:20 pm
They are rare...  I've worked in electronics for about 30 years, and I don't remember ever seeing a 100W resistor in "real life".   Where I work now, we may have a few boards that use 1W resistors, but most are 1/4 or 1/8W.

If you are going to test a power supply, batteries, or amplifiers, you need a "dummy load".   Once (probably while I was in college), I built an 8-Ohm,  200W, dummy-load for testing audio amplifiers.   I don't remember exactly what resistors I used, but I used several lower-power resistors (probably 10W).    I also don't remember if I did that because I couldn't find an 8-Ohm 200 resistor, or if it was cheaper to use several smaller resistors. 

P.S
Now I remember something...  When I was in college, I took a "Motors & Generators" class.   We had dummy loads that were BIG, maybe kilowatts!  They didn't look like power resistors, they looked more like electric heaters.
611  Using Arduino / General Electronics / Re: Convert 48V Phantom Power to 9V on: April 29, 2013, 06:01:54 pm
Quote
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).
612  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.
613  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.

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

614  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.)   
615  Using Arduino / General Electronics / Re: Power supply outputs 0mA ?? on: April 25, 2013, 05:43:28 pm
Quote
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 .)   
Pages: 1 ... 39 40 [41] 42 43 ... 88