Show Posts
Pages: 1 ... 38 39 [40] 41 42 ... 90
586  Using Arduino / Project Guidance / Re: Line Noise Detection on: May 14, 2013, 07:24:50 pm
So I am wondering if and how I can detect the noise that is created on the power connection + or - and get a reading of some sort.
A series capacitor will "block DC" and "Pass AC" (and it will pass "changes").

Of course if someone opens the door and the dome light comes on, or if someone activates the remote door locks, etc., that's going to put a noise-pulse on the 12V...

So, a basic High-pass RC filter will "read" zero when the DC voltage is constant.    A rather low cutoff frequency of a few Hz is probably a good place to start  (an RC time constant of a fraction of a second).

You might want to use a pair of protection diodes to protect the Arduino from negative voltages and voltage spikes greater than 5V.   (The voltage output from the high-pass filter will temporarily go negative when the voltage drops.)   And, if you want to read "negative" voltage drops, you'' have to add a couple of resistors (a voltage divider) to bias the Arduino input.

If you need more sensitivity, switching to the 1.1V reference will vige you the ability to read signals/changes down around 1mV.

587  Using Arduino / General Electronics / Re: Calculating input voltage beforehand [Newbie question] on: May 14, 2013, 07:05:22 pm
I would be great to have a general rule to calculate the voltage to the input pin. No matter the resistance and the amount of paths the current can flow in.
There is!  smiley-wink    Ohm's Law describes the relationship between voltage, resistance, and current.    kirckhoff's Laws describe how voltages & currents are distributed in series & parallel circuits.   (i.e. How a voltage divider works.)

Those things aren't necessarly that easy to understand.. it's a good part of your 1st semester in a basic electronics class.

In most real-world applications, the high impedance (resistance) of the Arduino input, means that the Arduino itself essentially has no effect on the voltage...   It depends on the external circuit. 

The exception is if you try to put-in more than 5V, or a negative voltage.   In those cases, the Arduino's internal protection diodes start conducting, and you suddenly have very low impedance.  And, if too much current flows through those protection diodes they will fry, and you will kill your Arduino...

588  Using Arduino / General Electronics / Re: Sizing transformer for linear DC supply on: May 14, 2013, 06:41:05 pm
The biggest concern I have is with the power dissipation in the regulator.    I'm pretty sure you can overheat the thing (depending on the heatsink) at less than 3 Amps when there's more than a couple of volts dropped across the regulator.

It's been a long time since I've calcuated ripple.   The voltage regulator will knock-out the ripple, as long as the ripple doesn't exceed the point where the voltage regulator drops-out.   So, I usually just use a capacitor that's 1000uF or more, one that's available, and one that will fit physically.   (A higher voltage into the regulator will tend to minimize ripple problems, but more it's more power/heat in the regulator.)

I'm thinking 15W 12V secondary, but I could be way off. I'm figuring ~2V drop on the regulator, and 1.7 for  the bridge, giving 9.7V, and then just adding some headroom.
12VAC is plenty for a 6VDC supply.    I think you're forgetting that the peak AC voltage is about 1.4 times the RMS.   At 12VAC your capacitor will charge-up to about 17V minus the diode drops.   (I'll usually use a 12V transformer for a 12V power supply.)  And at no-load, the transformer will probably put-out more than 12VAC.    If you can find a 9V transformer, that should be enough.
589  Using Arduino / Project Guidance / Re: comparing an array of inputs on: May 14, 2013, 05:39:45 pm
I think you just have to save the values in two arrays do 8 compares (in a loop).  Or, you can read the 8 pins directly and compare to the 8 values in the array.

And if you are just looking for any-difference or no-difference, you can break-out of the loop as soon as you find a mismatch, since there's no point in checking the remainder of the array once a difference is found.

There might be an easier way if you use a C++ vector, instead of a C-style array...   But, it's been awhile since Ive done any "real C++".
590  Using Arduino / General Electronics / Re: charging caps on: May 14, 2013, 03:41:28 pm
You can't get "free" energy, but there is the possibility of "pulling" more power from the power supply and delivering it to the motor...   Are slotcars AC or DC?  (in this application, capacitors are DC.)

If you have a good well-regulated & filtered DC power supply, a capacitor won't help.   On a commercial/pro track, I assume this is the case.

If you have full-wave rectified, but unfiltered DC, a capacitor will charge-up to the peak of about 1.4 times the RMS value, and if the capacitor is large enough (enough uF) it will boost your power!*    However, if your controller does not have an isolated power supply, that capacitor will boost the power for all of the cars on the shared power supply.  A diode will prevent the capacitor from discharging into the main power supply (powering all of the cars), but you'll get an approximate 0.7V loss across the diode (but still more than the unfiltered DC).

If you have an AC power supply but the motor will run on AC or DC, a full-wave bridge rectifier and a capacitor will again give you a DC voltage that's about 1.4 times the AC voltage.    Minus two diode-drops (about 1.4V).

I would sort-of assume that a good "hot" slotcar motor is optimized, and any tricks with boosting voltage might burn it out or shorten its life.  Of course, you mght damage a regular-average motor too... by running it above it's rated voltage for too long.

Oh...  With a diode preventing discharge back into the controller/power supply, you won't get good breaking if the capacitor is too large and continues to provide power for too long after you try to slow-down.

* Since current increases when voltage increases (through a constant resistance), that means power increases with the square of the voltage, and with 1.4 times the voltage, you'll get about twice the power!
591  Using Arduino / Programming Questions / Re: jumpy analog values on: May 14, 2013, 02:51:37 pm
Try two readings each time you do an analogRead, and chuck the first one away.
Right... There is really only one analog-to-digital converter in the chip, and the analog inputs are multiplexed (switched).    I haven't studied the timing-diagrams, but it takes some time to process & "settle".
592  Using Arduino / Project Guidance / Re: RGB LED color control wont work on: May 14, 2013, 02:40:57 pm
Every time through the loop you re-initialize i = 1.

Try initializing i=1 during setup.   Then it should increment normally up to 6 and reset when you hit 7.
593  Using Arduino / General Electronics / Re: How to connect C14 and UK AC mains to relay? on: May 14, 2013, 02:26:49 pm
You can use female Quick Connects* which crimp onto the wire, or you can solder wires directly to the contacts.  If you solder I recommend insulating with heat-shrink tubing and if you use quick-connects, I resommend the insulated type. 

You can get quick-connects at from places that sell electrical ro electronic parts, hardware stores, home improvement stores, or auto parts stores.   There are a couple of popular sizes, so make sure you get the right one.

Also I'm assuming the ground wire skips the relay altogether and goes right across from the C14 ground pin to the 13A ground pin?  What about neutral?
The ground & neutral are connected directly.   The hot wire is switched through the relay.  If you have a double-pole mechanical relay, there's no harm in switching the neutral also, but the ground should be "permanently" connected.

In order for current flow, you need a complete circuit.   You can "break" the circuit and turn-off power with a switch in either the hot or neutral side.    But for safety reasons, the switch/relay normally cuts the hot connection.

* "Quick-connect" or "Quick disonnect" mioght be Americqan slang/jargon, and they might have a different proper name..

This is a Spade Terminal and this is a Ring Terminal.
594  Using Arduino / Project Guidance / Re: LED light Project on: May 14, 2013, 01:59:27 pm
Assuming you want them all to come on together, with a higher than 5V supply, you can use a series-parallel combination.   

For example, let's say you have a 12V power supply and your LEDs are rated at 3.5V.   If you put two in series, that's 7V across the LEDs and 5V across the resistors.   With 30 LEDs, you'd wire-up 15 sets of those.   (The more you wire in series, the more efficient your system with less power wasted in the resistors.)

With a resistor current limiter, it's generally best (best for current/brightness control, but not for efficiency) if you drop about half the voltage (or more) across the resistor.  So if you want to go with 3 in series (10 sets), I'd say use at least a 15V power supply.

1. How to power the LEDs? (the battery must not be too large because it needs to fit on a garden sculpture)
You might want to look-up some Amp-hour ratingsfor various batteries and do some Amp-hour calculations, based on the current required for the LEDs plus the Arduino and other circuitry.   

If you're not up-to-speed on Ohm's Law and Kirckhoff's Laws... Briefly, the same current flows through series components.  So, two LEDs in series share the same current, and use half the current of two LEDs in parallel (at the same brightness).

And, a constant-current switching LED power supply doesn't waste power heating-up current-limiting resistors.  That means your battery would last longer (at the cost of a more-expensive, or more complex, power supply).
595  Using Arduino / Audio / Re: Audio Filtering on: May 14, 2013, 12:56:55 pm
So if it is a truck, it will be a specific truck in one determined moment. If it is a trumpet, it will be the same trumpet playing the same music notes.

I had thought about make a first reading amplitude attempt (in dB) for three different frequencies, then save them, and after that listen sound compare with them for detect if is positive/false detection.
That might work.  You'll have to experiment, and I'm not sure if 3 frequencies is enough.   You'll also have to allow a range/window of dB levels in each frequency-band, because it's never going to be exactly the same twice. 

You might want to take an average of the 3 (or more) frequency bands to calibrate the overall level before analyzing the frequency content.

596  Using Arduino / Project Guidance / Re: vu-meter on: May 14, 2013, 12:00:06 pm
the SPL seems like it works and it write out values but  when it quiet it still put out high values. don't know why.
The output might be biased at 2.5V.  That's one way to deal with the fact that negative voltages can damage the Arduino, and that microphone circuit might be taking care of that for you.  (You need to protect the Arduino from the negative-half of an AC audio waveform).

Do you have a multimeter to measure the voltage out of the microphone circuit with silence?  Or, what do you get when you send the ADC reading to serial-out (with silence)?   Or, do you have a schematic for the microphone circuit?

If it's biased to half-voltage (about 512 out of the ADC), you can subtract 512 from the readings and then  either ignore negative results or take the absolute value.
597  Using Arduino / Audio / Re: Audio Filtering on: May 13, 2013, 06:20:45 pm
•I have characterized my target sounds in three frequencial components (Hz), with their amplitude (dB). And I only want to compare the sound measured with these components but I can't split them from audio samples I have taken.
I'm not sure I understand... If you have a truck and a trumpet at the same time, and you want to filter-out the truck, that's virtually impossible.*   Except, you can filter-out low frequencies such as "rumble" from the truck.

If the sounds are not occuring at the same time, you have a better chance of automatically separating them.    But of course, not all trucks generate the same frequencies at the same volume, and a trumpet can play many different notes and can be played/recorded at various volumes.  There is no simple "fingerprint" for either of these sound-sources.

* "You can't un-fry and egg, you can't un-bake a cake, and you can't un-mix a recording."

If you could do that, there would be no need for multitrack recording...  You could record the whole band with one microphone at once, un-mix, edit, and then re-mix.    That technology does not exist.
598  Using Arduino / General Electronics / Re: Two unrelated questions: capacitors in circuits on: May 13, 2013, 01:42:33 pm
if I look for ceramic capacitors there are ones that look sort of terracotta-coloured and called "ceramic disc" and there are others which are blue, and these are usually labelled as "ceramic". 
Electrically, it shouldn't matter in this application.  The blue "monolithic" capacitors might be better/stronger physically and/or have better/tighter tolerance.

1) Are the parts in the circuit for a 5V setup like with the arduino? It's not clear to me...the bit about a "mainframe"(!!!) has me puzzled too   I take it that my arduino is the "mainframe"!
Strange terminology...  Yeah, that could be an Arduino.
2) If I enable the arduino's internal pull-up resistor, does the 1.2k resistor in the circuit then become unnecessary?
Looking at the simplified schematic on the datasheet, you have an open-collector output.  Yes, the Arduino internal pull-up should work.  However, the higher impedance (the 20k pull-up) is more prone to noise pick-up.    So if the signal runs a long distance, lower resistance may help with noise (i.e. false signals).
3) Am I looking for ceramic disc capacitors again for the capacitors in this circuit?  Also, is the value of those capacitors OK to put in a 5V circuit?
They should be fine.  The voltage rating on a capacitor is it's maximum rating.  Any ceramic or any ceramic-monolithic capacitors, will have a voltage rating higher than 5V and will be fine.

599  Using Arduino / Project Guidance / Re: Arduino controlling 220v ceiling led lamp on: May 09, 2013, 07:31:14 pm
Not all AC LEDs are dimmable!   An AC LED lamp isn't just an LED.   There is a circuit (basically a constant-current power supply).   The power supply is usually designed to supply a constant current.  Not all are designed to supply a voltage/current that's proportional to the average AC input...  Some LED lamps are rated to run on anything between 85VAC and 280VAC.  Obviously, these can't be dimmed. 

With a ceiling fan/lamp the power supply might be built-into the fixture.   If the lamp is replaceable, check the part number & specs.   If it screws-in like a regular light bulb, you can probably replace it with a similar dimmable LED-bulb or with a regular 'ol light bulb.

And, LED some lamps might not run on DC...  I don't know if any household 120V/220V LEDs are designed for DC.  So with a dimmable LED, you should probably build a "normal" AC dimmer with a TRIAC, phase control, and all that (and with isolation on both your zero-crossing detector and your AC output).

Here's what I used:
AC->DC Convertor (KBL410)
Transistor - BUX8GP
Capacitor - 4.7 uF 400V
Arduino Uno
Resistor - 1k Ohm
You didn't isolate the 220VAC from your Arduino?    That can be OK, but it's usually a bad idea.  It can also be very dangerous if touch the Arduino, and it can be dangerous to your computer if you  connect the Arduino to your USB port and 220 at the same time!
600  Using Arduino / General Electronics / Re: 74LS193 acting wierd... on: May 09, 2013, 07:08:28 pm
I have the 193 preset to 9

So... You count down from 9, and that's OK?
But, when you keep counting down from zero (without re-initializing to 9) it "rolls over", you get F (1111), and it counts down from there?

...Sounds like normal 16-bit operation to me! smiley-wink

smiley-grin smiley-grin smiley-grin smiley-grin
Forum rule - when any one says something is acting weird it is always acting perfectly normally.
smiley-grin smiley-grin smiley-grin smiley-grin

Pages: 1 ... 38 39 [40] 41 42 ... 90