Show Posts
Pages: 1 ... 38 39 [40] 41 42 ... 78
586  Using Arduino / Project Guidance / Re: Lights to music on: January 24, 2013, 01:02:39 pm
Quote
Now its working good. But now i use only 1 cable of 3, so i havent got any ground. Could it be a problem later?
Yes.  The ground from the PC/phone needs to be connected to the Arduino Ground.   If it's working without a ground, there may be a ground between the power supplies or somewhere else.  For example, if the USB is connected to your PC, you already have a common ground.

The 3.5mm audio jack's 3 conductors are left-signal, right-signal, and ground.    You need ground plus either a left or right signal (2 wires) for a mono (1 channel) VU meter.  Do NOT connect the left & right audio signals together.   (If you want to use both left & right signals, use another analog input on the Arduino for the 2nd channel.)
587  Using Arduino / General Electronics / Re: What is 'spectrum' anyway? How can multiple frequencies exist in one signal? on: January 23, 2013, 05:12:52 pm
Another example of superposition is when two people in a room are talking at the same time.    When the 2nd person starts talking, the 1st voice is not affected an any way.  The two sounds are literally summed together acoustically (superimposed).     An analog mixer sums audio signals in a similar way, or signals can be summed digitally in a computer.

Of course, a human voice is not a sinewave or one-single frequency.  Different voices have different harmonics & overtones and that's why no two singers sound alike, even when singing the exact-same notes.

Quote
it's still an electromagnetic wave with a voltage and current at a certain point in time. 
At one point in time, there is no frequency.   Frequency is the rate of change over a period of time.  When you digitally sample a waveform, you take multiple points-in-time (CDs are sampled at 44100 samples-per-second).   Then when you "connect the dots", you can reconstruct the waveform over a period of time.

P.S.
Waves in the water will also superimpose...   If you make two waves moving toward each other in the opposite directions, the wave heights will be added when they "collide".   And after passing-through each other, the waves will continue-on as if nothing happened.

Another thing you can do with digital audio is mix two signals (say a singer and a guitar), and then if you invert the guitar mix it in again, the guitar will be subtracted-out and you'll just have the singer.   (This is easy to do digitally, but in analog it's hard to get the phase-time  aligned precisely).
588  Using Arduino / Audio / Re: audio pickup in analog x on: January 23, 2013, 03:22:55 pm
Guitars like to see a higher impedance.   A pair of 1 Megohm or 2M resistors would be better.   With a 50k load (a pair of 100k resistors) the signal is going to get knocked-down a bit, and your tone will probably be affected. 

With a high impedance load and the guitar volume cranked-up, you should get around 1V, which should be plenty of signal to work with.

With audio inputs, I normally use a peak detector (You'll need to change the 100k input resistor to 1M or more.)    A peak detector will work with lower signal levels, and since it's not biased at 2.5V (like the 2-resistor method) you can use the 1.1V ADC reference with weaker signals.
589  Using Arduino / General Electronics / Re: Simple switch - delay in pin going to low state on: January 22, 2013, 07:20:39 pm
Quote
I have no idea of the spec of the switch but I've tested it with my Ohmmeter and worked out I need to use 3 of the pins on one side: Power to the center pole, "off" state (left pin) to 10k resistor and then back to ground and "on" state (right pin) to pin 2.
OK.  Just make sure the "center" terminal is the electrical center.  (It usually is.)   

Then +5V can be connected to one of the other terminals, and ground to the remaining terminal.   That way, the center is either connected to +5V or ground, depending on the switch position.  In that configuration, you shouldn't need the 10K resistor at all. 

But, the 10k resistor (between 5V and the switch) is slightly "safer" because there are some very-rare switches (called "make before break") where the two "other" terminals are connected together for a moment in-between positions.    If that happens, you'll momentarily short-out the 5V.   Everything will probably survive a momentary short, but the Arduino would reset/restart and that would be a problem.

You can test the switch (with or without the resistor) with your multi-meter before connecting it to the Arduino.   Just check for 5V (at the center) in one position and zero volts in the other position.   And, it would be a good idea to turn-off the power and use the ohmmeter function to confirm that the "zero volts" connection is a good-ground, and not simply an open.   

The REAL solution is to use a pull-up resistor:   The Arduino has optional internal pull-up resistors which can be enabled (see this page).   The pull-up resistor pulls the input high (+5V) when there is no connection.   Then, you only need two connections to your switch to force the input low (to ground) when the switch is on.

Brandeaux suggests using a pull-down resistor.   That will work fine too.  But, pull-ups are the more standard way of doing it, and the built-in resistors are pull-ups.

With a pull-up resistor, you are "shorting-out" the input and shorting one side of the resistor to ground.  That's fine, since only a teeny-tiny current flows through the resistor.   If you were to make a "hard connection" to 5V (without the resistor), turning-on the switch would short-out the 5V supply, shutting everything down.

Quote
I've tried adding a delay to the loop (from 10ms to 100ms)...
That's only going to make things worse! smiley-wink  As the program is "stepping" through the loop, depending on where the program execution is in the loop, the input-read might get delayed or your "action" might get delayed 'till the delay is done.

FYI - As a general programming rule, it's best to avoid using delay().   Because while delay() is running, your program can't do anything else.   (Of course, you can use it when appropriate.)   So, if you you want to delay something without holding-up your entire program, you can read the "time" and compare like the Blink Without delay()Example..    With this techinque, you can have multiple delays/timers running at the same time, and they won't interfere with each other or with your main loop.
590  Using Arduino / Project Guidance / Re: Actuating a full size airplane on: January 22, 2013, 03:30:02 pm
It sounds like the only thing missing is a "flaps down" indicator.  Right?   I agree, you don't need to program an Arduino for that.

Quote
So, I'd use those same switches as my cut-offs for the motor as well?
Maybe...  It depends on how it's wired.    You should be able to "tap into" that switch's logic and possibly use a transistor as an inverter to turn the light on when the motor goes off.  You may need some additional logic to hold the indicator on, and then to keep it off when the motor is reversed. 

There are various logic circuits such as "and gates", "or gates", "inverters", and "flip-flops".   These don't need to be programmed with software.   Their function (and combined function) depends on how they are wired.    If the logic is fairly simple, and there's no "counting" or math, logic chips are usually easier.
When the circuit starts getting complicated, it becomes easier to do it in software (with a microcontroller).   

Note that most logic circuitry (as well as the Arduino) runs off 5 Volts.    "Converting" a 12V signal from  a switch down to 5V only takes a couple of resistors.   But, converting up to run a 12V lamp (if you don't want to use an LED) requires something like a MOSFET or transistor or relay.

Or, maybe there's an unused terminal on the switch (if it has normally-open and normaly-closed terminals).

Or, you may need to use an additional similar switch.
591  Using Arduino / General Electronics / Re: first pcb try on: January 21, 2013, 08:03:28 pm
I guess some people are having success, but my plan is...  smiley-grin I'm NEVER going to attempt it again! smiley-grin

I made some boards many years ago.  It was messy, the boards looked homemade, the drilling was not very accurate, and I don't remember what other problems I had, but it wasnt' much "fun".  It probably took a couple of attemps to get a working board.   

When I went to college, there was a lab where I could get boards made from my supplied artwork.   Since graduating from college, I've built several projects permanently on plug-in "breadboards", and sometimes I use perfboard and hand wire.   In the past I also used some wire-wrap.

If I ever decide to make a custom board again, I'll use a service like ExpressPCB to get the boards professionally made.   
592  Using Arduino / Audio / Re: Arduino DAC on: January 21, 2013, 06:50:15 pm
The Arduino does not have a DAC.   It has a 10-bit ADC with multiple inputs. And, it has 8-bit PWM outputs which can substitue for analog output for some applications.  But, it won't work for good-quality voice or music. 
593  Using Arduino / General Electronics / Re: Two SSR on one pin? on: January 17, 2013, 05:32:44 pm
Two solid state relays will be no problem! 

Quote
- Trigger current is specified to 7.5mA / 12V. I will drive it directly from Arduino Mega 2560, so this equals to 31mA @ 5V?
How about 3.1 mA?  Your calculations are correct when expressed in Amps, but when you converted to mA, your decimal point is off...  smiley-wink 

Logically (from Ohm's Law without bothering with the calculations) lower voltage (through a pure resistor) results in lower current.   i.e.  You should expect something less than 7.5mA when you lower the voltage form 12 to 5V.     
594  Using Arduino / General Electronics / Re: output voltage digital I/O on: January 17, 2013, 05:20:44 pm
Or, is there anything connected to the output pin that might be "dragging down" the voltage?    With no load on the output and a 5V power supply, you should be very close to 5V.
595  Using Arduino / General Electronics / Re: Analog input, series resistor needed? on: January 16, 2013, 04:45:57 pm
Quote
I'm not entirely sure what it means that ground and +5v have a large input impedance, but it sounds like I won't destroy my board that way at least.
It means that a series resistor (at the Arduino input) won't end-up reducing your signal voltage.

The series resistor and the input impedance form a voltage divider where the voltage is proportional to the resistance (or impedance) ratio.    With a 1K or 10K series resistor, essentially zero voltage is dropped across the series resistor and (essentially) all of the voltage is ends-up across the 100M Ohm Arduino input.

When you instead put the 2K resistor in series with the 10K pot, you are creating a 10/(10+2) voltage divider and reducing the voltage by about 17%.

The downside is that a high (total parallel) resistance makes the input more noise-sensitive.   So although 1M Ohm would only loose about 1% of the voltage, I'd probably stick with 1K if you feel a series resistor is useful.   (Stray EMI can generate a noise current in the input connections...  Per Ohm's Law - With a given current, higher impedance means higher voltage.)    There is also an input capacitance, which can cause issues when there is a high source impedance.

It's my understanding that the Arduino has internal protection diodes to protect it from voltage spikes.   But, I have no idea what the current cabability of these diodes is....   I'm pretty sure if you connect a 12V power supply to an I/O pin, you can blow the protection diode.     The series resistor could potentially limit the current and allow the protection diode to safely do it's job.
596  Using Arduino / Project Guidance / Re: controling in between 100 and 255 outputs on: January 16, 2013, 02:08:37 pm
You probably want a serial-in, parallel-out shift register.   The 74595 seems to be very popular.   I assume it (and the Arduino) will be fast-enough for you.

Serial data transmission does tend to be slower, because you'll have to "write" 100-255 times before you can update the parallel data.    However, Ethernet is serial, and and digital audio/video transmision is serial, SATA disc drives are serial...  So in the real world serial can be very-fast!

You feed-in the data serially one bit at a time, synchronized with a clock signal.  When all of the data has been shifted-into position, you send another signal to transfer & latch the data at the parallel outputs.   These devices can be chained together for many outputs.   (I'm using an LED driver that uses the same concept to drive 48 independently addressable LEDs from a 3-wire serial output.)
597  Using Arduino / Project Guidance / Re: My body gives Electricity when i trying to acquire signal by AD620 inst. amp ? on: January 16, 2013, 01:58:11 pm
What power supply voltage are you using?   Are you running off batteries, or from an AC power supply?   I'm wondering if you have some (potentially dangerous) leakage in your AC power supply!
598  Using Arduino / Project Guidance / Re: What Processor Would Be Best ? on: January 15, 2013, 07:18:23 pm
The Arduino is the easiest mocroprocessor/microcontroller for hobbyists!     The PIC processor family is also geared toward hobbyists and there are more PIC varieties, but you might have to buy a separate programmer, perhaps buy a complier, and you'd have to construct your own circuit board (or build on a "breadboard").   If you use any other random processor, you'll also probably end-up having to buy a hardware development kit.   All of this stuff can get very expensive, and it can take lots of time to get configured and set-up.

With the Arduino, everything is self-contained (you may have to build some extra circuitry) and the sofware development kit is FREE!    When I got my Arduinio, I was amazed that I had the "blink LED" example compiled, downloaded, and running in about 10 minutes.   With another processor, this set-up, learning, and configuration could take a whole frustrating day!

Have you ever programmed before?  Have you programmed in C/C++?   In general, I'd say "programming is hard", but simple things like blinking an LED or some simple logic & timing like you want to do isn't too bad.   Take a look at the examples and the language reference to get an idea of what you can do.   Loops (doing things over-and-over) and "making decisions" with if-statements are the most important programming concepts to understand.

Quote
I would be willing to compensate someone for their Help ..Thanks
I think you'll find plenty of free help here, as long as you don't expect someone to do the project for you. 
599  Using Arduino / Audio / Re: Electret microphone on: January 15, 2013, 06:18:47 pm
All your circuit should work.
But they don't and I don't know why.
Nobody else knows why either...  We don't know if the problem is in your microphone, amplifier circuit, or in your firmware/sketch, or somewhere else...  In order to troubleshoot your project, you need to test the individual sections and "zoom-in" on the problem.

What's happening?  Anything? 

Do you have a multimeter to measure the signal out of your microphone amplifier?  Maybe try putting +5V on the Arduino input to make sure the Arduino and the firmware are working.  (With 5V, I assume the VU meter will max-out.)

Or, maybe add a protection circuit (two diodes and a resistor) and feed-in an audio signal from somewhere else (bypassing the microphone) .

Quote
I found a TDA2822M and the datasheet says its some kind of amplifier. Is it useful for this project?
Maybe... But it has fixed gain, and we don't know how much gain you need.  The required gain depends on the sensitivity of the particular mic, and the loudness of the sound.  Usually, it's best to have a gain/sensitivity control.   And, you'd still need to bias the electret mic.

Quote
Can I use a microphone like this without any additional circuit?
That looks like it should work.

Quote
I dont have one, so I'd rather make one out of parts I already have.
I'd say your odds are better with something pre-built. smiley-wink
600  Using Arduino / Audio / Re: 3.5mm jack sound reactive LEDs on: January 15, 2013, 05:41:43 pm
Quote
thank you for the information. so would i just connect the leads from a female 3.5mm plug to the arduino?
No...  You need a protection circuit!  Audio signals are AC. They swing positive and negative.   The Arduino can be damaged with negative voltages.   A headphone signal could also go over 5V peak at high volumes and that can damage the Arduino too. 

It's actually unlikely that you get more than 5V unless you connect a power amp, but eliminating that part of the protection circuit will only eliminate one diode.   And, when you compare the cost of a diode to the cost of the Arduino...  It's up to you to figure-out if it's worth it. smiley-wink


P.S.
By using this particular protection circuit, we are throwing-away the negative half of the audio waveform.  But since the positive and negative halves are roughly equal, we don't need the negative-half to "read" the volume.
Pages: 1 ... 38 39 [40] 41 42 ... 78