Show Posts
Pages: 1 ... 47 48 [49] 50 51 ... 90
721  Using Arduino / Project Guidance / Re: programming a digital controlled variable gain amplifier on: March 12, 2013, 05:24:26 pm
That should work.   The Arduino has an SPI Library.     I'm using a serial LED driver that uses a similar concept and I didn't bother with the SPI library...  I just wrote a little function to send serial data and the control data over 3 output pins.

It's not too complicated.   Basically, you write a bit to your data-pin.  Then you send a clock-edge to load (AKA "clock-in") that data bit into your receiving device (your amplifier).   Reset the clock, and update the output-data on the data pin.   Send another clock-edge, repeat, etc.   When you've sent all of the data, one bit at a time, you send a "latch" signal to tell the receiver that all of the data has been sent, so that it can re-assemble the individual bits into a byte/word, or whatever.
722  Using Arduino / Audio / Re: Audio to physical vibrations - design of the system on: March 12, 2013, 02:33:03 pm
You might take a look at the MSGEQ7 chip.  It's not going to give you the exact filtering you are looking for, but it will simplify things a LOT!  (I have not used this chip myself.)

My first question is, is it possible to design bandpass filters with a width of about 50 Hz or less?
Sure!   The bandwidth is related to the 'Q' of the filter, and it's related as a percentage of the center frequency.  i.e.  It's easy to make 100Hz filter with a width of 50Hz.   A 10,000Hz filter with a 50Hz bandwidth is much more narrow and more complex (higher-order, higher Q).

I'm trying to steer away from circuits and implement something in software...
You're still going to need some hardware.    If you are planning on using an Arduino, I'm not sure when you'll run out of processing power.   I think running several DSP filters simultaneously could be an issue (in addition to other processing?).   There are FFT libraries for the Arduino, and that would essentially give you as many "filters" as you need.  I'm not sure about the limitations of that either.

If you are planning on using a computer, more than 6 outputs (from a 5.1 channel soundcard) could be tricky.    And, you'll have to know something about DSP programming as well as Windows audio programming.
723  Using Arduino / Project Guidance / Re: Power led regulation with PWM on: March 07, 2013, 07:49:13 pm
Is it a feasible idea to run a 3W led via a transistor and a pwm pin...?
It requires a few more parts than that.   As Mike says, high-power LEDs (1W or more) are usually run from a special constant-current LED power supply.   

These circuits can be tricky to build, and most people just buy the constant-current supply.  There are special ICs, or some switching voltage-regulator chips can be used to make a switching current-regulator.

Constant-current supplies normally do use PWM, but there's a bit more to it...  There is an inductor to "smooth out" the current from the PWM pulse, and there is feedback "monitoring" the current and adjusting the pulse-width to keep the current constant.

Adding a resistor to this circuit to handle the 1.3V as a load and limit the current to the LED is a common practice.
That's NOT a common practice with high-power LEDs, and it's BAD PRACTICE when most of the voltage (~10V out of 12V) is dropped across the LED.    Since LED's are "constant voltage" devices, any changes in power-supply voltage, or in the LED voltage (due to temperature, etc.), will end-up as equal changes across the resistor...  For example, if the power supply voltage were to rise by 10%, the voltage across the resistor will almost double!   Therefore, the current throught the LED and resistor will also double!

You can get-around that problem by using a higher-voltage supply (maybe 24V), but then the resistor needs to dissipate more than 1W.   ...So, the "standard solution" is to use a constant-current switching regulator, which is much more efficient.   

A regulated power supply won't vary by 10% (when operating normally), but the point is that the effect of any variations is magnified.      And actually, you can often get-away with this stuff in a one-off hobby-project, because you can adjust the resistor value by trial-and-error to compensate for component variations.  (That's assuming you don't blow-up too many parts during the trial-and-error testing. smiley-wink )
724  Using Arduino / General Electronics / Re: OPAMP multivibrator help on: March 06, 2013, 02:25:57 pm
I dunno... My calculus is very rusty. smiley-sad   Maybe try this circuit.  Or, do the usual thing and use an LM555
725  Using Arduino / General Electronics / Re: Very simple resistors question on: March 04, 2013, 06:12:37 pm
You know the voltage drop across the left hand network (5V) and you can measure the current flowing through it. That tells you its resistance (Ohm's law).
Sort of...   Maybe, "Close enough for government work" smiley-wink  

The resistance of an LED is not constant like a resistor...  An LED is a non-linear device.  Ohms Law is always true, but when you change the current through the LED, its effective resistance changes.  

The voltage drop across the LED is (approximately) constant under normal operating conditions.  When you increase current, its effective resistance decreases.   If its resistance was constant (like a resistor), the voltage would increase proportionally with the current.
726  Using Arduino / General Electronics / Re: Simple voltage input question on: March 03, 2013, 01:33:52 am
...instead of GND
That's  a little confusing...

5V into Vin won't hurt anything.   It's normal to get some voltage drop across a regulator.  In fact you need some voltage drop across the regulator in  order for it to work...  So, you need to put more than 5V into a 5V voltage regulator.   

There is a spec is called "dropout voltage".   For example, if the dropout voltage for a regulator is 1 Volt you need to feed at least 6V into a 5V regulator or else it "drops-out" of regulation and no longer functions as a voltage regulator.
727  Using Arduino / Project Guidance / Re: Boost Converter on: February 28, 2013, 05:45:13 pm

That's not a usable circuit unless you just want to create some high-voltage sparks or something like that.  You need an oscillator and some feedback to control the pulse-width and output voltage...   You either need a boost regulator chip, or a ship-load of more components!
728  Using Arduino / General Electronics / Re: Overwhelmed by basic electronics on: February 27, 2013, 01:40:16 pm
I can't recommend a good website.  But if you want to learn online, you need to find a website that has tutorials from "A to Z"... Starting at "A" with some kind of logical sequence & structure. 

I'm not sure how much you know already, but diodes & hex inverters are NOT the place to START.  You need to start with voltage, current, and resistors.   You need to understand Ohm's Law and Kirckhoff's Law.   

Once you understand all about what voltage and current are, how they are related, and how they divide and distribute with series & parallel components, it shouldn't be too hard to understand diodes.   And once you understand how a garden-variety silicon diode works, it's easy to understand Schottky & zener diodes.

The best way to learn is to take a class.   You get structure, feedback (quizzes & tests), an instructor to answer questions, fellow students to learn from, etc.   If that's not practical or possible, or you just don't want to do it, I recommend you get a basic-beginning electronics book. I'm sure you can find one in the library if you don't want to buy one.

I'm sure you can find everything you need to know on the Internet...  If you know what to look for...   There's probably enough information on the Net to become a brain surgeon, but random self-study isn't going to work for most aspiring surgeons. smiley-wink   Electronics and programming are NOT easy "subjects", and most of us need some structure.

729  Using Arduino / General Electronics / Re: How to protect analog output (current protection) ? on: February 26, 2013, 02:09:21 pm
I assume the idea is to protect the DAC from shorts?

If you don't need absolute accuracy (such as an audio application) the traditional approach is to simply put a resistor (say 1K Ohm) in series with the output.   In audio applications, you are typically driving an input impedance of 10K - 100K, so the voltage drop across the current limiting resistor is not significant.    And since the voltage drop is linear, there is no added distortion... the signal is just slightly quieter.    The voltage drop across the resistor only becomes significant if you connect the "wrong" load, or if you accidently short the output.

If you need absolute accuracy, you can use a current-limiting resistor on the output of an op-amp buffer, with the resistor inside the feedback loop.  The feedback will maintain low effective output impedance (holding your output voltage) as long as the voltage drop across resistor & op-amp output-stage is not so great that there is not enough voltage left for the load.                 
730  Using Arduino / Project Guidance / Re: Arduino Mega can read 16bit serial data? on: February 26, 2013, 01:31:11 pm
There's really no limit to to number of serial bits you can read/write...    Serial means you are sending one bit at a time.   I've got a set-up where I'm sending 24 bits (serially) out of the Arduino to shift-register type LED drivers, driving 24 LEDs.

And, think about it...  If you can send one byte (8-bits), you can send one byte after another, after another, etc.  That's how RS-232 works...  RS-232 uses 8-bits, but there is no problem with bigger "numbers" as long as you send 8 bits at a time.   

With parallel data, you need 16 lines/connections to send 16-bit data.  In that case you are limited by the hardware.  But again, you can more than 16-bits with 16-bit hardware by sending more than one 16-bit word.   It depends on your protocol.  

[quote....without lost of information?[/quote] If you are sending the data across a connection that might be unreliable, such as a long distance or over RF or IR, you might need some sort of error detection/correction.
731  Using Arduino / Project Guidance / Re: Building custom Led tail lights. Total noob here. on: February 25, 2013, 08:12:04 pm
My idea is to have brake/running lights so I need to have it run at 50% and then go up to 100%. Then for the turn signals I wanted a sweeping effect.
I assume you'll need high-power LEDs... probably 1W?    But, if you can get-by with standard (~20mA) "super bright" LEDs, that will simplify things a lot.   Have you experimented with LEDs yet to check the brightness?

I have an arduino, but am now learning I may need a different micro controller for LED matrices...
A matrix is one way to do it...  The Arduino can drive a matrix, depending on the size of yoru matrix and which Arduino you are using.

How many LEDs are you going to use?   My current project is a music driven lighting effect that has 48 individually-addressable "super bright" LEDs driven by six MAX6968 LED driver chips.   These chips are driven serially, and can be daisy-chained serially, so you only need 3 microcontroller output lines to control many LEDs.  I have a "stereo" set-up, so I'm actually using 4 control lines (separate left & right data lines) from an Arduino Uno to control two banks of 24 LEDs.   

There are many different LED driver chips...  This particular one can use PWM dimming to dim all of the LEDs as a group.  (You can turn on & off the LEDs individually, but all of the on-LEDs have to be dimmed together).   I'm not using that feature, but it would work for you in your applicatication.

If you use high-power LEDs, you are probably going to need a separate dimmable constant-current driver circuit for each LED.  You can buy or build constant-current LED power supplies.  You could control these serially (using shift registers) or with a separate microcontroller-output for each LED.    Depending on the number of LEDs, these "high power" LED drivers could get expensive.

Basically, the hardware design & wiring are the hardest part.  Not really that big of a deal, but it could be a lot of wiring...   It felt like it took me "forever" to solder wires to 48 LEDs, and also solder the wires on the driver-end. 

The microcontroller programming is simple... Assuming you've done some programming before. 

so I need to have it run at 50% and then go up to 100%.
That's easy to experiment with, but I think 50% is not enough contrast/difference...   I was guessing 25 or 33%...   I looked-up a dual filament bulb and it was 6W & 21W.    Both filaments are on in the bright blinker/brake state, so that would be 6W when dim and 27W when bright, or about 22% when dim.

732  Using Arduino / Project Guidance / Re: Positive and Negative Voltages (Can I do this circuit?) on: February 20, 2013, 05:07:12 pm
Your basic idea looks like it would work, with a couple of limitations...

What kind of source do you have?   What's it's impedance or current capability?

Diodes are nonlinear.   You need to have 0.5 - 0.7V across them before they turn-on.  That means you are not going to read any positive voltages below around 0.5V, and you'll need to add the diode-voltage drop to any readings you get.   (You can do the compensation is software.)    The biasing resistors on the negative input will turn-on the "negative" diode, so you will be able to read small negative voltages, but again you'll have to compensate for the diode-voltage drop.

Also, you WILL need that voltage divider for +10V, because connecting more than 5V to an input pin can damage the Arduino.
733  Using Arduino / Project Guidance / Re: Which board to use for recording guitar and bass? on: February 15, 2013, 06:08:31 pm
Yeah...   An Arduino or other microcontroller isn't going to add anything other than possibly making the thing more portable than a computer.    And compared to programming a computer, the whole project is more difficult because you have to design the hardware as well as the software.

Then again, I'm not familiar with a lot of the behringer products. Thanks for telling me that, I'll check that out and see how well it works.
The Behringer gizmo is probably the most economical way to plug a guitar into a computer, but there are all kinds of audio interfaces with instrument inputs, mic inputs, or line-level inputs. (With these, you are not using your computer's soundcard unless you are using it to play-back or monitor the recording.)

For acoustic guitar, another simple solution is a "studio style" USB microphone.   These things can give you nearly pro studio results if you have a good acoustic space or studio, and if you are recording mono.  (You can generally only record with one USB mic at a time).   You can get these starting around $100 USD, and again you are bypassing your soundcard.   I do not recommend a cheap "computer microphone".   

A regular soundcard is pretty much worthless for good-quality recording because the mic input is designed for a computer mic and it's the wrong interface for any performance/studio mic (low-impedance balanced with an XLR connector, or a guitar (very high impedance).

Your software development will be a lot easier if you start-out analyzing recordings.     If you can get that working, it shouldn't be too hard to make your application work in real time.  And the hardware interface requirements will be the same either way.

Once you have the hardware set-up, recording is easy!   Most interfaces will come with software.  Or, any "audio editor" application can record.   Audacity is FREE.   I've used GoldWave for many years ($50 USD with free upgrades).

...and one of the options I'm adding is the ability to grade what you play.
Now the  bad news...   That might be difficult or impossible.  smiley-sad  There are programs for converting single-note sounds into

.  But from what I understand, there is nothing that works very well with chords or multiple instruments playing at the same time. 

But, the place to start is with FFT.    I'm sure you can find an FFT library for C#.   FFT will give the frequency content of any signal at any point(s) in time.   From that, it's fairly easy to determine the root frequency and convert that to a root note.  It's analyzing the harmonics & overtones that becomes tricky.

734  Using Arduino / Project Guidance / Re: I want to make driver circuit for a small but loud siren on: February 14, 2013, 08:06:19 pm
3 volts@ 1.3amps.
Have you tried 3V into an 8-Ohm speaker (with a MOSFET to boost the current)?    At a high-pitch, it might be loud enough.   

BTW - You won't get 1.3A through an 8 or 4 Ohm speaker at 3V.  (Ohm's Law).  And,  you won't get 375mA out of the Arduino (rated 40mA max), so you need a MOSFET (or something) to boost the current capability.

With an H-bridge circuit you can get double the voltage-swing +3V to -3V across the speaker, which will result in twice the current and 4 times the power, and 6dB more loudness.    And, going from 8 to 4 Ohms will double the current for twice the power or another 3dB.     So, with those two "tricks" you can get an additional 9dB.
735  Using Arduino / Project Guidance / Re: Sinusoidal linear motion using a DC motor on: February 14, 2013, 07:42:40 pm
I agree that without continuous position feedback (similar to a servo motor*) you are not going to get true sinusoidal motion, but you might be able to get some sort of speed-ramping.   DC motors just don't respond that linearly to drive voltage/current.   I think it's just going to take some experimentation. 

The motion is also going to depend on load (mass & friction).   You can "map" the torque/voltage curve for aDC motor, but a speed/voltage curve is a lot trickier, especially at slow speed.   If you have a "nice" constant load (like lifting a weigh on a pully) you could convert torque to speed, but I suspect you don't have such a nice load.

If more feedback sensors were added, say a total of 5, could the system be more reliable? two near each end and one in the middle?
I'm thinking 4 sensors...   An additional sensor for "almost open" and "almost closed".

And, I'm just thinking maybe a non-linear, non-smooth voltage curve might work best...   Something like run at full speed (or accelerate) at the start of the motion.   Then when you hit "almost open" or "almost closed", drop the voltage quickly.  Then, ramp-up the voltage to make sure the drawer closes.   That's how a mechanical door-closer works.   It closes quickly at 1st, then it hits a point near-closed and it suddenly slows-down.

* A regular servo motor only rotates about 180 degrees, so it probably won't work...     I suspect you'll need to gear-down and use several revolutions.

An alternative is a stepper motor.   With a stepper motor, you can precisely control position & speed, and you can run slow (or "hold") at full-power.    You'd still generally want 2 sensors to confirm your end-points.
Pages: 1 ... 47 48 [49] 50 51 ... 90