Show Posts
Pages: 1 ... 32 33 [34] 35 36 ... 90
496  Using Arduino / Project Guidance / Re: automate the mechanical for midi files on: July 08, 2013, 02:16:13 pm
I've never done anything like that, but it should be possible.   

Have you estimated the cost of 88 solenoids & the 88 associated driver circuits?   I'm pretty sure this is going to get expensive and you are going to end-up with something that has a resale value that's less than the cost.   (That's OK if don't intend to sell it, an the cost should be less than a modern MIDI/player piano.) 

Are you sure it needs to be wireless?    The solenoids will need a power source, so you'll either need a large battery, or you'll have to plug it into the wall.

Have you ever built a solenoid before?  Have you built one that can actuate a piano key?   It's not easy to build an efficient-powerful solenoid...

I'd say just build it one step at a time...   Build one solenoid actuator and trigger it with one Arduino output.   Build & test the MIDI interface/decoder.   Build & test the wireless interface.   Build the remaining actuators and put it all together...
497  Using Arduino / General Electronics / Re: ON-OFF-ON Switch on: July 03, 2013, 05:35:37 pm
If you use a DPDT center-off switch, you can eliminate the diode and it's associated voltage drop.

I don't have a schematic handy, but if you figured-out the diode circuit you can probably figure-out the DPDT switch...   Basically, you have two switches that work together... One switch turns-on power to the AVR + uSD in either non-center position.   The other switch turns-on power to the LED string only in one direction.

  One switch has VN1 (AVR + uSD) connected to both "on" terminals positions.  The other switch has VN2 (LED string) connected to only one "on" position (no connection to the other "on" terminal).   Both common terminals go to power.
498  Using Arduino / Programming Questions / Re: Arduino PINs not behaving equaly on: July 03, 2013, 02:25:19 pm
Pins 1 & 2 (right before digital pin 3) are (optionally) used for serial/USB communication. 

From the Arduino Uno Product page:
Quote
+ Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
499  Using Arduino / Project Guidance / Re: connect arduino with several light bulbs on: July 03, 2013, 01:48:15 pm
If you've never done anything like this before, I recommend that you build and test a circuit to control one lamp first.    And, write your program (Arduion sketch) to turn the lamp on & off before programming the dimmer.  Please be careful when working with line-voltage!

I've built a non-dimming lighting control recently with the Arduino and many years ago I built a dimmer with a different microcontroller.   I don't have a complete schematic or sketch fo you, but I'll give some basic theory...

The main components for an AC dimmer are a TRIAC and a special optoisolator designed to drive a TRIAC.  (For 10 lamps, you'll need 10 of these.)

The TRIAC needs to rated for your voltage and current requirements (higher voltage & current ratings will give you a safety margin).  Depending on how much current you are drawing, the TRIAC may need a heatsink.

For dimmer applications, the optoisolator needs to be the non-zero crossing type.  The optoisolator isolates your 5V Arduino (and the computer and you!!!) from the AC power.  (You will need one more isolator).  The optoisolator data sheet usually has a schematic showing how to wire-up the TRIAC.   (You'll also need a few resistors, etc.)

You can optionally use a non-zero-crossing (or "random phase") solid state relay, which has the optoisolator-TRIAC circuit inside.  That will make your circuit a lot easier to build, but it will be more expensive.

Quote
i m not sure, maybe incandescent light bulbs. Not leds.
Incandescent (or halogen or other filament bulbs) are the easiest AC powered lamps to dim.  Florescent bulbs are tricky, and some AC-powered LEDs cannot be dimmed.  If you are not sure, you can test your lamps with a regular light dimmer which you may already have in your house, or you can get one from a hardware store.

Here's how an AC dimmer works:
As you may know, the AC waveform is a sine wave.   It goes smoothly from zero to the positive maximum (the maximum is about 1.4 times the RMS), back-down through zero to the negative peak and back to zero.    There are 50 or 60 cycles per second, depending on where you live.



When you “trigger” a TRIAC, it stays on until the AC power crosses-through zero.   You have to trigger (with a short pulse) twice per cycle (once for the positive half-cycle and once for the negative half-cycle)   

If you fire the TRIAC just-after every zero-crossing, the TRIAC stays-on for the full half-cycle and you get full-brightness.   If you fire the TRIAC just-before every zero-crossing, the lamp is switched-on for a very-short part of the half-cycle, and it will be dim.    You adjust the brightness by adjusting the timing of the trigger pulse, synchronized to the AC power cycle.  It takes around 1/10th of a second for a lamp filament to heat-up, so at 50 or 60 Hz (actually 100 or 120 half-cycles) per second, it glows dimly instead of flickering.    Also, your eyes cannot detect flicker at 100 or 120Hz.  (If you get the synchronization wrong, you can get flickering.)

So, you need to detect the zero-crossing (or near the zero-crossing).   That’s where the 2nd isolator comes-in.     I usually build my own power supply, so use the un-rectified low-voltage from the transformer secondary (which is isolated from the AC power) and sense the zero-crossing from that.    You can run the low-voltage through a diode (to block the negative voltage which can damage the Arduino) into an Arduino analog input.   If you detect the positive-going zero-crossing you'll know when the next negative zero-crossing is coming (from the 50/60Hz frequency), so you only have to detect one zero-crossing per AC cycle.     


500  Using Arduino / General Electronics / Re: Power Supply Quirks on: July 02, 2013, 06:39:18 pm
That doesn't seem 100% safe to me...  I've never felt a tingle from a (properly working) low-voltage power supply.

A long time ago, my mom said she felt a tingle from the waffle iron.  I was wearing sneakers and I couldn't feel anything.    So, with one hand on the waffle iron I reached-over and briefly touched the water faucet.   See...  I was "smart enough" to know how to get a complete circuit...   WHAMO! 120V across my chest!   I recommeded that she get a new waffle iron, she did, and I'll NEVER try THAT again!!!! smiley-grin
501  Using Arduino / Project Guidance / Re: Best way to boost a 5V power supply. on: July 02, 2013, 06:07:36 pm
If 5V doesn't work, it's generally easier (and cheaper) to regulate down than to boost-up.   You'll need a switching regulator for 5 Amps.  The good news is that switching regulators are nearly 100% efficient, which means 6V @ 5A out only requires (approximately) 9V @  3.33A in.   If you boost-up from 5V, you'll need about 6 Amps in.

502  Using Arduino / Project Guidance / Re: Project using peltiers to cool water on: July 02, 2013, 12:59:12 pm
Any of the Arduino boards should be able to do it.   Your temperature sensors need analog inputs (one input per device). 

Any other "mode" switches (such as heat/cool or temperature up/down) will need a digital input.  If there is any kind of LED/LCD display, you'll need a digital input pin (more for a "more advanced" temperature display).

Your Peltiers can all work from one digital output if they all turn on-off together.  If you need to control 4 separately, you'll need 4 digital outputs.

If you need to control the fans independently from the Peltiers, you'll need one or more outputs for that.

In order for heating (3-states = hear, cool, off), you'll need one more digital output.  And, you'll need an "H driver" (4 MOSFETs plus a couple other things) to reverse the current.  (Or, you could use relays.)

Here is some information about MOSFETS.   You can't run a Peltier device directly from an Arduino output, because it takes too much power (more voltage and current than the Arduino can directly supply) .  The MOSFET is essentially being used as a switch that's turned on & off from a small electrical signal.   The power for the Peltier does not come from the Arduino.  You could use a relay in this application, since you are turning on & off the Peltiers at a slow rate.  If you choose to use a relay, make sure it can be run from 5V at less than 40mA because most relays won't work directly from the Arduino output, meaning that you need a transistor or MOSFET to power the relay coil.    (Most MOSFETs require more that 5V too, so make sure you get a "logic" MOSFET.) 
503  Using Arduino / General Electronics / Re: the right capacitor? on: July 01, 2013, 06:44:51 pm
You'd need something to disconnect the capacitor from the battery when you transmit.  Capacitors also have a discharge curve opposite from what you get from a battery...  The voltage drops quickly at first and then levels-off as approaches zero.  Capacitors can be used as batteries if you have very-low current and/or lots of "extra" voltage and an efficient voltage regulator.

With a MOSFET (or transistor, or relay) and some timing in your sketch (look at the LED blinking examples) you can turn-off the transmitter after a pre-determined amount of time.
504  Using Arduino / General Electronics / Re: Monitor 12v / 24V, with spikes upto 50V? on: July 01, 2013, 06:33:27 pm
Whan you say "monitor" do you just want to check if it's on/off or do you need to measure the voltage?  Do you need isolation?

Quote
4n25 opto isolator but then realized that it only has a "variable" voltage of upto 70V on the output side, not in the input side.
On the input side, there's an LED.

LEDs are "constant voltage" devices.   That means (like with a standard LED) you use a series resistor to limit the current, and as long as the current stays within spec, the voltage across the voltage remains approximately constant with the remainder of the voltage dropped across the series resistor.  You cannot "over voltage" an optioisolator's input unless you exceed the current rating or you exceed the isolation/breakdown voltage.

A quick look at the spec sheet says the 4N25 should work between 10 and 60mA at about 1.5V.    With 12VDC that's 10.5V across the series resistor.   Choosing 15mA and using Ohm's Law, we get 10.5V/0.015A = 700 Ohms.      Boosting the voltage to 24V gives 1500 Ohms.   (Or, using the same 700 Ohm resistor, we'd get around 30 mA, and the device would still work.)

60mA at 50V (48.5V across the resistor) gives us 808 Ohms as a minimum safe value.

If you use a 1K resistor, the optoisolator should get more than the required 10mA at 12V and less than the emaximum 60mA at 50V.
505  Using Arduino / Programming Questions / Re: Extrapolationg code for multiple analogue inputs isnt working on: July 01, 2013, 04:41:50 pm
I agree with Larry...  Try re-simplifying your code.   Try to isolate the input from the output...  That is, try turning on & off the led strips under software control first (ignoring the analog inputs).

Also, use the serial monitor (example) to read & display the analog input values.

I see a couple of potential problems -

Do you have the hardware to drive LED strips?  These are going to require more current than a single LED, and probably more than the 40mA the Arduino can supply directly.

Your delays mean that you may not be reading the input at the time the speaker is "struck", or you might be reading the wrong input when the speaker is "struck".   The processor can't do anything during delay(), so you've got to be careful about using it or avoid it altogether.   Each regular program step/statement takes microseconds, so your program is spending more time in delay() than anything else!!!!

You may need a short delay (misroseconds instead of milliseconds) between analog reads (to get valid readings).

You may also need a delay to hold the LED on long enough to see the blink/flash.   For that, follow the blink witout delay example.  Note that you can use different time-variables for each output if needed.

506  Using Arduino / Project Guidance / Re: Professionally Printing my project? SMD? on: July 01, 2013, 03:57:42 pm
Quote
...and finding someplace that can do it on the cheap (10-100 boards).
I wouldn't buy 100 boards 'till the design & layout are proven-out.

I work for an small electronics company that's been in business for 35 years.   A few months ago my boss said, "I don't think wev'e ever made a board that was perfect the 1st time."

Our company doesn't breadboard the design and a "Rev 0" PCB is made for the prototype.  Sometimes we can add cuts & jumpers, etc. to get the boards working and sometimes we send-out a Rev 0 board for beta testing, but it's rare that we sell a Rev 0 board. 

Typically we'll order 5 or 10 boards, depending on what we can get as a minimum order, and typically we'll have 5 boards assembled.

If you have a working breadboard/prototype you are one step ahead, but there are still things that can go wrong. On our newest prototype board, there were some resistor sizes that were wrong (I think the solution will be to use resistors that fit, instead of a board re-layout) and we are just starting electronic test & programming, so there may be more issues & changes before we go into production.
507  Using Arduino / General Electronics / Re: Suggestion for a standard triac and triac driver ? on: June 27, 2013, 04:32:16 pm
I just built some "solid state relay" circuits using the zero-crossing MOC3043 optoisolator.
The MOC302x is a similar non-zero crossing optoisolator designed specifically to drive a TRIAC.    (The application schematic is shown on the datasheet.) 

I used this 20A* TRIAC, which has an electrically isolated mounting tab. 




* I mounted the TRIAC to an electrical box, and I'm not sure if that's enough heatsinking for 20A.  (I'm only expecting to run 2-4 Amps through it.)
508  Using Arduino / General Electronics / Re: positive and negative input into arduino uno on: June 26, 2013, 08:37:59 pm
There really isn't a "positive" or "negative" lead.   Line level for home audio* has two wires - signal and ground.  As you say, the signal is AC and it swings positive and negative.

The Arduino can be damaged with negative voltages, or voltages above 5V.   

A comparator will work as long as you use a 5V supply.    And, as long as you only have one LED (or if all the LEDs on/off at the same time.)  Actually, with a comparator you don't need an Arduino!!!! Just connect an LED to the comparator and you're done!   Since you are detetcting only the part of the positive waveform, you won't get full brightness, but it might be bright enough, and there are other solutions such as a 555 one-shot, that are cheaper than an Arduino and don't require any software.

The most common way to handle audio is to use a voltage divider (typically two 10k resistors between 5V and ground) to create a 2.5V bias on an analog input.  That takes care of the negative-voltage problem plus you can read/measure the negative half of the waveform.  Then put a capacitor in series (0.1uF or more) to block the bias from the audio signal.    With the Arduino's 10-bit analog-to-digital converter and the default 5V internal reference, you have 5mV resolution.    A line-level signal should give you plenty of signal.   You can set an LED trigger threshold in software.

For my lighting effects, I use a peak detector circuit into an analog input.  (Again, this ignores the negative half of the waveform.)

I don't know if this applies to you, but since I'm creating effects, and I'm not trying to "measure" anything, I take a "reading" every second and save it in a 20-second circular buffer.   From that buffer, I can find the moving average, or the recent peak and use that as my threshold.   That way, my lighting effect will automatically adjust and respond nicely with loud or quiet songs or at any volume level.   (You can make a very simple "flicker" effect but turning the lamp/LED on whenever teh signal is above aveage and off when it's below average.)  A very In the past, I've done something similar in analog with just peak detectors, filters, and comparators.  To get a wider range, I also select automatically between the internal 1.1V reference and the 5V reference.   (You can't use the 1.1V reference if you use the 2.5V bias method.)



* Pro audio uses a 3-wire balanced connection with two "push-pull" signal lines, plus ground. 
509  Using Arduino / Project Guidance / Re: Odd behavior on battery power. on: June 26, 2013, 06:56:34 pm
Do you have a multimeter (to measure the "5 Volts" out of the regulator)?   A 9V battery doesn't put-out much current, and with enough load the voltage will drop significantly.

Most Arduino users don't get enough life from a 9V battery, and you've added a radio, and if your LCD has a backlight, that's using power too.

If you are experimenting with electronics, I'd strongly advise getting a meter.  Here in the U.S. you can find multimeters online for less than $20 USD.  A multimeter would also allow you to measure current, and from that (and the battery specs) you could calculate/estimate battery life.

Or, you can simply try 5 or 6 AA batteries in series.
510  Using Arduino / General Electronics / Re: SSR Relay Options? on: June 26, 2013, 01:05:32 pm
For a low-power project, I used some SSRs that look like this.

Quote
Maybe someone could direct to me some info on building my own opto-isolated relay?
It requires an optoisolator designed to drive a TRIAC, a TRIAC, and 3 resistors (the datasheet doesn't show the current-limiting resistor for the LED).

I just installed 4 of these "homemade solid state relays" in a 4-gang outlet box.

I chose a TO-220 TRIAC with an insulated mounting tab and mounted it to the metal outlet box.  I think the TRIAC is rated at 15 Amps or more, but I don't have any idea if the outlet box provides enough heatsinking to get the full amperage without blowing the TRIAC.    In my application I expect to have 4 equal loads, and since I can only get about 15 Amps out of the "wall", each circuit will only need to handle 1/4th of that maximum.

I chose zero-crossing optoisolators because this is not a dimmer and it should result in "cleaner" switching.  I mounted the optiosolators & resistors on a perfboard, and I put the entire perfboard in heatshrink tubing.

It's pretty "crowded" with the optoisolators, TRIACS, outlets, and all those wires in the box.  But, it does fit and it looks just-fine all closed-up.
Pages: 1 ... 32 33 [34] 35 36 ... 90