Loading...
  Show Posts
Pages: 1 ... 37 38 [39] 40 41 ... 52
571  Using Arduino / General Electronics / Re: Measuring AC signal from analog inputs on: March 28, 2012, 03:29:31 pm
Not directly.  If you put a negative voltage into the Arduino, you can damage it.

What's your application?  Do you need to read both halves of the AC signal?   

If you need to read/measure both halves, you can use an offset-circuit to bias the signal so that zero ("ground") is 2.5V.  This can be done with a couple of resistors, and is probably the simplest solution.

A full-wave rectifier will give you both halves,but you won't know if the true signal is positive or negative.   A half-wave rectifier will kill the negative half of the waveform.   If you need to accurately measure signals, or detect/measure signals below 0.7V you will need to build a precision rectifier corcuit with op-amps.
572  Using Arduino / Project Guidance / Re: Digital Guitar Effects on: March 27, 2012, 03:37:05 pm
I'm not sure if the Arduino is "powerful" enough for real-time audio processing.  The Arduino has a built-in ADC (analog-to-digital converter) but it's not fast enough for audio.    There is no DAC (digital-to-analog converter).    So for starters, you'd need to use external ADCs & DACs. 

573  Using Arduino / General Electronics / Re: Piezzo Buzzer Sounds on: March 27, 2012, 01:45:00 pm
First, you need a piezo speaker/transducer, not a 'buzzer" or anything with a built-in sound generator...  If you hook-up a piezo speaker to DC, you shouldn't get a tone.

The proper "chirp"  might have several characteristics...  It could be a swept or varying frequency, it could be more then one frequency at a time, and it could be amplitude modulated or amplitude "gated"

It might be best if you generate some tones on your computer first, to see what you can do with simple tones.  If you don't already have an audio editor,  Audacity is FREE.   It can very-easily generate tones, and from there you can experiment with quickly fading the volume up & down and you can mix two or more tones, etc.    It actually has a "chirp" generator effect built-in.   (I haven't tried it.)  The default chirp settings generate a tone that sweeps from 440Hz to 1320Hz over a duration of 30mS.

You should be able to drive the piezo directly off your soundcard, but your regular PC speakers (or headphones) are fine for experimentation.

Quote
Trying prototyping something quickly and with a 555-timer simple oscilator i get a continuous "BRRRrrrrrrr" sound (1khz or something) wich isnt cute or fun at all.
When you say  "BRRRrrrrrrr",  I get the impression of something less than 1kHz.  But with Audacity, you can easily generate tones of different frequencies to see what 1kHz sounds like.    (Most piezo transducers are going to have trouble with 1khz signals... They do better at higher frequencies.)

P.S.
Note that the 555 (and most digital circuits) generates square and rectangle waves, which are more "harsh" sounding than sine waves.   So, if you want to simulate the sound of a 555 with an audio editor, you'll need to generate square waves.

574  Using Arduino / Project Guidance / Re: piezoelectricity on: March 26, 2012, 07:05:07 pm
Quote
I had used that as the basis for piezo touch sensor too but it takes a transistor to bump the signal up to read HIGH (3.4V) on a digital pin. I keep from overloading the pin by supplying limited (5V through 22k ohms) current to the collector.

I think that's the question...  Do you need to get the energy from the piezo, or can you use an external power supply/battery and just trigger the LED from the piezo signal?

If so, how much energy can you get from the piezo?

If you connect a capacitor, without the LED or other load*, (several microfarads, at least) you can charge it up and calculate the energy.    With a larger capacitor, it may take several "hits" to charge-up a measureable voltage.  (If it needs more than one hit, you'll need to count the hits and, you'll need the rectifier to charge the capacitor with DC.)

Once you have that, the energy stored in the capacitor is proportional to the capacitance x voltage, so a 1000uF cap will take 10 times as long (10 times as many piezo hits) to charge up, as a 100uF cap, but the total energy stored will be 10x as much (at the same voltage).

You can look up the formula which will probably give you energy in Joules, and you'll have to convert that to watt-seconds or milliwatt-seconds to see if you are getting the power you need.


* I wouldn't even hook-up the meter.    Charge the cap without the meter connected, and then hook-up the meter and the cap will start discharging through the meter.  But you don't want to over-voltage the cap, so give it a few hits with the piezo and see how it's going before you go too far...

   


575  Using Arduino / Audio / Re: Arduino Based Silence Detector on: March 26, 2012, 05:37:31 pm
OK.   You should be getting around 1V peak.    If you change reference to 1.1V, you shoud be very near full scale if not over.    (Assuming everything's working properly.)
576  Using Arduino / Audio / Re: Arduino Based Silence Detector on: March 26, 2012, 05:28:30 pm
We still don't have any idea what signal levels you've got.  If you don't know, where's it coming from?   A microphone might give you 10mV.   A full-volume line-level signal (like the audio output from a VCR or DVD player) should be around 1V.  A volume-controlled line-level signal or a volume-controlled headphone output mifht be somewhere around 100mV   A speaker-level signal will usually be several volts.

Quote
But i Still get very low readings. Not the full 1024.
If your reference is 5V, changing to the internal 1.1V reference will give you counts about 5 times as high.   (FYI - The maximum is 1023... The ADC puts-out 1024 different values, from 0 to 1023.



Quote
Do i need the Poti and Second 100k Resistor to 5Volts to get better (higher) values from the input?
A resistor can add offset to give you bigger readings.  but, it won't give you a bigger signal...    If your signal is 0.1V and you add a 1V offset, silence* is now 1V and your signal is 1.1V.   The numbers are bigger, but it's no easier to detect signal or silence.  It looks like the offset circuit is there to allow you to read the positive & negative half of the audio signal, without going negative and damaging the Arduino.   

*There's always some noise.   You may or may not read noise depending the level and the sensitivity of your ADC.
577  Using Arduino / Project Guidance / Re: Capacitance over long wires on: March 26, 2012, 04:21:38 pm
Anything around 1 second is not cable capacitance.   Cablle capacitance is in picofarads...   The RC time constant is simply R x C, so that 1uF into 1Meg Ohm is one second, or 1000uF into 100 Ohms.

LDRs are known for being slow, but I don't think they are that slow and I think there is something else going on.

How fast are the pulses?
578  Using Arduino / Programming Questions / Re: TonePitchFollower with multiple speakers on: March 26, 2012, 04:11:22 pm
Take a look at conditional if statments, as well as and and or statements.

You are just sending out "o" over-and-over (which is good for looping), where the number of times you do that (the number of times you loop) depends on some condition.

While you're at it, take a look at while(), and do... while(), break and continue.   There are different ways to loop and different ways to change the number of times you loop, or the conditions under which you continue to loop.
579  Using Arduino / General Electronics / Re: Arduino controlling DC motor - how to make it as safe as possible? on: March 26, 2012, 03:44:01 pm
Quote
If we are already talking about transistors - how can I know what is the best (safe &efficient) base current for a transistor? In the datasheet I have only collector current in the "Absolute maxiumum ratings" table. There is nothing about the typical base current.
The current gain of a transistor is called the beta.  You should see a minimum beta listed on the spec sheet, and there might be a curve showing beta over a range of operating conditions.   Typical beta is about 100.

You want to saturate the transistor...  you don't want  to turn it partially-on, or you can overheat it.     That means if your motor needs 50mA* (max), the base of a transistor with a beta of 100 would need 1/2mA minimum.   It's best to pump a little extra current into the base to make sure it's saturated.   Once the transistor is fully-on (saturated), the current is limited by the load and increasing base current does not increase CE current.

if you don't have the beta for the transistor,  design for a beta between 20 & 50, and you should be OK.

* Double check that.   Again, if you don't allow for enough current, the transistor won't saturate and it may overheat.
580  Using Arduino / Project Guidance / Re: To relay, or not to relay? on: March 22, 2012, 04:48:18 pm
A relay is probably your best choice here.   There might be other things you can do, but a relay exactly replcates a swtch.   And if you ever get a different camera that uses the same kind of simple-switch trigger, the same setup would work with the new camera.

581  Using Arduino / Programming Questions / Re: evaluating doubles in an if statement on: March 22, 2012, 04:38:44 pm
Because of the binary representation of a floating-point, there are rounding errors and all 32-bits are rarely exactly-equal.  That is, == is tricky with floating point numbers.

Greater-than & less-than are better choices.   If you look for a number >69.5 and < 70.5, (or something like that) it should work.

This might work too:
 if(t == (double)0.70){

That will force 0.70 to be represented as a double, and since t and 0.070 share the same format, they should both share the same binary format.    But, I'd just try to avoid == with floating point.
582  Using Arduino / Programming Questions / Re: A case of RTFM - bitSet on: March 22, 2012, 01:22:13 pm
Same thing with arrays...

If you have a 10-element array and you read Array[10], you are reading something random/unknown beyond the array which holds elements 0 thru 9.  Worse, if you write beyond the end of the array screwy thingc can happen and you can even crash your program!

P.S.
If you always start counting at "zero', you might be a programmer!  smiley-grin  ...How many kids do you have?  "Four",  "0, 1, 2, 3"
583  Using Arduino / Audio / Re: How to do simple headphone detection? on: March 22, 2012, 12:45:46 pm
Yeah... I'm thinking something like a 10k pull-up too.    10k to 5V will have very-little effect on the audio, since headphones are typically less than 100 ohms.   You do need the audio signal to be capacitively coupled (an LM386 usually is).    And, you might need a capacitor to ground on the "other" end of the pull-up to form a low-pass filter and prevent the audio signal from "fooling" the headphone detection.

Quote
The plan is to either drive the jack directly from the Arduino, or use an LM386 amplifier.
Don't connect directly to the arduino.   The heaphone impedance is too low (typically 32 or 64 ohms) and it will draw excess current from the Arduino and potentially damage it.

Another advantage to a 386 (or something similar) is that it's easy to add a volume control pot.   It's a good idea to have a regular 'ol volume control so that you don't accidently get the volume too hig and blow your ears out! smiley-grin
584  Using Arduino / General Electronics / Re: power supply all most done i want to test it and see what it is good for any ideas ? on: March 22, 2012, 12:19:39 pm
Quote
printer power cord short curcit it was pushing a bout 1.6 amps  and is at 17volts free of load on the other end i made a cap of 13.01 out put down to 1.24
Sorry, i don't understand what you are saying...  I assume this is a variable-voltage power supply?

Quote
im kinda werry of wither to do a short curcit amp test i dont know if that will fry my caps  or my lm regulator but i want to know what im geting on the out side
Shorting won't hurt the caps, but you need to make sure the 2696 is rated or short-circuit operation, or the regulator could burn-out.    It might have short-circuit protection, and in that case the current will likely "fold back" (reduce the current) with a short.

If the chip is not supposed to be shorted, you can use a fuse or some other protection circuit/device.  or, you can just be careful.

If it is short-circuit protected, you don't need a fuse on the ouput (DC) side.   A fuse is often used on the AC side for safety...  To prevent a fire just in case something goes "horribly wrong".     

If you simply switch your multimeter to "AC", you can measure the noise & "ripple" under no-load, and under whatever load you happen to have.

A good test would be to get some power resistors and make a "dummy load".   You would calculate the resistor values (Ohm's Law and the power formula) to draw the maximum-rated load-current at the test voltage.   If it's variable supply, you might want to get/make dummy loads for the maximum voltage as well as common voltages like 12V and 5V, and for whatever minimum voltage your supply is "spec'd at".     You probably won't find the exact resistor values you need at the right power ratings, but you can wire resistors in series/parallel to get what you need.

once you have some dummy loads, you can check the load regulation (The output voltage should change much when you attach the load).   And, you can meausre the noise & ripple under load.

Quote
becuz the amp seting on my meter just applys a dead short to the + - and tells you what you have i built it but im not sure how i should be testing it to see if i did good . !
Yes.  That's how ammeters work.    You have to be a bit careful when measuring current without a load (or resistor) in series to limit the current.  You can blow the fuse in the meter, or you can blow whatever you are testing if the thing you are testing cannot survive a short.
585  Using Arduino / Project Guidance / Re: Vibrating Motors - HELP on: March 21, 2012, 06:37:34 pm
The real key is to use some basic boolean logic.

Computers "make decisions" and you can make your program "conditionally branch" with "If" statments, and "and" (&&00)  and "or" (||)  statements.  (And, a few others.)

Start-out with this single-button example.   

Then add some swtches .   Then, you can experiment with "and", which will require 2 (or more) switches to be pressed to light the LED.   A simple "or" operation could light the LED if button-1 or button-2 is pushed.   

Of course, you can combine "and" and "or", so that the LED comes on if you push button-1, or if you press button-2 and  button-3,  etc.

You might need to make yourself some sort of flow-chart to figure-out how your final logic is going to work.

Try to write your sketch in little bits so that you can test & debug one part of your logic at a time.  It sounds like this might get complicated, and if you try to do it all in one step, you'll never get it working. smiley-wink

It would also be easier if you start with LEDs (in place of your motors) and get everything else working before you add your vibration motors and the solid state relays.
Pages: 1 ... 37 38 [39] 40 41 ... 52