Show Posts
Pages: 1 ... 37 38 [39] 40 41 ... 88
571  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.

Quote
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.
572  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.

Quote
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).
573  Using Arduino / Audio / Re: Audio Filtering on: May 14, 2013, 12:56:55 pm
Quote
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.

574  Using Arduino / Project Guidance / Re: vu-meter on: May 14, 2013, 12:00:06 pm
Quote
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.
575  Using Arduino / Audio / Re: Audio Filtering on: May 13, 2013, 06:20:45 pm
Quote
•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.
576  Using Arduino / General Electronics / Re: Two unrelated questions: capacitors in circuits on: May 13, 2013, 01:42:33 pm
Quote
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.

Quote
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.
 
Quote
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).
Quote
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.

577  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).

Quote
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!
578  Using Arduino / General Electronics / Re: 74LS193 acting wierd... on: May 09, 2013, 07:08:28 pm
Quote
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
Quote
Forum rule - when any one says something is acting weird it is always acting perfectly normally.
smiley-grin smiley-grin smiley-grin smiley-grin

579  Using Arduino / General Electronics / Re: My Arduino Nano decided to stop working? on: May 09, 2013, 06:37:44 pm
I can't help you but I had the same problem with an Uno.   It's running a useless-unfinished program and I can't re-program it.  I don't know if the problem is the boot-loader, serial ports, or USB chip.

I bought an AVR ISP programmer (about the same price as replacing the Arduino) to re-porgram it, but that didn't work either.   I think that's a different problem because the error message seemed to say that programmer wasn't recognized by the Arduion IDE.   (I never tried the programmer with a known-good Arduino.)

So now I just the bricked Uno as a template if I need to drill mounting holes in a box/chassis, or if I want to look at the pinout locations, etc. smiley-grin 
580  Using Arduino / General Electronics / Re: Where do you buy your components? on: May 09, 2013, 04:47:32 pm
Jameco & Digi-Key.    I've been buying from Jameco for more than 30 years!!!!  Digi-Key many years too.

I haven't had any custom boards made (or made any myself) since I was in college.   Usually, I build the project permanently on a plug-in breadboard.  It can be very reliable.  I built a car-alarm on a breadboard about 20 years ago, and it's still working.   I've also use various perfboards, wire-wrap, terminal blocks, etc. to avoid the cos to a custom board

The last perfboard I built was an ugly mess (I didn't have space for the breadboard), so I'm probably going to use a real PCB next time i build that circuit.   There are also a couple of circuits I seem to build over-and-over, and I'm thinking it's time to get some boards made for those.
581  Using Arduino / Project Guidance / Re: Smallest AVR that can handle FFT? on: May 09, 2013, 04:13:35 pm
I've never used FFT.   I've done some lighting effects, but everything I've done works off the volume (no frequency filtering and no true beat detection).

Accurate beat detection isn't that easy...   Detecting the bass isn't exactly the same as detecting the beat.  But IMO, a lighting effect that accurately pulses to the beat 1-2-3-4-1-2-3-4 is kind-of boring anyway! smiley-wink

Some people have done beat detection, so you might want to search the forum.  I think it requires two filters - One low-pass to filter-out everything except the bass, and a bandpass-filter tuned to the beat frequency (around 1/4 of a second or about 4Hz).   That 2nd filter is not to filter the signal (there should be no signal at 4Hz), it's used to filter the detected loudness envelope.   (If it was me, I'd probaly do the bass-filter in hardware and the beat-filter in software.)  Then if you wan to get really good, use some "fuzzy logic" to tune that 2nd filter and know when to expect the next beat...  That's how humans do it...  We don't wait 'till we hear the the beat and then tap our foot...  We know when that next beat is coming and we make tiny adjustments as we listen to keep our foot-tapping in-time with the music.

Something that's super-easy to do with just the volume (once you have the hardware setup so that you can read the loudness on an analog pin) is to compare the input to the average, and turn on the light/LED whenever the signal is louder than average.   That's more of a "flicker effect" than a beat effect, but its something simple to start with.

The Smoothing Example example shows you how to get a moving-average.   If you use a moving average, you won't need a sensitivity control, and your effect will automatically adjust itself to loud songs, quiet songs, and volume changes.  (In my application, I also switch automatically between the 1V and 5V analog references, depending on the signal level.)

I use a 20-second moving-average, updating the average-array once a second.  (Of course, I use the "blink without delay" style timing, so it can uns and flash the lights in-between updating the average.)


For some of my effects, I find the peak value in the average-array, and use that as my trigger threshold.  (For example, a chase effect that changes direction only when it hits a new peak.)  For other effects, I use the halfway point between the peak and average.   If you want to use the peak to detect the beat, you might pick a threshold that's something like 90% of the peak value in your array.   You don't want one big peak to throw everything off...

For my very-crude beat detection, I just delay (or ignore peaks) for about 1/5th of a second, so that I don't get to many beats/flashes close-together.   That's nothing like accurate beat detection, but you do get the feeling the that the lights are being triggered with the beat, and it's easy to do!  ...Actually, there's one more "tweek" I'm using.  I increase the sensitivity while waiting for the next beat.     So... I'm unlikely to get a beat trigger exactly when 1/5th of a second is up, but after 1/2 second the sensitivity is going up and I'm very-likely to detect a beat.   
582  Using Arduino / Programming Questions / Re: Pulsing LED with varying speed keeps jumping brightness? on: May 09, 2013, 02:47:34 pm
I don't know if this is a problem, but you are passing a float ("out") to analogWrite().     You might try converting that to a byte or int first.   (And maybe check with the serial monitor to make sure you are getting the byte/integer conversion you are expecting.)
583  Using Arduino / General Electronics / Re: Door bell sensor? on: May 09, 2013, 12:56:54 pm
I'd try picking-up the electrical signal.   Most doorbells run off 12-18VAC.  Do you have a voltmeter?

There some issues, but these should be easy to deal with...   

 - Everyting is probably "floating", with no ground in the doorbell circuit.  You can simply connect the Arduion ground to one side of the dooorbell transformer's secondary.

 - You can't put AC into the Arduino, or voltages greater than 5V.   Besides the 12-18VAC, there is a high voltage inductive "kick" from the coil (assuming there's no diode across the coil).

A resistor and a pair of protection doides will take care of those issues.   For additional protection, you can add a voltage divider in front of that to knock the voltage down to 5V.    If you use a voltage divider, remember that the peal AC voltage is about 1.4 x the RMS value. 

Quote
However, I didn't have so far any "aha!" idea...  I was thinking in connecting the piezzo outputs to a 7805 so I could have 5V in the other end... but I don't even know if it would work...
No... Voltage regulators are for power supplies.

I think it's generally safe to connect a piezo directly to the Arduino.   They can put-out voltages higher than 5V, but they have very high internal impedance (low current capability) and the Arduino has small protection diodes built-in.
584  Using Arduino / Project Guidance / Re: Arduino Uno on AA batteries on: May 08, 2013, 05:54:07 pm
That should work fine...

I'd guess the connector might be wired backwards.    Typically the inside of the barrel-connector is positive (and that's what's needed for the Arduino), but there's no solid-rule and power supplies come both ways.

Do you have a multimeter?    ...Probably a good thing to have in your teaching-situation.    You can buy one online for around $20 USD. 

You can also make a little tester with an LED & resistor.  (The LED won't come-on if it's connected backwards, and you can compare the polarity of the battery with your regular power supply.)    I have a little tester I made with a probe (something like this), a couple of different-color LEDs (one for each direction) and an alligator clip.   But for a quick-and-dirty tester for your battery power-supply, you can just solder a resistor & LED in series.

Or you might simply have a bad solder connection, or the barrel-connector might be the wrong size.   (If it's the wrong size it would probably work when you wiggle it around.)
585  Using Arduino / Project Guidance / Re: Binary Down Counter on: May 08, 2013, 03:59:20 pm
Quote
How would I could a Binary Down Counter?
What does that mean?   Do you want to see ones & zeros on a display?   Do you want a string of 4 regular LEDs, with ones lit-up and zeros off?

The format only matters for input/output.   The compiler doesn't care and the & chip only uses binary internally.
Pages: 1 ... 37 38 [39] 40 41 ... 88