Show Posts
Pages: 1 2 [3] 4 5 ... 78
31  Using Arduino / Audio / Re: Project Sound Camera on: March 26, 2014, 12:38:58 pm
I really don't understand what this thing is supposed to do....

Second is to generate sound between the frequencies of 30Hz to 20KHz.
That should be no problem if you can use square waves.   But, generating continuous sounds while receiving continuous sounds, while "processing" the data & running the pan & tilt could get tricky.    Normally with a computer, you have input & output buffers so the streaming audio can flow smoothly in & out while the processor reads & writes in quick bursts.  That would be tricky with the Arduino without adding a lot of additional hardware.

30Hz to 20KHz
The "average" mic does not have flat frequency response across the audio range.    You may need a high-end or "instrumentation" microphone.   Speakers are even worse!    If that's important, it could be a major issue.    To some extent you can calibrate for it, but it's going to be difficult.

Secondly, can anyone suggest how i would go around tackling the third problem. The sound captured by the mic will be analog so
     (a) can it be fed directly to the microcontroller or does it need an amplifier circuit in between,
It needs to be amplified and biased.   A microphone puts-out a few millivolts (depending on the sensitivity of the mic and the loudness of the sound).  The Arduino's ADC has a 0-1V range and a 0-5V range.   So, typically you need a gain of around 100 (40dB) but microphone preamps always have a gain control.     

A normal audio signal (and the signal from a mic) is AC...  It goes positive & negative, and you can't put a negative voltage into the Arduino, so it has to be biased.  Or, in some cases you can "chop-off" the negative half of the waveform.  (You can get a circuit board that has a microphone, an amplifier, and a 2.5V biased output.)

     (b) can it be fed directly to the computer via a sound card and arduino used to communicate with the computer to store the results.
That should be possible.    If you are going to us a the computer, I'd use the computer for all of the sound functions, and the Arduino for the pan & tilt.

I am able to control the pan and tilt using an H-Bridge and two DC motors...
You'll probably want servo motors if the computer/microcontroller needs to control or "know" the angles.  Pan & tilt is "always" done with servos.   (A servo motor has the driver circuit built-in, so you don't need the bridge...  You just provide power and a timed-pulse to set the angle.)
32  Using Arduino / Project Guidance / Re: Pulling a string with a motor on: March 26, 2014, 12:08:52 pm
A spool seem like the obvious solution...  That's how construction cranes & winches work...   If hot glue doesn't hold, epoxy will.

If you can't find a spool with the right dimensions, you could make a spool from a dowel with washers on the ends ( (maybe fender washers).  If you make your own, you may not be able to drill a straight hole all the way through (depending on the length), but you can drill holes on both ends with a "bearing" (just a loose shaft) on one end.
33  Using Arduino / Project Guidance / Re: pwm output on digital pin 0 or 1 on UNO on: March 24, 2014, 03:51:52 pm
You can make a tone on any digital pin...    For example, if the pin is high for 1/2 of a millisecond and then low for 1/2 of a millisecond, and you repeat that pattern, you have a 1kHz square wave.

Like anything timing-related, you'll have to make sure the timing doesn't interact badly with your other code.

Another option is an actual "buzzer" (not a transducer) that makes a tone itself when you apply power.
34  Using Arduino / General Electronics / Re: Resistors for 2N3904 Transistors and LED Strips on: March 24, 2014, 01:01:56 pm
Here's the big question, and I'm sorry if it sounds noobish.  Do I really need the resistors between the Arduino output and the transistor base?
YES!   Without the resistor the base-emitter junction (when wired correctly as shown by Joe) effectively puts a forward-biased diode from the Arduino output to ground.   You will get excessive current and possibly damage the Arduino.

I found others using 220 ohm resistors which brightens the display but still not matching the level of the unresisted setup.  And then I found someone else claiming they weren't needed because the resistors in the strip did all of the necessary work, and the output of the digital Arduino pins is only about 40 mA anyway at max (this transistor is rated for 200mA).
When wired & operating correctly, a the transistor should be saturated (switched fully-on) so the current is limited/controlled by the LED strip (not  by the transistor), and a (small) change in resistance should make no difference in brightness.
35  Using Arduino / Project Guidance / Re: Audio recorder on: March 20, 2014, 04:05:02 pm
smiley-sad I'm not feeling too good about this... 

You'll need to add memory and a digital-to-analog converter, and a microphone preamp, and some sort of user-interface.     (The Arduino has a 10-bit analog-to-digital converter, which is probably good enough for voice.) 

Is there an arduino that is small of enough to fit in your pocket...?
It's not easy to make things small "at home".  You'd probably need to make a custom surface-mount PCB and figure-out how to get the small high-density parts soldered on.   By the time you design, breadboard, protototype, and debug your device, you'll probably spend a at least a few months and as much money as you'd spend buying a digital recorder.

I know there are many out there, but I want one that has a processor so I can have programs running on it.
How about a smart phone with a memo/recording app?  (Or a "modern" iPod that runs iOS applications.)   There are applications,  interfaces, and good quality microphones for the iPhone.  (The iPhone has a standardized interface, so if you want to add an any hardware such as a microphone or audio interface, I'd go with the Apple product.)

What's the best audio recorder?
The "best" portable recorder is going to cost you a few thousand dollars, and won't fit in your pocket.   Here are several digital portable-pocket recorders starting around $100 USD. 

36  Using Arduino / Project Guidance / Re: Suggestions for two infinity mirrors on: March 17, 2014, 07:21:14 pm
New to electronics, stumble upon arduino after I did a crash course on LEDs for my motorcycle LEDs.

...He is flying on the 23rd for 10 days, and one thing he seems to be interested in is electronics.  When I was young I never got a chance to play with electronics because my father knew nothing about them or even where to get parts and plans.  Because of internet, it seems that is no longer an issue.

...I purchased an arduino uno starter kit.  Plan to do all 15 projects with my son.
I hate to be negative, but I think you're going to run out of time.['b] smiley

There's a LOT to learn and a lot to do!

Ideally I want to make 2 hexagonal infinity mirrors with 30 RGB LEDs on each one (5 leds per side).

2) Each mirror will have 30 RGB leds, which I assume it is like having 90 LEDs correct?

I did a "Giant VU Meter" project which required 48 hand-wired LEDs (24 on each channel).    That took quite a bit of time and it was boring and tedious.   This project took me a couple of months (part time, mostly on weekends).     The programming also took extra time, because it has other audio-activated effects, besides operating as a normal VU meter.

I've never done a large number of RGB LEDs, so I'll let others suggest circuits & driver chips.   It will make a difference if you need to dim the LEDs and/or get all possible colors.

What I'd actually suggest is this:   Make a simpler one-color 5-channel set-up (with the 5-LED pattern repeated 8 times).   That way, you can use 5 Arduino output pins.   You'll still need a transistor/MOSFET or driver chip to boost the current to drive 8 LEDs per output, but it will be a LOT simpler to build, test, and program.    It also means you can test & program it with 5 LEDs directly connected to the Arduino.   It will be a lot more fun if you wire-up 5 LEDs and start programming patterns/sequences right away.

You can make a lot of interesting sequencing-patterns with 5 LEDs...    I've made a 4-channel audio-activated lighting effect.    It can operate as a regular sequencing "ring counter" or "Johnson Counter" in either direction.    When it randomly operates as a ring counter in one direction and a Johnson counter in the other, you automatically get lots of interesting sequences.   

You could build a simple 5-channel sequencer to start with, and if you have time expand it later to 30 channels of RGB.
37  Using Arduino / Audio / Re: Looking for Piezo Buzzer Code for Popular Songs on: March 13, 2014, 02:40:40 pm
I think you can find MIDI versions of most songs.   If the the song is "popular" it's usually a copyright violation, but they don't seem to be too strict when it comes to MIDI.

MIDI is basically "sheet music" for computers.   It's notes & timing that's played on MIDI instruments or on virtual instruments.

Your computer can play MIDI, but you'd have to get MIDI software to "decode" the notes & timing (so you can see the information).   You'd still have to write some code, but it should be easier than reading sheet music.   (I don't use MIDI, so I can't recommend software). 

Or, maybe there's an Arduino MIDI library that can play MIDI to a piezo???  (That's not the normal way of doing it.) 

38  Using Arduino / Audio / Re: FFT on Arduino, the audio spectrum is cluttered? on: March 13, 2014, 02:10:21 pm
FFT is beyond my mathematical & programming abilities... 

I've never seen a perfect FFT spectrum.   It's my understanding that it theoretically takes an infinite number of samples and in infinitely-long unchanging signal to get a perfect result.    In the real world, a window of a certain number of samples it taken (representing a small amount of time).    There's a discontinuity where the window starts & stops, so there are various window shaping and window overlapping algorithms to compensate.   These all have various compromises. 

The bit depth and sample rate may also affect FFT accuracy (or sample rate may just be a different way of thinking about window size).
39  Using Arduino / General Electronics / Re: Oscilloscope - Advice/Guidance sought: Used CRO versus modern LCD oscilloscope? on: March 13, 2014, 01:37:04 pm
Like Mark says, the digital storage is really nice.  The only reason I'd even consider an analog 'scope is because of cost.   (I don't have a 'scope at home and an analog 'scope is better than nothing!)     

Most digital 'scopes also have a way to capture the image, which sure beats a Polaroid 'scope camera if you need to send/share a waveform! smiley-grin  smiley-grin smiley-grin

There are digital 'scopes with cathode ray tube displays.  They are more bulky than LCD and they are always monochrome.   And, you have to adjust the focus and occasionally make some other "analog adjustments" to the display.   (The least-expensive LCD 'scopes are also monochrome.)   I can't think of any downside to LCD, except you might find a CRT 'scope at a lower cost .  (We call it a cathode ray tube in the U.S.)

At work we have 2 & 4 channel color LCD 'scopes (Tektronix).   It is nice to have different color traces for each channel, but most of the time I'm only using one channel anyway.     Depending on the cost, I could live without that.

Data lines, address lines, and audio signals are non-repetitive and you already know what a mess they look like on an analog 'scope.  On a digital 'scope you can "capture" the waveform, it looks a lot cleaner and often you get a better picture of what's going-on.

Or if you have a short-duration infrequent pulse, you get a dim-flickering image on an analog 'scope, whereas with digital you get a nice image.

Low frequency stuff also tends to flicker with an analog 'scope, or at very low sweep-rates you have to watch the dot trace-across the screen.   
40  Using Arduino / General Electronics / Re: Laser Harp Hardware on: March 13, 2014, 01:03:40 pm
I assume you know that photoresistors don't emit a tone? 

When the light level changes, you get a resistance change (and a voltage change when wired correctly).     If you don't have a multimeter, I strongly recommend you get one.  (Radio Shack has one for $15 USD, and Jameco offers several under $15.)    You can test the input-hardware by measuring the voltage (and voltage change) going into the Arduino.

Troubleshooting involves testing the various "components" separately (and sometimes replacing suspect parts/components to see if that fixes the problem).

Typically, you design & build something the same way...    You can make something that makes a tone purely with software.  Then add more tones.  Then make something that makes a tone when you push a switch/button.  Then add more inputs/buttons and associate them with different tones.  Then build the laser part and replace the switches with photoresistors or phototransistors.    That's just an example...   You don't have to do it in that order, but the concept is to develop, test, and troubleshoot one thing at a time.    (Beginning programmers get into all kinds of trouble by trying to write the whole program at once.)

I know you didn't write the sketch yourself, but you may need to modify the sketch to make tones with software-only to make sure the "tone" part of the design is working.   If that works, the output-hardware is working.

41  Using Arduino / LEDs and Multiplexing / Re: Slowly fading LED's without delay. on: March 12, 2014, 03:15:09 pm
The example has the FADE_TIME set to 2000 and seems to work well for a 2 second fade however setting the fade time to 600,000 to get a 10 minute fade only seems to give about a 10 second fade. Is there some reason why I cannot get over about 10 seconds and would there be a better library to try to attempt doing this?
I've never used LEDFader.h, but it looks like fade time is defined as an unsigned int which can hold values between 0 and 0 to 65,535.

As far as timing more than one "thing" at a time (so your various LEDs & colors can fade independently) you can base your sketch on the Blink Without Delay Example, but you can have multiple variables such as previousMillisRed,  previousMillisBlue, intervalRed, intervalBlue, etc.

One thing you should try to avoid (whenever possible) is checking for time being to exactly equal a value.  It's only equal for a short time and you can miss it.   Use >= (greater than or equal) or <= whenever you can.    Even when you're not dealing with time, it's often "safer" to use logic that doesn't have to match exactly.

...but would be extremely repetitive.
Computers are really good at repetitive tasks! smiley-wink  That's what loops are for!   If you find yourself (your program) doing the same thing over-and-over, you probably need a loop.    Of course,  you can change/update variables each time through the loop.

I don't know if you'll need them, but you can have nested loops (loops inside loops).

Loops, conditional branching (if-statements, etc.), and mathematical/logical operations are the 3 things that make computers & programming useful!
42  Using Arduino / LEDs and Multiplexing / Re: Trying to understand the limit of ma for the Leonardo pins on: March 12, 2014, 02:41:24 pm
Would I have to run the voltage through a digital potentiometer after...
No.   With PWM, you don't control the voltage.   PWM switches on & off rapidly. It it's off most of the time it's dim.  If it's on most of the time it's bright.

I don't know what typical power ratings are for digital pots, but you'd probably run into similar current limits and you'd have to use several digital pots.  PWM is the way to go.   
43  Using Arduino / Project Guidance / Re: Rear spoiler control on: March 11, 2014, 04:28:51 pm
If you can figure-out how to wire-in a manual switch, you can replace that switch with a relay and control the relay with the Arduino.  (Then, you can replace that switch with a "3-way" (center off) switch running into the Arduino.   The switch can then select "up", "down" or "automatic".)

The logic is fairly simple.   Have you done any programming before?

My questions are is this possible and how would I calculate for the board the speed of the car?????
That seems like the hard part.  Every car is different.  You'll have to figure-out how to tap into the car's speed sensor or speedometer.  If the car has an analog speedometer, sometimes they are electrical and there is a DC voltage that's proportional to speed.    You'd have to find the right wires and hook-up a multimeter to measure the voltage at 50MPH.  The Arduino has an analog-to-digital converter that goes up to 5V.   Since the electrical system is 12V, you'd probably need a voltage divider.    (Even if you are getting less than 5V at 50MPH, you need to protect the Arduno from higher voltages.   

If you can't do that, you might be able to add a sensor (optical or magnetic/hall effect) to your drive shaft or wheel to count the RPMs.   Or, you could use a pitot tube to measure air speed.

My car has a rear spoiler that activates at 94mph and then fully retracts about 45mph... control it raising and lowering round about 50mph.
You'll want to keep some of that concept of lowering it at a speed below the activation speed.  Otherwise the wing will "chatter" or continuously move up & down when you drive around 50.

If you can't find any useful information about your car's electrical system in a car forum, you might try talking to a "hot rod" or "racing" mechanic...  Not your "factory authorized mechanic"...   Someone who knows your car but is not afraid of making unauthorized modifications. smiley-wink

P.P.S.Or if you can't get the speed sensor figured-out, how about this option?    A manual up-down switch, plus it automatically goes down when you shut the car off?     Something like that could easily be done with the Arduino (after you figure-out the up-down relay wiring), or it's simple enough that it could be done with logic circuits (no microcontroller or programming).  You could probably even do it with just relays.

44  Using Arduino / Audio / Re: Measuring amplifier output power (watts) on: March 10, 2014, 06:14:47 pm
If you are not hearing distortion...   If the amplifier is not distorting and the speaker is not distorting, you are probably OK.   Realistically, most home hi-fi speakers don't get blown unless there is a party with alcohol where nobody cares about distortion.   Under "normal" home listening, I wouldn't even worry about using a 100W amp with 25W speakers because it's just not going to get turned-up that loud.    In a more professional setting, the amplifier is usually (approximately) matched to amplifier power and it's not turned-up into distortion, and everything is OK.

The specs for home/consumer speakers are often useless.    Professional speakers are rated per IEC standards, which specify a particular frequency spectrum.    (Most of the energy is assumed to be in the low-mid frequency range so a 100W speaker does not need a tweeter than can stand 100W.) 

Even the honest IEC ratings are just guidelines because there is a lot of variability in music and program material.  And, it wouldn't make sense to give the speaker a "wost case" power specification because you'd end-up using an over-rated over-expensive speaker.

Also, normal music/voice has a peak to average ratio of about 10:1.   So, if you are running an amplifier at full power, you are getting about 1/10th as much power (heat) into the speaker.    A speaker rated at 100W, is generally designed to be used with an amplifier rated at 100W or less.   But it's not going to survive with constant 100W test tones, and that's assuming the 100W power rating is honest.     

This JBL Paper basically says:
For undistorted music, you can use an amplifier with twice the speaker's ratings.

For highly distorted music, use a speaker rated for twice the amplifier's rating.
   (But, even that is not a total guarantee that you won't burn-out your speakers...  It means you are probably safe with normal-distorted program material.)

And, be aware that if you have a 2-way or 3-way speaker, you can fry the tweeter with maybe 1/10th to 1/5th of the speaker's rated power if you apply constant test-tones.   Or if you buy a 20W tweeter, it's generally rated for the high-frequency part of regular audio program material, and you can probably fry it with constant 20W test tones.
45  Using Arduino / General Electronics / Re: arduino triac doesn't work on: March 10, 2014, 05:24:30 pm
If you have a multimeter, check the voltage across the input (low-voltage) side of the opto-isolator.    It should be around 2V (when turned-on).   If it's somewhere around zero, or close to 5V, something is wrong.  (You can check the specs to see what the forward voltage is supposed to be.)

Do you have an extra opto-isolator and an extra TRIAC to try?    It's easy to burn-out parts when playing with high voltages & currents, so it's always good to have some spares.

When I was experimenting with these kinds of circuits, I tested the opto-isolator & TRIAC circuit with a 9V battery before connecting an Arduino.   And as soon as it was confirmed working, I "sealed it" in heatshrink for safety.   (It was built on a small perfboard.)

Why it doesn't work? It will only work with that triac(BTA08-600C)?
The only thing I can think of is gate current might be different.

I also think if you remove the opto-isolator and connect the 100 Ohm resistor between A2 and the gate(with AC power applied), the TRIAC will turn-on.    But I'm NOT 100% sure you can do that without blowing the TRIAC, so do it at your own risk or do some research about how to test a TRIAC. 

Or, you should be able to simulate turning-on the opto-isolator by shorting-out the opto-isolator's output (high-voltage) pins.  Again, do so at your own risk.

If all else fails, you can always buy a solid state relay...  You are essentially building your own solid-state relay.   Building the circuit yourself if cheaper (if you don't blow-up too many parts during development & testing), but solid state relays are usually more reliable (and easier to wire-up since you only have to make 4 connections).
Pages: 1 2 [3] 4 5 ... 78