Show Posts
Pages: 1 2 [3] 4 5 ... 90
31  Using Arduino / Project Guidance / Re: connect Arduino MEGA ADK to wall switch on: August 26, 2014, 12:22:00 pm
I turned ON a light from my android app , the light turns ON.
but the wall switch for that button remains OFF while the light is ON.
It's possible to wire a relay in parallel with the wall switch, and that creates an OR condition where either the switch or relay can turn the light on.   

It's also possible to wire a SPDT relay and a SPDT switch as a "3-Way" switch (like where you have one switch at the top of the stairs and another switch at the bottom of the stairs, and sometimes up is on and sometimes up is off).   The problem with that arrangement is that the software doesn't "know" if the light is on or off, so it doesn't know which way to switch the relay.    It' possible to detect if the power is on or off and feed that back to the microcontroller, but probably not practical to do it that way.   

But typically with home automation, the light switch is replaced by a special momentary switch/receiver so you have both manual control and automatic control, and the last command takes precedence.   Here are some switches that can be controlled by X-10 or other home automation protocols.   

I don't know if there are any wall switches that can be directly controlled by bluetooth, but you can probably find a controller that accepts bluetooth commands and translates them to one of the more common home automation protocols.  There are home automation controllers that work with Ethernet or Wi-Fi.    Again, the switches themselves don't use Ethernet/Wi-Fi directly.   The Ethernet/Wi-Fi signal goes to a home automation controller and the controller sends-out a signal to the switch. 

I've got an X-10 timer/controller that's programmed via a serial connection from the computer.  It can be directly controlled from the computer, but it normally runs as a stand-alone unit.   This particular unit doesn't have any software for remote/network control, so I can't control it from a phone.
32  Using Arduino / Audio / Re: Routing Audio Signal on: August 26, 2014, 10:37:38 am
Sometimes I use switch without muting the note. And ordinary switches are making a noticeable interruption on unmuted notes .
If I understand the problem, relays alone are not going to help with that...  A relay is just a switch.   If you switch from A-to-B, any sustain from A is going to get cut-off as soon as switch.   

And, there is a general rule that you shouldn't connect two outputs together, so it's going to be A or B.   If you want to mix two signals together, you need a mixer.  If you want to make a simple mixer yourself, you can build a mixer with a Summing Amplifier, which is just an op-amp and a few resistors.    (Audio mixers are built with a summing amplifier.)   

I thought about using relays but I wondered if I can use my Arduino directly because I remember that I saw some guys made guitar pedals using Arduino like distortion, delay...
I know that's been done, but I don't know the details.   That's not going to help with routing/switching your existing pedals.     I assume these Arduino based effect boxes use an audio shield (an add-on board that has a digital-to-analog converter).   You'd need a separate audio shield for each signal path, and just I don't think that takes you where you want to go.   And, the regular Arduino isn't quite capable of "CD quality" audio (I think the Arduino Due is powerful enough for good audio).    That's probably not an issue with a distortion box. smiley-wink

But I wonder if it allows me do a complicated switch map. For example one switch will be push-n-use but other two switches will be rotative and maybe the other one will open and close another chain separately. I can program Arduino to work this way.
You can get as complex as you want.   The only limitation is the number of inputs/outputs on the Arduino.      You can get single-throw relays which are simply on/off, or double-throw relays which are like an A/B switch.    Probably the most common type of relay is DPDT (double-pole, double-throw), which is two switch-circuits that work together.   These can be used as on/off or A/B, and you can leave the 2nd set of contacts unconnected if you don't need them.     To simulate a rotary switch, you can use multiple relays and switch them on in sequence.   

In contrast to DVDDoug's suggestion, I wouldn't recommend running a relay coil directly off an Arduino pin. An Uno's absolute maximum rating if 40 mA, and you don't want to operate near that if you can avoid it. Use a transistor switch if you're going to use a relay.
That's a good point.    Obviously it makes your circuit simpler if you can directly drive the relays, but there are always engineering trade-offs.    There is also a 200mA total current limitation for the Atmel chip and that may limit the number of relays (and LEDs etc.) you can have on at the same time. 

And, relays that meet the 5V/40mA spec are not that common.   12V relays are much more common, and with a transistor (or someghing like the ULN2803) you can use a 12V relay.

It's probably a good idea to connect an LED (with the normal current-limiting resistor) to each relay coil so you can see which relays are on.

A couple of things you may want to try to help in "development" of your project -

 - You can get some regular SPST (or DPDT) switches and connect them in your signal chain where the relays will eventually go.    You can then switch them manually to make sure you've got all of the signal paths working & switching.

 - Then, you may want to connect the switches to the relay coils to simulate what the Arduino is going to do, before programming the Arduino.

 - When you are developing your program (sketch) you may find it easier to just connect LEDs instead of relays. 
33  Using Arduino / Audio / Re: Routing Audio Signal on: August 25, 2014, 04:30:20 pm
It's not practical to send the signal through the  Arduino.   The guitar's signal is (obviously) analog.    The Arduino is (obviously) digital, and it has an analog-to-digital converter.  But, the ADC is only 10-bits, and the Arduino doesn't have a true digital-to-analog converter built-in, and it just doesn't make since to digitize the signal at that point.

What you CAN do, is use the Arduino to switch relays (or you could use solid state analog switches).    A relay is simply a switch that's controlled electrically.    Look for a relay that has a coil voltage of 5V and a coil current of less than 40mA.   (The Arduino powers the coil, which magnetically changes the state of the contacts.).   The contact ratings are not critical, since the a guitar signal is low voltage & low current and any relay can handle it.
34  Using Arduino / General Electronics / Re: general transistor amplifier questions on: August 25, 2014, 01:42:18 pm
I like with the op-amp idea.   A DC amplifier made from discrete transistors is going to be tricky for a beginner, and you may need multiple transistors.     I haven't built an amplifier from transistors since the 1970's, and personally I'd try to avoid it.

If you can't find an op-amp with high-enough power requirements, you may be able to find a schematic that uses an op-amp plus a pair of transistors.    (Putting the transistors inside the op-amp's feedback loop will simplify the design and give you better precision.)

If you need to get accurate amplification of low voltages (maybe below 1 volt or 1/2 volt) you'll generally need positive and negative power supplies.

That makes sense, but since I want to operate more or less at DC, can I just throw out these caps?
With a DC amplifier you can't have capacitors in the signal chain, but you'll probably have to make some other design changes (or use a different design).   Simply "throwing out" (bypassing) the capacitors will likely throw-off the transistor's biasing to the point where the amp won't work.
35  Using Arduino / Project Guidance / Re: what is the brighest LED you can use ? on: August 13, 2014, 03:08:03 pm
Look for "high brightness" or "ultra-bright", etc.   Take a look at this page in the Jameco catalog.  The light output is given as mcd.

"High Power" LEDs (1W or more) are different from "high brightness" LEDs.   High power LEDs are normally run from a special constant-current power supply and they cannot be powered directly from the Arduino.

36  Using Arduino / General Electronics / Re: Dumb Novice Questions re Enclosures on: August 12, 2014, 07:05:43 pm
Drilling holes precisely can be tough, even with a drill press.   If you have a drill press and you can clamp-down the workpiece that helps too, but it can be tricky to clamp-down a plastic (or metal) box.

Even if you center-punch the hole, the drill can "walk" while you are drilling.   A Brad Point Bit is another type of drill that can help.    Brad-point bits are designed for wood.    They are OK with plastic as long as the plastic doesn't crack, and they might be OK with thin aluminum, but probably not steel.
37  Using Arduino / Project Guidance / Re: need to drive a zero centered meter on: August 11, 2014, 07:04:48 pm
FYI - With an H-Bridge there is no ground to the meter either.    If the voltage to the + terminal is lower than the voltage to the - terminal, the meter will go in the negative direction.

If you were to ground the meter's - terminal, the only to get a negative reading on the meter would be to apply a negative voltage to the + terminal.     That would require a negative voltage-supply and an additional analog circuit to bias the Arduino's output voltage.
38  Using Arduino / Project Guidance / Re: Potentiometer Temperature Stability on: August 07, 2014, 05:30:34 pm
I am not going to have a method in the project to measure temperature.
You can add a temperature sensor for about $2 USD.   Take a look at this and this.

The LM35 puts-out a voltage proportional to Centigrade and the  LM34 puts-out a voltage proportional to Fahrenheit.    But, since the Arduino can do math you can use either one. smiley-wink 
39  Using Arduino / Audio / Re: Recommendations for Visualizer on: August 07, 2014, 04:45:05 pm
I had hope to do the band pass filtering all in software. Doesn't look like anyone has done that yet and not sure if it is possible.
When you want multiple frequency bands, that's normally done with FFT.   There is an FFT library for the Arduino so you don't have to write the code from scratch.    I'm sure there are some limitations since the Arduino isn't a particularly fast processor, but I don't know what those limitations are....    You can find Arduino spectrum analyzers that use FFT..

I looked at the white papers for a BA3834 . A webpage claimed it is able to do 7 band pass filters in and serial out which sounds usable but I only see a b and c and assume those are inputs?
I'm not familiar with that one, but it might be similar to the MSGEQ7, which you can buy from SparkFun.   I've never used it, but the MSGEQ7 is a slick little chip.   It has one time-multiplexed output, so you can get 7 channels/bands into one Arduino ADC input.   Plus of course, it has the frequency-filtering, and it converts the AC waveform to a DC output that's easily handled by the Arduino.
40  Using Arduino / Audio / Re: audio input controlled Midi interfaced for RGB-LED lights on: August 06, 2014, 07:29:41 pm
You can probably do that. 

LED lights that are daisy chained with XLR and controlled currently by a mix board with fader control and some other output controls...
I assume the lights are DMX controlled?  It would probably be better to go audio-to-DMX.  But, if your lighting controller doesn't have a DMX input or any other computer/digital input, I guess you're stuck with MIDI (if you want to continue using that lighting controller board).

The first thing to do would be build a MIDI controller to send MIDI messages to your lighting controller.  You should be able to find some example projects.   Get that working before you get involved with the audio sensing.   That's a fairly common project and you should be able to find examples.    You'll just have to modify the code/ commands to work with your lighting controller instead of a MIDI keyboard/instrument.

For the audio, you have a couple of choices.    For frequency-sensing, the simplest solution is the MSGEQ7 chip.  (They call the chip a "graphic equalizer display," but it's really a spectrum analyzer effect chip.)  It filters the audio into 7 bands, and then sends-out a multiplexed DC voltage for each band (so you only need to use one analog input on the Arduino).    You can't get more than 7-bands, and you can't choose the center-frequencies, but it makes for a very simple hardware design,  and you can combine the data or ignore some of the frequency-bands bands in software if you want less than 7 bands..

Another option is FFT, which isolates the frequency bands in software.    Of course, this gives you more flexibility, but the software is much more complicated.  (There is an FFT library so you don't have to write the code from scratch.)   With this option, you need to bias the input at 2.5V, since the Arduino input cannot handle the negative half of the audio waveform.  (That's just 2 resistors and a capacitor.)

A 3rd option would be analog filters built with op-amps (one for each frequency-band).   You probably don't want to do that!

I always mention a trick I use with the lighting effects I've built - I keep a 20-second moving average of the volume and I use that as a reference  (or some of my effects use the 20-second peak as a reference).   I also automatically switch between the 5V and 1.1V ADC reference depending on the loudness.    That way, the effects automatically adjust to quiet or loud songs, or changes in the volume control and the lighting controller doesn't need any kind of manual sensitivity control.

I've never done anything that's frequency-sensitive...   (Well, a million years ago when I was  kid I built a color organ from a kit, but I got bored with it.)    All of my effects are simply controlled by the volume, and I have several different sequencing-chasing, blinking-pattern effects that are randomly activated (I think there are 8 different "modes").   One of my effects is a "VU Meter".   All of my effects are randomly reversed (so the VU Meter goes down instead of up, or right-to-left depending on how the lights are arranged).  All of the effects are also randomly inverted (so louder turns-off the lights in the VU Meter instead of on, etc.).     

Another simple effect is that I throw-up a random on-off pattern (with some lights on and some off).  Then, the on/off state of each light is changed with the loudness/beat.     Or, the lights that are off will come-on (or flicker-on)  when the volume is louder than average, and turn-off when it's less than average.   The lights that are happen to on in the random pattern work in the opposite direction, flickering-off with loudness.

41  Using Arduino / General Electronics / Re: can we measure TTL output using a multimeter? on: August 06, 2014, 06:37:49 pm
You can make a crude pulse tester probe with a couple of LEDs and a couple of resistors.    Wire one LED/resistor between the probe-input and ground so that it comes-on when the probe is connected to 5V.   Wire the other LED/resistor between the probe-input and 5V so it comes-on when the probe is low/grounded.

With "normal data" switching between high and low, both LEDs should glow and/or flicker somewhat dimly.    And, you can read constant-high or constant-low.      The only problem is when you have short pulses or infrequent pulses, you may not see anything happening.

You can also buy (or build) a slightly more advanced logic probe that can detect short pulses.

But, it's hard to beat an oscilloscope! smiley-wink   (I don't own a 'scope, but I have a couple at work.)
42  Using Arduino / Project Guidance / Re: High and Low = 5V and ground? on: August 06, 2014, 06:23:12 pm
Because the Arduino can only put-out 40mA.   You risk damaging the Arduino if you attach a motor directly to an output pin.

The Arduino can power an LED, but it can't power a motor.   You need a MOSFET, transistor, or relay to "boost" the power.

If you were to measure the output-high voltage with the motor attached, you'd find it's low...  Probably less than 1V.   Please DO NOT try that because you will stress the Arduino.
43  Using Arduino / General Electronics / Re: Relay Question on: August 05, 2014, 05:08:49 pm
It is designed to be "triggered" by 5V so it will work with the Arduino.    And it's rated for 3 Amps, which is about 300 Watts.   For something like a 100W light bulb, it would be perfect.
44  Using Arduino / Project Guidance / Re: Third Year Project (first post). on: August 05, 2014, 04:41:43 pm
  I want to use it for my third year project containing 'animatronics'. I have a vague idea of what i want to do but my dads has been going on about relays and transistors and I'm slightly confused.
3rd year of what?   I take it you are NOT a 3rd-year university electronics student, or you probably wouldn't be confused by relays & transistors. smiley-wink

Have you done any programming or electronics before?

Like any project, take it one step at a time.

Like Shpaget said, try-out some of the examples.     Or If you have some programming experience, start by looking at the language reference.   At some point you should read-through programming language reference, but if you've never programmed before start with the examples or none of it will make any sense.

The two most important concepts in programming are loops - doing stuff over-and-over, and conditional branching - if-statments, etc., which is how comupters "make decisions".   

I'd start your project  with with the button Example...  You push a button (a switch that you need to wire-up) and the pin-13 LED on the Arduino board lights-up. 

 - Then, replace the button with your PIR (and/or "trip wires") and just make sure you can sense the movement and turn-on the LED.

 - Then, figure-out the drill-wiring.    The Arduino puts-out 5 Volts, so you can test the drill and relay/transistor/MOSFET (whatever you decide to use) with a 5V power supply (or the Arduino's 5V power-pin) before you try controlling it actively with the Arduino.

 - Now that your input and output circuitry are working, you can connect everything together and turn-on the drill when someone trips the sensor(s).

 - If you need some more advanced programming, you can do that now that the hardware is fully-functional.


45  Using Arduino / Project Guidance / Re: Programming FFT For Uno, Audio to Light System on: August 05, 2014, 03:58:15 pm
Hmmmm...  I thought the MSGEQ7 sample code was on the SparkFun site, but I'm not finding it now.   I didn't find it on the manufacturer's site either.  smiley-sad   You can find sample projects, but maybe somebody can point you to the "real master code".

If you don't want to dim the LEDs, you don't need PWM.

I'd save the smoothing/averaging for a future enhancement.    Of course you can smooth any or all of the inputs.     They are just numbers in an array.    I'm not using any frequency-filtering, so I have one array for the left channel and another for the right.   You might want an array for each frequency band, or maybe you can use one array to average everything.

What I do, is I save a "reading" once per second and store it in the smoothing array array.    So, my 20-second array only has 20 values, and once per second I re-calculate the average and re-find the peak value in the array.  Some of my effects use the peak as a reference.    The peak in the array isn't the true-peak (and the average isn't the true-average) since the Arduino is running in a fast-loop and I'm only grabbing/saving a value once per second.     But, it's close enough for what I'm doing.

The once-per-second timing is based on the Blink Without Delay Example, where I check the to see if one second is up every time through the loop.    (I actually have multiple "timers" running at the same time.)   
Pages: 1 2 [3] 4 5 ... 90