Show Posts
Pages: 1 ... 37 38 [39] 40 41 ... 90
571  Using Arduino / General Electronics / Re: Value capacitor? on: May 20, 2013, 07:02:27 pm
Quote
...but it looks a bit big to be only 100pF.
I was thinking the same thing.   Since it's a new part (not something that needs to be replaced/duplicated in a circuit), if it's for a critical application buy a new one!    Or, try it and if it doesn't work as expected, replace it.
572  Using Arduino / General Electronics / Re: Power Supply for Relay on: May 20, 2013, 05:25:04 pm
If you use something like that and two wall-wart power supplies, you'll have isolation.  So, why not just use a 5V wall-wart?   (If you use the same main power supply for both circuits, you are not isolated.)  You could also use an isolated DC-DC converter module.

Are you sure you need opto-isolation?   A relay is already isolated (there is no electrical connection between the coil and the contacts).

Quote
but this is obviously built for a breadboard and there's no obvious way to mount it inside a plastic box?
I see pins on the bottom, like it's designed to be plugged-into something.

573  Using Arduino / General Electronics / Re: Value capacitor? on: May 20, 2013, 05:11:40 pm
It looks like .1K pF = 100pF (=0.0001uF) @ 100V.
574  Using Arduino / General Electronics / Re: How to mount components in a box? on: May 20, 2013, 02:41:15 pm
Typically, you use standoffs.   If you need insulation, you can get nylon standoffs & nylon nuts & bolts.  (Of course, you have to drill holes in the box.)

I've heard about people cutting-up a BIC pen to make a standoff, and running a small machine bold all they way through.

Or if it's a plastic box, you can usually just bolt the board to the bottom of the box, as long as you don't tighten the screws too tight and bend the board.  Then if you are worried about the screws comming loose, you can use some loctite or hot glue.

A couple of times, I've used some Foam Insulation Tape and super glue as a quick-and-dirty solution... But I'm not recommending that.
575  Using Arduino / Project Guidance / Re: Interfacing a LOUD buzzer with arduino nano on: May 20, 2013, 01:18:45 pm
Quote
simply connect its ground with arduino's ground and the positive terminal with a digital output pin?
The Arduino I/O pins put-out 5V at 40mA or less.  If you need more than that, you'll need something like a MOSFET.   If your buzzer requires a different voltage from the Arduino, you may need a separate power supply.

If your buzzer has it's own built-in sound generator, you can simply switch-on & off the output pin.   If the Arduino needs to generate the sound, you'll have to send a square wave to the output.   Either way, the MOSFET will work. 
576  Using Arduino / Project Guidance / Re: Question concerning PWM resolution for motor control on: May 20, 2013, 01:04:57 pm
Quote
I need high resolution between 5 and 10% duty cycle and I don't care about anything outside of that. 8-bit is not precise enough.
If 256 steps are not enough, I have a feeling that you'll need some sort of speed measurement & feedback system to insure that your actual speed is locked-into your target speed.

Quote
The final signal needs to be at 50Hz.
Normally PWM is used to "replace" DC on a DC motor (or LED), and the frequency is not that important.
577  Using Arduino / Project Guidance / Re: Distance Measurement with Radio Frequencies on: May 18, 2013, 12:23:12 am
Radio waves travel at the speed of light.   The Arduino isn't fast enough to measure the time it takes for radio waves to travel a few meters.   Maybe you can use ultrasonic sound waves?   
578  Using Arduino / Project Guidance / Re: Sequential Turn Signals on: May 18, 2013, 12:16:58 am
I don't see anything wrong...   I haven't tried it out, so I can't say for sure.

Is the right side failing?   It might be your hardware...   I'm wondering it the LED connected to pin 13 on the board might be interfering with your circuit (if you are using a pull-up resistor or something).   Maybe you can switch the pins around and use pin 13 as an output pin?

This shouldn't mess-up your code, but you don't need the else statements.  They are optional with if, and they are not doing anything.
579  Using Arduino / Project Guidance / Re: Use voltage as input? on: May 16, 2013, 07:06:25 pm
Yes, you can probably wire the piezo circuit to the Arduino.   You need to know the piezo voltage, and if the clock plugs-into wall-power it's really important that the internal circuitry in the alarm clock is totally isolated from the AC line voltage.

Quote
Use voltage as input?
That's exactly how digital electronics works!   With the Arduino's 5V logic, 5V is read as 'HIGH" or "1", and zero volts is read as "LOW" or "0".    (It doesn't have to be exactly 5V and zero volts... You can check the chip specs if you want the details.)

Besides the signal connection, you'll need a common ground between the clock and the Arduino.  And, you can't put more than 5V into the Arduino without (potentially) damaging it.   So, if there is more than 5V on the piezo, you'll need a voltage divider (two resistors).

And/or since you may not know what you are connecting to it, you might want to add a resistor and a couple of protection diodes to block any negative voltages, or voltages greater than 5V from hitting the Arduino.

The signal to the piezo won't be constant DC.  It will be a pulse, but that's OK.  You just need to detect something that's not zero.   Hopefully, it's near zero volts when off.
580  Using Arduino / Project Guidance / Re: calling functions with input pins on: May 16, 2013, 04:45:26 pm
Quote
Isnt that what im doing with my if statement?
Nope! smiley-wink
Code:
if(motorControl == HIGH)
I assume the variable (or constant) named motorControl is a pin number.  Its not the high/low value returned when you read that pin.   If that variable (pin number) is not equal to zero, it will be will always be HIGH and your if condition will always be true.

You can think of the pin number (motorControl) as an address.  If you have the answer to our math homework, I can't write you house number as the answer... I have to go to your address to get the answer.

You can read the motorControl pin and assign the result to a boolean variable, and then check to see if that boolean varaible is HIGH.

Or, you can do this:
Code:
if(digitalRead(motorControl)) == HIGH)



Quote
Do i need to set the pins as output or input if i use digital read/write?
You read inputs and you write outputs...   Information comes-into inputs and goes-out of outputs.

(There is a weird exception where you write to an input pin to enable the internal pull-up.)
581  Using Arduino / Audio / Re: Arduino Due Simple Speaker on: May 16, 2013, 04:21:21 pm
2.2k is safe.  But with an 8 Ohm speaker, I'm not sure you'll hear anything.*    A piezo speaker (higher impedance) should be OK.

The Due web page says:
Quote
They operate at 3.3 volts. Each pin can provide (source) a current of 3 mA or 15 mA, depending on the pin, or receive (sink) a current of 6 mA or 9 mA, depending on the pin.
If we take the worst case (3mA limit) and apply Ohm's Law, we get 3.3V/0.003A = 1100 Ohms minimum.    (Resistance means resistance to current flow and if we increase resistance we decrease current.)   If you use a pin rated for 15mA (I don't know which one that is) and wire it correctly (to "source" the current) you can go down to 220 Ohms.

Resistances in series are added.  So with an 2.2k Ohm resister and an 8 Ohm speaker, you actually have 2208 Ohms.  But, the speaker is insignificant in this situation.


* The resistor and speaker in series form a voltage divider with the voltage divided proportionately.    With an 8 Ohm speaker an 2.2k, you have 8/(2208) x 3.3 = 12millivolts  (peak) across the speaker.
582  Using Arduino / General Electronics / Re: Voltage Divider Help on: May 16, 2013, 02:40:59 pm
Quote
I am assuming this has to do with Current...
You are on the right track... 

Current through a constant resistance is proportional to the voltage
(Ohm's Law).  When you hook-up your device, additional current flows-through the "top" resistor (your 150 Ohm resistor).

That means more voltage is dropped across the "top" resistor.  When the voltage is "divided", there is less voltage across the "bottom" resistor and your device.

With a voltage divider, whatever is connected to the output needs a high resistance/impedance relative to the resistors in the voltage divider.   That way, whatever is connected has very little effect on the voltage divider. 

In theory, you could use lower-value resistors to make your setup work (maybe 1.5 Ohms and 3.3 Ohms).   But then the voltage divider would draw more current and waste more power than your device, and you'd need big 'ol high-power resistors to dissipate the heat.   That's why it's not practical to use voltage dividers in power circuits!
583  Using Arduino / Project Guidance / Re: From Flute to MIDI on: May 16, 2013, 02:15:40 pm
You'll need a preamp (probably).   Microphones typically put-out millivolts (depending on mic sensitivity & sound level).  Preamps put-out line-level, which is around 1V.   The Arduino ADC has a 5V (DC*) and a 1V (DC*) range, so line-level is appropriate.

And since it doesn't appear to be a "standard" microphone, you'll need a preamp (of some kind) if you ever want to plug-into a mixer or PA system.

There are two aspects to your project, a preamp and the audio-to-MIDI conversion.  I'd recommend developing them separately.   You can built & test the preamp using a line-in (Aux or Tape) on your stereo system, your soundcard (if you have a desktop with line-in), or on your TV if it has audio inputs.   You can build & test the audio-to-MIDI conversion with a solo flute CD, or with a flute recording on your computer (using line-out or headphone-put into the Arduino).

smiley-sad The information on the barcus-berry website is not clear...   It says "electret", and it also says piezo.  Either way, it won't interface properly with a normal "pro" preamp (which will have a low-impedance balanced input with XLR connectors and optional 48V phantom power).

Piezo pickups can put-out fairly high voltage into a high impedance amp/preamp.   I believe you can plug a piezo pickup for an acoustic guitar into a regular guitar amplifier.   

The Arduino has very-high input impedance, so it won't drag-down the signal.  With a piezo pickup, you might get enough signal into the Arduino...  Maybe 100mV, maybe more...   Or, maybe you'll need a preamp.   A "direct box" (AKA DI box) for a guitar should work.   They make DI boxes with line-outputs, and the mank DI boxes with XLR mic-level  outputs for connection to a mic peamp or mixer.

Electret mics require a power supply.   Sometimes they work from a 1.5V battery.   The 5V power for "computer microphones" is supplied by the microphone input on a regular soundcard.   Since eletret condensers are either designed to be plugged-into a soundcard, or they are desinged to pbe plugged into a preamp/mixer have an internal battery, I don't think you can buy a preamp that provides power to an electret condenser, but you can find schematics on the Net.   (Regular 48V phantom power for a "studio condenser" might fry an electret.)


* The Arduino analog-to-digital converter accepts 0-5VDC.   So for audio (which is AC),  you need to bias the input (typically at 2.5V).  Feeding negative voltages (such as the negative half of an audio waveform) into the Arduino can damage it.  Plus, for what you are doing you need to "cleanly" read the whole AC waveform.
584  Using Arduino / Project Guidance / Re: Arduino and Cryptography on: May 15, 2013, 01:23:24 pm
I think the "hard part" is reading a file/data into the Arduino and back out.   (I'm not the one who can  help you with that.)

As the bytes "pass through" the Arduino, you should be able to run any encription/decryption algorithm of your choice in C/C++.   The Arduino has limited memory, so you won't be able to read-in the whole file before encrypting, but I assume most encryption algorithims don't require that.
585  Using Arduino / Project Guidance / Re: Bizarre Memory Corruption on: May 15, 2013, 01:04:30 pm
Any time you transmit data wirelessly or over long distances there is potential for errors.  Computer networks or the Internet wouldn't work without error detetection/correction...

If it's corruption caused by a bug and not data transmission error, look for a case where you write-past the end of an array.  (i.e. You write to element '10' in a 10 element array that goes from 0-9.)  This can sometimes happen in a loop, when you don't stop the loop in time.

Also make sure that you are writing a value that's too large for the variable type.  And, made sure you are not using signed variable types when the value is unsigned. 

Otherwise, use the serial monitor to check variable values and simplify the code to narrow-down where the problem is occuring.  Sometimes I'll send/display little messages like "Starting Transmit()" to tell me what the program is doing.
Pages: 1 ... 37 38 [39] 40 41 ... 90