Show Posts
Pages: 1 ... 32 33 [34] 35 36 ... 78
496  Using Arduino / Project Guidance / Re: Detect sound on guitar pickup on: April 15, 2013, 12:00:49 pm
You'll want to connect the signal to an analog input.   Then read the ADC and compare to a preset threshold.   (You don't want it too sensitive, or noise will trigger your software).    Setting the threshold will require some experimentation.

There is one complication...  The guitar signal is AC (it goes positive and negative), and you cannot put negative voltages into the Arduino.   The low current capability of a guiter pickup is (probably) not going to damage the Arduino, but the sound-signal will be distorted.

You can bias the input with a pair of resistors and (1 or 2 Meg should be about right for a guitar) and a capacitor.    I like to use a Peak Detector, but it's more parts and it requires a +/- power supply for the op-amp.
497  Community / Gigs and Collaborations / Re: Time-to-resistance value program? on: April 15, 2013, 11:43:31 am
The Button Example shows you haw to read a button-push.

The Pull-up Example example shows you how to simplify your hardware by using the internal pull-up resistor instead of an external pull-up or pull-down resistor.

oYu can use the millis() function to find the number of milliseconds since your program started.   By "grabbing" this time every time you hit the foot switch, you can subtract to get the time between beats.  You'll want to take and average of a few beats, and possibly throw-out any outliers to get a good tempo.

The Blink Without Delay Example will show you how to blink the LED at the rate you've calculated.   (It's good to avoid the delay() function because it makes your program stop and do nothing during the delay period.)

Here is an example of a digital potentiometer.  There are different protocols/methods of controlling the resistance of a digital pot, so you'll have to check the specs and design your hardware & software appropriately.
498  Using Arduino / Audio / Re: Hi need help, suggest me a preamp circuit for realtime audio processing. on: April 12, 2013, 12:35:54 am
Do not use that circuit...  It's a special circuit that supplies DC power to an electret microphone.  You do not want to feed DC power into your guitar's pick-up coil.   It also probably has way too much gain (except when the gain is turned way down).

The TLO82 is fine if you want to build a preamp.

With the proper impedance (1 Megohm or more) an electric guitar will put-out about 1 volt, and you may not need a  preamp.   (The Arduino's ADC has very-high input impedance.)   

If you are driving a regular power amp (with an typical input impedance of 10K - 100K) a buffer amplifier made with any standard op-amp will give you high input-impedance and low output-impedance, but with no signal gain (gain =1.0).

If you do need some gain/amplification, a non-inverting amplifier made with any op-amp will have very-high input impedance, and a gain 10 or less should be sufficient.
499  Using Arduino / General Electronics / Re: Wall Power Supply question on: April 12, 2013, 12:07:18 am
Quote
I'm trying to decide with power supplies best suited for this. 6 Volts? 12V?  I'd imagine converting 110 AC to 12 DC should be easier than 110 to 6 V and thus supply will be less bulky and generate less heat/live longer?
A 6V transformer (used in linear supplies) can be just as efficient as a 12V transformer.   It's the linear regulator where most of the efficiency is lost.  And switching supplies (or your DC-DC converter) can be very efficient.

A 12V 1 Amp, supply is capable of 12W, and a 6V 1 Amp supply is capable of 6 Watts.   So the 12V supply might be bulkier (assuming the same current rating).    Since your DC-DC converter is efficient at any voltage, the actual power consumed (and heat) will be the same in either case.  (Less current will be drawn from the higher-voltage supply.)

The 6V supply is at the bottom of your DC-DC converter's specs, so it might be better to go with something higher.

Quote
Is it a good idea to have switching supply or regular one will be just as fine (since I'm using switching internally)?  Quality and efficiency are my top priorities...
You actually have 3 choices -
1. A regulated switching supply (most efficient)
2. A regulated linear supply (least efficient)
3. An unregulated linear supply (almost as efficient as the switching supply)

An unregulated supply will deliver (approximately) the rated voltage at it's rated current.   With no load, it's typical to see 50% more voltage, so maybe 18V from a 12V supply with no load.   In your application, this is fine.

The unregulated linear supply is the simplest, with the least parts, so it might be the most reliable.   But, since these are normally used to save cost, it could also be cheaply made...  who knows?     (Most modern electronics are generally very reliable, so I wouldn't worry about it too much.)
500  Using Arduino / Project Guidance / Re: Can this be done? on: April 11, 2013, 07:57:35 pm
Quote
I wanna have the chance to be at home, play the instrumental of my song and sing on the top of it. So far so good...
Check into MIDI software.     A MIDI file contains the equivalent of musical notation that can be played by your computer or on a MIDI instrument/keyboard.    If you search the Internet, you can find lots of free MIDI files to download.

With more advanced software, you can edit the files to change the notes, tempo, or key, and you can get various software instruments (VSTi) to get more realistic instrument-sounds.  You can get free VSTI's, or they can cost hundreds of dollars. 

Most of the music you hear in movies and on TV is now MIDI...  If you hear an orchestra in a current TV show, it's probably NOT the Henry Mancini Orchestra! smiley-wink

You can make vocal-like sounds or choral-like sounds with MIDI, but you can't do lyrics.

If you have a keyboard player in your band, he/she should know all about MIDI...  far more than me!

Quote
But, I also wanna have the chance to be able to change my pitch and tempo and that the instrumental follows it according to what I sing....

If I wanna speed up my singing can the song follow it? Also the pitch changes?
A quick search turned-up this.
501  Using Arduino / Project Guidance / Re: Project: The best morning alarm ever - Need opinions on: April 11, 2013, 04:09:50 pm
I agree that that hardware hacking is probably the trickiest part.  I built a similar "sunrise dimmer" several years ago with a different processor.  Like yours, mine doesn't have a time-of-day clock.   It plugs-into a regular AC timer (actually an X-10 system).   However, I built the AC dimmer circuitry into my gizmo and the lamp plugs directly into it.

Quote
Are you convinced that the increasing light will wake you?
Mine has a 2nd part...  The lamp is set to start coming-on 10 minutes before "wake-up time".    After 10 minutes when the lamp is fully-on, it gives a gentle short-beep (adjustable with a volume control).  It beeps again every 30 seconds.   At the 2 minute mark there are two beeps, and two beeps again at 2.5 minutes.   3 beeps at 3 minutes, etc., and this goes on for 15 minutes.
502  Using Arduino / Audio / Re: Switch Advise (3.5mm Audio Cable) on: April 10, 2013, 05:02:15 pm
For a mono source, you need a SPDT (single-pole, double-throw) switch (with 3 terminals).   For stereo, you need a DPDT (double-pole, double-throw) switch (with 6 terminals).    In this configuration, the common terminal goes to the source, and each of the other terminals goes to a speaker.   (All of the ground wires just get connected together.)  You could call this an A/B switch, since it switches between speaker 'A' and speaker 'B'.  (Wikipedia switch configurations)

Quote
but It would be better if I could control the switch with the Arduino by sending either digital HIGH or LOW.
A relay is an electrically controlled switch.   Relays also come in various configurations such as SPDT and DPDT.   (If you can't find an appropriate SPDT relay, you can use 3-terminals of a DPDT relay.) 

If you can find a relay rated at 5V coil voltage at 40mA or less, you can drive it directly with the Arduino.   Higher voltage/current will require an additional transistor or MOSFET, and possibly a higher supply voltage.   

With low-power audio (like you might get through a 3.5mm connector), you shouldn't have to worry about the contact voltage/current ratings on the switch or relay.

A regular 'ol mechanical relay is probably your best bet.   There are also solid-state switches and solid-state relays.   Most solid state relays are SPST, so you'd have to use more than one, and many won't work with audio.    Solid-state switches are also usually SPST, but you typically get more than one switch in a package, so you can wire them in various configurations.
503  Using Arduino / Project Guidance / Re: Light organ with softwarefilter for different spectrums. on: April 10, 2013, 02:45:50 pm
You might want to look at the MSGEQ7 chip.  It takes your audio signal, splits it into 7 bands, and gives you 7 (time mulitplexed) DC signals.   You don't have to use all 7 bands, or you could combine some of the bands in software.

Once you get it working...

One "trick" I use with lighting effects is to make them auto-calibrate to the signal level (over period of 1/2 minute or so).  That way, the effect responds well to quiet or loud songs, or when the volume is adjusted, and you never have to manually adjust the sensitivity of the lighting effect.   For example, you can make a simple effect where a light/LED comes on when the signal is louder than average, and off when it's less than average.   You get a lot of blinking/flashing action with the sound/music, no matter what.

With a color organ I'd auto-calibrate the frequency bands separately, so that a song that's light on the bass generates almost as much "action" in the bass channel as a bass-heavy song, etc.

I built a light organ (AKA color organ) in the 1970s (from a kit that didn't use a microcontroller).  IMO, the effect can get boring.  A couple of suggestions to make the effect more interesting...   Switch the channels around randomly so that different lights/colors respond to the different bands at different times.   Or if you are using LEDs, consider using RGB LEDs to change the colors around.
If you make a spectrum analyzer, you can randomly reverse it to put the bass on the right, or make it randomly run upside-down.

Since I got bored with the color-organ effect, I ended-up redesigning mine into a 4-channel random color/pattern effect that just pops-up a different pattern with the volume-beat.   I still have that  effect, and with colored floodlights it makes a good "main" or "background" lighting effect that runs full-time at my occasional DJ gigs.  (It's designed so that it's never "dark".... There's always at least one light on. )

----------------------------------------------------------------
Or, if you want some other lighing effect ideas...
The last lighting effect that I built (with the Arduino) has two channels (left & right) with 24 LEDs each and 7 different fucnctions/modes, such as a (giant 8-foot tall) VU meter effect that works as a normal bar-graph meter or as a moving-dot meter, and it can be reversed so that it works upside down, and/or inverted (so that the LEDs go off when they would normally go on).    There are other random chasing/sequencing/flickering/blinking modes with random patterns variations for each mode.  For example, there is a chase mode where it "moves" a number of steps in one direction and a different number of steps in the other direction with the speed controlled by volume.   And an option where the chase-direction changes with the beat, etc.   With all of the variations, it can run a long time before you see a function/option/pattern repeated. 

I don't have any effects that respond to frequency.... I've thought about a giant spectrum analyzer, but it woud require LOTS of wiring/soldering and it would be bulky.  And... I want to build stuff you don't see everyday.  Or, I've thought about making a matrix that could work as a spectrum analyzer or all kinds of other effects/patterns... But I think a 10x10 matrix wouldn't be enough, so again....  Too much wiring/soldering in a large matrix.

Now, I'm working on a super-simple effect that will basically toggle between two floodlights with the volume/beat.    Of course, I won't keep the software quite that simple, but it will remain a two-channel effect.   I consider this a "special effect" that could get boring quickly and the idea is that it will NOT run "all night".

504  Using Arduino / General Electronics / Re: Can I get away w/ just one pull-down resistor? on: April 09, 2013, 03:52:38 pm

My question is, if I'm wiring multiple buttons can I use just one 100k ohm pull-down resistor on the ground wire daisy-chain (towards the micro-controller's header)? I can, right?
No! Each input needs it's own pull-up or pull-down.    When you press the button (and short the input to 5V) the pull-down resistor gets "overpowered" and is no longer "pulling-down"...   That's the whole idea of how it works...   The resistor provides enough current to pull-up (or down) the input when the switch is open.   But, when the switch is closed, it "overpowers" the resistor and forces the input down (or up).

And, all of your inputs would have to be wired together at a common point, so pressing one button would affect all of the inputs.
505  Using Arduino / Project Guidance / Re: Arduino Controlled Dimming on: April 08, 2013, 04:28:26 pm
An optoisolator & TRAIC works with AC incandescant bulbs by switching on the current for part of the AC cycle.   I don't know much about dimming fluorscent lamps, except that method doesn't work... smiley-sad   One complication is, at low levels you have to keep the starter filaments powered-up, and a simple TRIAC-based dimmer will reduce power to the filaments.

You might want to do some research about how fluorsecent lamp dimming works before you jump-in.

I found this electronic ballast that works the same as high-powered LED dimmers - It uses a 0-10VDC control voltage to adjust the brightness.

With a ~10V power supply, a transistor or MOSFET, and an RC filter, you can convert the Arduino's PWM output to a variable DC control voltage.
506  Using Arduino / General Electronics / Re: Filtering 5V and 12V in a noisy automotive environment on: April 07, 2013, 12:29:14 am
A capacitor alone doesn't do much, because there is so much current available in an automotive system to charge-discharge the capacitor.   The series diode with a small capacitor (maybe 1uF) should work very well for an Arduino input.  If you need to filter a 12V power supply, you'd probably want to increase the capacitor to 1000uF or more.   

A more "traditional" filter, is a series inductor, followed by a parallel capacitor to ground.    The larger the inductor and capacitor values, the more effective the filter.   The inductor has to be rated for whatever current is flowing through it to the load.       
507  Using Arduino / General Electronics / Re: Assistance with using a voltage comparator on: April 05, 2013, 12:38:00 am
You don't need a comparator...  You just need to knock-down 12V to 5V, right?

If you are switching between 12V and ground, a voltage divider (two resistors) might do it.   But the "12V" in a car van vary a fair amount, and you can get voltage spikes.   So a resistor (maybe 10k Ohms) and a pair of protection diodes would be a better option.
508  Using Arduino / Project Guidance / Re: Is arduino ok for the job?? on: April 05, 2013, 12:17:44 am
At first glance, it looks like the Arduino could do it.    The Arduino Uno has 14 digital I/0 pins plus 6 analog input pins.   The Mega has more.

The RFID, GPS, and GSM/Ethernet should be possible with additional hardware ("shields"), but you'll have to do some research and determine if they can all be  used together on the same Arduino.
509  Using Arduino / Project Guidance / Re: Analog output coding on: April 05, 2013, 12:05:39 am
Well... There are a few complications...

What's the impedance of the speaker?   How did you get 2.5V, and is that an RMS value?

The Aduino is rated for 40mA maximum, So a regular 8 Ohm speaker will pull too much current.  You may need an audi amplifier or an additional audio amplifier chip.

The Arduino doesn't put-out AC.  It puts-out a 0 or +5V value, which can be a square or rectangular wave.   With a series capacitor you can remove the bias and get (approximate) square waves that go from -2.5 to +2.5V, which is actually 2.5V RMS.

Quote
I am unsure what to put for "Value." I read that "value: the duty cycle: between 0 (always off) and 255 (always on)." What is the meaning of these values?
It's PWM = pulse width modulation.  It's the duty cycle of the rectangular wave (around 400kHz if I remember correctly).     With a value of 127, you'll have an (approximate) square wave that's 5V half the time, and zero half the time  (i.e. 50% duty cycle and an average of 2.5V).  With a value of 1, it will be low (zero) for 254/255 "counts", then high for one count, then low for 254 counts again.  If you modulate the PWM value at an audio frequency, you'll be modulating the average voltage and you'll hear the tone from a speaker (or piezo, etc.)
510  Using Arduino / Project Guidance / Re: LEDs controlled by speed-- Programming help!! on: April 04, 2013, 08:11:33 pm
Quote
When you said PWM is that comparable to 'fading'?
Correct! See the Fade Example.

Quote
I was under the impression to use an AnalogWrite for that function rather than a DigitalWrite.
Correct again!

Quote
I am having a lot of trouble with the programming
As always, I recommend that you break your project into separately-testable parts...

I'd start with the LED stuff, since that's the easy part.    Just hard-code the "fake" RPM data into you sketch to test the LED hardware & software.

Then when you build & test the RPM sensor, use the Serial Monitor to send the input-state, and perhaps some variable-values and/or the RPM to your computer over the USB connection.

When you're confident that the RPM sensor hardware & software are working, you can add the code to detect/calculate acceleration & deceleration, and merge it all together.

Pages: 1 ... 32 33 [34] 35 36 ... 78