Show Posts
Pages: [1] 2 3 ... 91
1  Using Arduino / Audio / Re: Responsive music/sound on: September 26, 2014, 05:01:50 pm
Have you used MIDI (like Ableton or KONTAKT) before?  I don't use MIDI myself, so I can't help with the details.   But, MIDI seems like the way to go.   With MIDI you can simulate anything from a quiet solo instrument to a full-on orchestra.   (It just can't do lyrics & vocals.)   So, you can sense the foosteps, movement, etc, and then your software can determine how many instruments are played, how loud they are, the tempo, or even the song if you want a different song for different situations.

Like I said,  I don't use MIDI myself, and I'm nor sure about the Arduino's limitations.  Certainly, the Arduino can serve as a sensor/controller (as long as you have some kind of appropriate "footstep sensor", etc.).  With the some additional hardware-driver circuitry, it can send MIDI commands to a MIDI instrument (or to a computer) over the MIDI bus.

If you've worked with MIDI, or downloaded MIDI files, you know they are "simple" small files because they only have to contain the notes & timing, not the actual sounds.  So...  whatever is generating & sending the MIDI commands doesn't have to be powerful with lots of mamory.   

The virtual instrument does all of the "hard work".    The Arduino itself doesn't have the kind of memory you'd need for lots of high-quality virtual instruments.   I'm not sure what's available as an add-on board, but building a MIDI instrument with lots of voices is going to be the complex part and I'm not sure if it can be done with the Arduino.
2  Using Arduino / Project Guidance / Re: Hello.. I'm new.. and I need help! please! on: September 26, 2014, 04:41:10 pm
Usually, a "pan and tilt" mechanism has two servo motors, not stepper motors.

If actually want to move the crane, that might work better with stepper motors, or perhaps with regular geared-down DC motors.

A servo  rotates over an arc, so it won't make a full 360 degree revolution.  The motor is geared-down (for slower speed and more torque than the motor itself).  The driver is built into the servo.   All you need is a DC power source, and then you send it a repeating pulse from the Arduino to set the target angle.     The pulse width determines the angle.    There is a servo library for the Arduino, so you don't have to write all of the code from scratch.

I am completely new to the Arduino and general electronics .. Knowledge of computer's high...
I'd suggest you start with either the input or output.   Maybe get a small servo to experiment with, and just write some code to control it.   Then add the joystick and use some LEDs or the serial monitor (without the servo) to develop & debug the code for your joystick.  Then, blend the input & output code together.

I think the hard part would be determining how powerful your servos need to be.    You can probably make a good guess, or maybe you can find the torque ratings on commercially made pan & tilt mechanisms made for cameras.

You can buy a pan & tilt mechanism that's made for a robot.    These are just the servos and the mechanical parts without a joystick, power supply, or controller.   Or, I think you can buy the mechanical part without the servos.   That's one way to do it if you don't want to build the mechanical parts yourself.

If you buy a pan & tilt mechanism that's made for photographers, it will come complete with everything ready-to-go.
3  Using Arduino / Audio / Re: Play multiple sounds at same time on: September 26, 2014, 10:58:28 am
I don't know how feasible/practical this is, but in this post I explain the concept of mixing sounds digitally by summing (or averaging) .

What I don't know how to do is,  open multiple MP3s at the same time, decode/decompress the MP3 data, and then sum/average that data before sending the data to the DAC on your MP3 shield.
4  Using Arduino / Audio / Re: How to add and average 4 audio signals with arduino? on: September 26, 2014, 10:49:15 am
Are you sure this is the right device for your application?
Remember the Uno has only one ADC.
The Arduino has 7 ADC inputs multiplexed into one physical ADC..  So, it effectively has 7 ADCs and you certainly can get 7 separate analog readings from 7 different analog inputs.

It's only a 10-bit ADC, it's a bit slow for high-quality audio, and there is no true DAC, and there's not much RAM.   So, the Arduino may not be the best choice for an audio processor, but with that out of the way...

Hello, i need help to acquiring, adding and averaging four audio signals
You've got it with "averaging"!   Mixing is done by summation...  Analog mixers are built around summing amplifiers, and when soundwaves mix in the air they are being acoustically summed.

So, you sum the data sample-by-sample (i.e. 44,100 samples per second for CD quality audio).   That is, you sum the first sample from all four channels and the result becomes the first sample in your result/output channel.   Repeat till done.

Now for the "averaging"...   When you sum the values, of course the result is bigger (except sometimes you are adding a negative to a positive so every single sample won't be larger).    That means you can clipping (or worse) if for example, you are using 16-bit audio and you go "higher than you can count" with 16-bits.     So normally, you have to scale-down the result.   You can scale down the values before summing, or after summing, or both.    The easiest way would be to do the normal averaging thing, and divide the output values by 4.

With normal audio mixing, of course yo might want different volumes in each input.     You adjust the volume by multiplication (or division)   i.e You can reduce the volume in half (-6dB) by multiplying every value by 0.5.   If you are not that familiar with audio, half the value doesn't sound like half the volume because our ears are logarithmic, and that's why we often use decibels.

5  Using Arduino / General Electronics / Re: Problems with various power supplies / ground loops? on: September 26, 2014, 10:19:15 am
Probably not a ground "loop", but it does sound like a grounding problem.  It seems like there may be a missing ground between the 6.5V supply and the H-Bridge.    The USB supply may be getting grounded through the computer and "back around" to the H-bridge.... somehow???   ...Then, you disconnect the USB, and you loose the ground connection???

Do you have a multimeter?    Is Arduino running OK with the 6.5V supply?    Is there a common ground between the H-bridge and the Arduino?   If you've got a multimeter, check the resistance between all of the grounds (with the "fail' condition, with the 6..5V connected, the USB disconnected, and the power off.)

FYI - A ground loop can cause noise in audio or data-communications applications and it might even cause enough noise to "crash" your Arduino.    But, it won't cause you to loose power.
6  Using Arduino / Project Guidance / Re: How to Connect a 8Ohm Speaker to MCP4821 DA-IC? on: September 24, 2014, 03:17:04 pm
You can't directly connect a speaker.  The output is rated for 25mA maximum.    (From Ohm's Law, Current = Voltage/Resistance.)

You need a "power amplifier".   If you want to build one yourself, the LM386 is a popular low-power power amplifier chip, and it's fairly easy to use.   Or, there are other power amplifier chips.

Or, you can plug it into an "Aux" or "Tape" input of your stereo system*, or even your TV.  Or, you can get a small amplifier something like this.   

If you have a desktop/tower computer you can connect to the line-input on your soundcard.  (The mic input on a laptop is too sensitive for regular line-level audio).    If you use your soundcard, test your computer's configuration by plugging-in a CD player or DVD player, or something that you know is working before you connect your "unknown" DAC.

* If you have a good high-power hi-fi system, be careful when experimenting!   An unexpected blast of sound could damage your woofer or tweeter....   It's possible to fry a tweeter with high-power high-freqency test-tones that you can't even hear.     A 100W speaker is generally designed to handle music with occasional 100W peaks, and can usually be damaged with constant 100W test-tones.  The tweeter in a 100W speaker system can usually be burned-out with 10 or 20W test tones!
7  Using Arduino / General Electronics / Re: Please help with the 230V AC connection ! on: September 24, 2014, 12:54:38 pm
1). Please see the picture of the SSR40-DA relay below,  do I need another snubber protection circuit, or usually solid state relays already incorporate in this itself ?
You don't need anything else.   We don't know exactly what's in side the relay, but it's ready-to-go.

2). If I do not need another snubber circuit, do I just connect the Arduino - relay - solenoid valve - mains directly without additional resistors ?
No.  But double-check the specs.   The Arduino puts-out 5V at 40mA or less.    Generally, these things have a range like 3 - 15VDC, so the voltage should be fine.   And, if you check the control current it's probably less than 10mA.  Again we don't kwow what's inside, but if it's rated to be controlled by 5V, you don't need a current limiting resistor or anything else...   You apply 5V and it turns on, remove 5V (or switch the arduino output to  "low") and it turns off.

3).  There are three power pins from the valve and the mains as well: hot, neutral, earth. However there are only two connection pins on the relay: hot and neutral. So do I need another different relay that has the earth pin on it (any recommendation or that is the name that has earth pin on it) ? Or there is a way of getting around this ?
The hot wire passes-through the relay and gets switched.  The neutral & ground are directly-permanently connected.   

Have you ever looked at a regular light-switch in your wall?     There are only two terminals and only the hot passes-through the switch.  (Usually, there is also a ground terminal on the switch for safety, and "3-Way" switches have 3 power-terminals.)   

4).  How do I physically connect the relay, valve to the mains ? Do I buy a cheap UK lead (e.g. shown below in the picture) and cut the head or open the head and tie those pins to the relay accordingly by electric tapes ? Is this safe ? Can you teach me in some details like which line goes to which ? For example, how does it differ from the typical bulb connection below.
That depends on what you have on either end.   Are you getting power from the wall socket?   What kind of connections does the solenoid have?   (I don't know the UK color code.)

and tie those pins to the relay accordingly by electric tapes ? Is this safe ?
Usually, not electrical tape.    Electricians normally use Wire Nuts to attach wires in "free air", where there is no screw terminal or other option.   

It's safe as long as everything is insulated, isolated, and wired correctly,  so you can't touch the hot wire or anything directly connected to the hot wire. If all of the AC closed-up is in a grounded metal box, it's safe because if anything goes wrong the current will be "shorted" to ground and you'll blow a breaker.    But, if the ground comes loose, or something is wired incorrectly so that you or the Arduino somehow makes contact with the line voltage, bad things can still happen!    (The relay provides isolation between the power line voltage and the low-voltage Arduino.)     

Ironically, a grounded box creates a hazard if you have the box open to work on the connections...  If you touch the grounded box with one hand and a hot power line with the other hand, there is a "nice" path for the current to flow from hot, through your body, to ground!  The guys who work on really high-voltage stuff have a "rule" to keep one hand in their pocket (and wear insulated shoes) so there is no path through their body.    But it's hared to work with one hand in your pocket, so electricians working on 120V/220V household power don't do that.

In general, it's not safe to work on power line voltage, so you may just have to be careful when testing/troubleshooting/experimenting!
8  Using Arduino / General Electronics / Re: 3 phase SSR vs single SSR for controlling 240v appliances on: September 24, 2014, 11:59:12 am
That looks reasonable to me.     If it was me, I might add a couple of little neon indicator lamps to indicate when each side of the line is hot.

The SSR has a couple of advantages over a mechanical relay...   It will run directly from the Arduino (most higher-power mechanical relays require more coil voltage and current).   

And, the screw connections make wiring easier, and it's easier to mount.   

And, it will never wear-out.     (Mechanical relays generally have a very long life, so that's not a big deal.)
9  Using Arduino / General Electronics / Re: LED Issues on: September 23, 2014, 05:20:16 pm
I thought LEDs normally fade as less voltage is applied to them.  Is this necessarily true? Or are some LEDs just designed to be cut off at a certain voltage?
Yes and no.... Mostly no...  smiley-wink  Like all diodes, LEDs are extremely non-linear...    You have to control the current, not the voltage.    An LED rated at  2V LED might not come on at all at 1V, and it might  get tons of current and fry at 3V.    You power it with a current-controlled source and the voltage "falls into place".     The actual operating voltage may vary from part-to-part and with temperature, so even if you could very precisely control the voltage and dim the LED that way, it's not practical and it's never done that way.
10  Using Arduino / General Electronics / Re: LED Issues on: September 23, 2014, 05:11:55 pm
In general, you can't connect an LED directly to the Arduino.    At a minimum you need a current limiting resistor, and for "high-power" LEDs  (and 1 or 3W is considered high power) you need an external power supply and a transistor or MOSFET to "boost" the voltage & current.

If you connect a 3W LED directly to an Arduino, you risk frying your Arduino.  If you hook-up a regular LED (like the one on pin 13 of your Arduino board) directly without a current limiting resistor you may blow the Arduino and/or the LED.

The Arduino puts-out 5V at 40milliamps or less or less (the actual current and power depend on the load per Ohm's Law).    That's a maximum of 0.2 Watts.     A regular LED is usually  about 0.04 Watts (40 milliwatts) with some additional power also being consumed in the series resistor. 

LEDs from the hardware store sometimes have some additional circuitry in them, so I don't know what you have.     You can't connect an LED directly to a constant voltage supply, it has to be current-controlled/limited.    The circuit in the hardware-store may be a current controlled power supply, but that does NOT mean you can connect it directly to an Arduino.      And, this circuit may make the LED non-dimmable.
11  Using Arduino / General Electronics / Re: XLR cables on: September 23, 2014, 01:13:57 pm
Tyipcally these cables are used for audio signals of microwatts or milliwatts (and micro & milliamps) so nobody cares about the current rating.    If you find the wire gauge spec for a cable that might be your best guide.   Some manufactures/vendors will specify the gauge and others will not.

Or, you might need to build our own so you can use a large wire and you'll know the gauge.

Monoprice has 16AWG XLR cables.   That should be hefty enough for 10A as long as your cable run isn't too long.
12  Using Arduino / General Electronics / Re: External VI and USB-Power on: September 22, 2014, 01:28:47 pm
I know that this is off-topic but how does a 10k resistor connected in series in the telemetry wire protect the arduino? As far as I know a risistor connected in series only drops the voltage.
The Arduino has internal protection diodes between the input an VCC and between the input and ground.    If the voltage exceeds Vcc or goes negative, one of the diodes begins to conduct and this "clamps" or "clips"  the voltage.     

That only works if the current is limited, and that's why you need the 10K resistor.   For example, if you connect a 12V power supply directly to one of the inputs, the protection diode will get fried, and other stuff inside the chip might be fried too.  It also only works if the Arduino is connected to power & ground.

The 2nd schematic on this page is the same concept.

The Arduino's inputs are very high impedance (megohms) so the "voltage divider effect" is limited and you don't get much voltage drop across the 10K resistor.    However, at high speeds/frequencies  the input capacitance could affect the signal (the resistor & capacitance form a low-pass filter) and with the 10K "source" impedance the input is more prone to noise pickup.

The 10K value seems perfectly reasonable to me, but I haven't checked the specs or done the calculations on the current capability of the protection diodes.     
13  Using Arduino / General Electronics / Re: Need Suggestions for Extending Approximately 40 Wires within 1 larger Wire on: September 19, 2014, 05:15:32 pm
My project is a replication of Guy Manuel's Daftpunk helmet.
I don't know what that is, and I can't research it right now...

What you are looking for is called "multiconductor cable".    Telephone & communications companies use lots of it.  But I agree with what's been said.   Connectors are bulky and wiring/soldering 40 conductors on each end of the cable is a pain if you can't use IDC ribbon connectors.

Maybe there is another way to do it?   Whatever "it" is. smiley-wink   For example, you can send data serially...  The whole internet is done serially.    I built a lighting effect with 48 individually addressable LEDs, and it's controlled serially with 3 Arduino outputs.     Of course, I have to also supply power and then there are some chips on LED side...   And it still required LOTs of soldering (two wires to each LED).
14  Using Arduino / Audio / Re: MP3 Modules and Speakers on: September 19, 2014, 11:16:51 am
1. What is a module (i.e. the one here: and how do i connect it to an Arduino?
It's not that clear to me either....  I can see how you communicate serially via the RX & TX pins, but I don't see how it connects to the SD card.

If yo look at the specifications, the commands in the table are in hex (hexadecimal =base 16).   For example, if you send E8 (232 decimal) over the serial connection, that's a "Volume Up" command.   You can use hex directly in your sketch, but if you want to convert between decimal and hex, the calculator that comes with Windows can do it in the "Programming" mode.

There is a serial library for the Arduino for sending/receiving serial data.  You just need two I/O pins.   Note that the TX and RX connections are criss-crossed.   The Arduino's TX (transmit) pin connects to the other device's RX (receive) pin and vice-versa.    i.e.  You don't talk into another person's mouth, you talk into their ear, and they talk into your ear. smiley-wink 

3. Does anyone know of a tutorial that shows how to build a mp3 shield from a VS1053  such as the one here (
That's usually not practical or economical...   Start with VS1053 datasheet.    You'd need to have a PCB made and the ability to solder fine-pitch surface mount components...  It's not something I can do "at home".   

And I haven't looked into what's available, but for a complex chip like this, you'd usually need to buy an evaluation board and probably obtain a software development kit (from the chip manufacturer) in order to do your hardware & software design & development. 

2. How do I use an 8 ohm speaker (resistors, connections, circuit, and  most importantly amplification)?]
You need an amplifier to boost the power.   Look for a "power amplifier" chip if you want to build one yourself.  For example the LM386 is a popular choice as a low-power amplifier.    The manufacturer's datasheet will give you the design schematic, showing any additional parts you need to add, etc..
15  Using Arduino / General Electronics / Re: Lesson Learned on Vishay VO14624 Solid State Relay on: September 17, 2014, 03:42:55 pm
Most "solid state relays" have a current limiting resistor, and the specs show a control voltage range.   But I've seen parts like that one too.   (Actually, I've seen the datasheets, not the actual parts.)     Personally, I'd call it a "high power optoisolator" if it doesn't have a resistor...  But the manufacturer gets to name the part! smiley-wink

Usually the clue is a voltage or current spec...  If it says it's controlled by 5-15V, or something like that, it has an internal  resistor.  If they specify a current, you'll need to add the resistor.
Usually the control voltage and output voltage & current ratings are specified "up-front", on the datasheet since they are very important in selecting the right relay.   If there's no resistor, the control current may be "buried" somewhere on a chart, since it's not quite as important in the selection process...   Generally, you can select the resistor later.   

So I just made a small tuition payment in the school of experience.
smiley-grin    I like that!   I'm going to try to remember that one! smiley-grin
Pages: [1] 2 3 ... 91