Loading...
  Show Posts
Pages: 1 ... 38 39 [40] 41 42 ... 52
586  Using Arduino / General Electronics / Re: Power noise issues with 7805 regulator showing up in analog value on: March 20, 2012, 01:02:30 pm
There is a simple "trick" you can use to reduce the power supply noise on low-power (preamp) audio circuits.   

Put a diode & resistor (~100 ohms) in-series in-between the regulated supply and the op-amp.    Then, a filter capacitor (~100uF) in parallel across the op-amp power supply inputs to ground.    (You will loose about 1/2 to 1V across the diode and resistor...  This is not an issue with +/-15V supplies, but it could be a problem with a 5V supply...)

The diode very-effectively blocks any negative-going noise (as long as the capacitor holds-up the voltage), and the resistor & capacitor form a low-pass filter to reduce any positive-going noise.

The resistor limits current into the op-amp, so you can't use this trick with a headphone or speaker amplifier, but the diodes can still be used.
 
587  Using Arduino / Project Guidance / Re: Have -2.5V to 2.5V analog input, how to shift? on: March 20, 2012, 12:37:37 pm
A summing amplifier would probably be more precise than the resistor method.  But, if you are "smart", you should be able to "calibrate-out" any errors or small offsets in software...

A 2-input summing amplifier is an op-amp and 3 resistors.   But a single-stage summing amplifier inverts the signal, so you need a 2nd op-amp (or a dual op-amp) and 2 more resistors for another inverter-stage.  And the op-amp, will need plus and minus power supplies to handle the inverted & shifted/biased voltage, and to make sure that you can go all the way down to zero-volts.   

It would be a good idea to adjust your resistor network (or the gain of the amplifier) to allow for a slightly larger voltage range than you need (maybe +/- 3V or so).     I don't know about the Arduino ADC, but typically, if you try to use the full-range of an ADC, you can get anomilies near the limits (0V & 5V).    For example, if you have a -10mV input-offset error, you won't read zero 'till you input +10mV.   Or, if your 5V supply is actually 4.9V, you might not read accurately above 4.9V.

Quote
Also, what is the best way to protect the Arduino, in case I end up with an input outside of that -5V range? I'd like to bring my input as close to 0-5V as possible,
A regular diode wired "backwards" to +5V, so that any input voltage above 5V* will "turn-on" the diode, "shorting" the "extra" voltage to the 5V supply.   Another diode wired "backwards" the other way to ground will "short" any negative voltage to ground.  (You need some resistance in series, so that these "shorts" don't draw excess current from whatever's connected to the input.)

*It actually takes 0.5 to 0.7V to turn-on a silicon diode, so with the diodes you can get from -0.7V to +5.7V into the Arduino.   But, that's safe.
588  Using Arduino / Project Guidance / Re: Making Uno R3 slower? on: March 19, 2012, 05:28:58 pm
I don't think so.

You could change the crystal, but the complier would be expecting 16MHz and that would mess-up any timing in your firmware.  (i.e.  delay(1000)  would delay for 2 seconds.)    I don't if there's a compiler option for an 8MHz device (that would solve the timing issue), but there would probably be something else device-specific that would get messed-up if you use the wrong compiler-option.

Quote
For the actual hardware (a remote controller)
Processor speed shouldn't be an issue in that application.   
589  Using Arduino / Project Guidance / Re: Arduino project for my car on: March 19, 2012, 05:21:03 pm
Quote
My only question is if the car battery can take such a device running 24/7.
Probably.  There's always stuff running in a car.  Usually there's a clock, maybe a security system, maybe remote door lockss that have to be running and "listening" for an unlock code.

I built a microcontroller based car alarm fro my van many years ago.   Sometimes, the van sits for a few months.  I don't know how much current it's taking, but it runs 24/7 and an LED blinks when it's armed.    After a couple of months, it's OK.  Sometimes after several months, it won't start without re-charging the battery.  But, I assume that would be the case with alarm or not...
590  Using Arduino / Project Guidance / Re: About grounding on: March 19, 2012, 04:03:42 pm
i think those "grounds" on the breadboard are not connected together...   I think each group of 10 (or maybe 5) is isolated from the others.      You can check that with an ohmmeter (multimeter) or just add jumpers to make-sure all of the grounds are connected.
591  Using Arduino / Audio / Re: How do you make music? on: March 19, 2012, 03:15:49 pm
It would be a lot easier if you build your instrument first, even if it just generates a "simple" tones.   Or, build a MIDI device first with "simple switches", and then add your infrared sensors/interface.

About 99% of the time a MIDI instrument is a keyboard.  It's going to have a synthesizer built-into the instrument so you can play it without using the MIDI interface, and you'll be able to upload (to the instrument) various instrument-sounds.

You can also send MIDI commands from the computer to the instrument so that the computer is playing the instrument.   And, you may be able to load a MIDI file/sequence into the instrument to automatically play the instrument with no computer attached. 

You can send MIDI commands from the instrument to the computer while you are playing to "capture" the performance/commands for playback/editing later.   When you play-back the MIDI file, you can play it back with a different instrument-sound.

You can play MIDI files on your computer, and with the appropriate software you can edit the files. 
592  Using Arduino / Project Guidance / Re: Arduino + WattNode Modbus on: March 19, 2012, 02:00:43 pm
The 485 sheeld, or a 485 interface chip should take care of the hardware side.

I don't know about the software & protocol side, but if there's a Modbus library, that should do it.

There will be settings for baud rate (and maybe some other stuff), and you'll have to make sure the Arduino and the device are both using the same settings.  I assume that's all covered in the WattNode user manual.
593  Community / Bar Sport / Re: Anti–Chugger Device on: March 19, 2012, 12:02:29 pm
[Chugger] “Hello, is there any chance that I could stop and talk to you for a couple of minutes?”

[Me] “No thanks."

594  Using Arduino / Project Guidance / Re: visuals for a small bar on: March 15, 2012, 07:39:51 pm
Quote
one idea i had was putting some paper birds on a string and having a motor move the string.
That reminds me of something they were doing in the "psychedelic 60's"...   They would take a speaker and stretch a rubber membrane over it.  Then they would glue little front-surface mirrors to the membrane, and dangle mirrors from threads so that they would just-touch the membrane.   Then, shine colored lights on it and "project" against a screen or wall.  I never saw this in real life...  I just saw pictures...

Even if you don't plan on buying anything, you should probably take a look at what's available commercially, to get some ideas.  Chauvet Lighting is a good place to start.   Just be aware that most of the pictures and videos have fog or haze, and without it you won't see the light-beam...  You'll just see the colors hitting the people and the walls.

I've built a couple of lighting effects, and I'm working on a new one... Maybe they will spark some ideas for you.

1.  My "main effect" is 4 colored spotlights (actually 4 pair).  It's triggered by the beat of the music, and every time it detects a beat it pops-up a random pattern and holds 'till the next beat.  It's simple, but the randomness keeps it from becomming too boring.  The beat detection isn't perfect, but I suppose that adds to the randomness.  This was built without a microcontroller.

2. A 4-channel chase-light controller.  My original idea was to hook-up 8 christmas-light strings in a big "star" over the dance floor, so the whole ceiling would "rotate".  I still think that's a cool idea, but it wasn't very portable... It takes "forever" to hook-up the lights, and if you have to find a burned-out bulb...  So now, it's running a "rope light".  A bit more "traditional", but a lot easier to set-up.   I'm thinking of something new...    I'm thinking about 12 ~30W floods in a row on a 10 - 12 foot piece of ABS pipe...

Now the "cool stuff" about the chase-light controller...  The speed is controlled by the loudness, and the direction is triggered by the beat.  But, there's a delay so it doesn't change direction on every beat.   This one doesn't use a microcontroller either, but it automatically adjusts to the average music level, so there are no knobs to mess with.

Of course it does the traditonal chase pattern, which looks like this -
000100010001
100010001000
010001000100
001000100010
000100010001...

You generate that pattern by looping the output from channel 4 back to channel 1.   But, if you invert channel 4 before feeding it back into channel 1, you get a more interesting Johnson Counter, which looks like this -
000100010001
000000000000
100010001000
110011001100
111011101110
111111111111
011101110111
001100110011
000100010001
000000000000...

Of course, 1 is on, and 0 is off.  I hope that's not too hard to visulaize...

Now, there are 4 modes... I can loop in both directions, loop in one direction and Johnson in the other, or Johnson in both directions.   If you randomly switch modes at random times, you get even more patterns, because you can start the regular loop-chase with 1, 2, or 3 lights on, or with the Johnson counter in a "funny" pattern, and things get interesting and fun to watch.

3. My current Arduino project started-out as a giant 8-foot tall bar-graph VU meter.  (It wasn't going to need a microcontroller.)  Then, I started thinking I wanted a chase-like effect, and i realized if I used a microcontroller it would be easier, and I could add a "Knight-Rider" effect, and toggling on & off, and running everything including the VU meter in both directions, or I can make the left-channel meter go-up and the right-channel meter-go down... and I've got ideas for about 10 different modes with variations of each mode...  All selected automatically/randomly.    The 1st version is 7 channels to run some short 14-light rope lights.  The hardware is mostly done.  I've got everything in a box with 7 "test/monitor" LEDs and 7 solid-state relays, and an audio peak-detector circuit.  The software is still in the experimental/development stage. The 2nd version is going to be the 20-channel 8-foot version. 

595  Using Arduino / General Electronics / Re: want to build my own power supply with pot ajustments on: March 15, 2012, 05:39:54 pm
Page 17 of the LM317 datasheet shows a "high current regulator" using some additional transistors. 


When you get up around 3 Amps I'd say it's time to start thinking about a switching regulator.  A switching regulator is much-more efficient and can put-out high-power without dissipating lots of power/heat inside the regulator itself.  (Efficiency is more important in a variable-voltage design where the voltage "dropped" across the regulator can be higher than a fixed-output design.)


Off-hand, I don't know of any variable-switching power supply chips, but I'm sure you can find something, or someone else can suggest something.
596  Using Arduino / Programming Questions / Re: Random function on: March 15, 2012, 04:10:37 pm
You generally seed the random number once (outside of the loop). But, that shouldn't be causing you a problem since you are seeding the random generate with a diferent value each time.

I agree that it makes more sense to randomly choose the HIGH/LOW (1/0) state randomly, rather than choosing the pins randomly. 

I don't think you need a random number for the pin at all...  You can simply write random data to ALL of the pins/LEDs every time through the loop, to pop-up a random pattern each time through the loop (if that's what your're trying to do).     

Unless, you wanted to change only one pin each time through the loop.  Then, you might want to randomly choose the one-pin to be "active" each time.   If you do that, you'll  only get a change about half the time, randomly... smiley-wink 

P.S.
I dont know what your goal is, but once you get this working you might want to make one more enhancement...

Since there are 8 different possible "patterns", you are going to get a "repeat" about once per second (randomly)... i.e.  you'll get the same pattern twice in a row...  so on-average, you'll only get about 9 "changes" per second (instead of the expected 10), and it's going to "look like" a glitch or a pause.  If that's a problem, you might want to look for that and skip the delay if you get the same pattern twice in a row.

If there are any other "invalid" states like all-on, or all-off, you can check for that too, and start the loop over if you get something invalid.
597  Using Arduino / Audio / Re: arduino + siren on: March 15, 2012, 02:10:56 pm
I see the picture, but I don't see any specs... Is that a speaker or a siren?

smiley-sad You can't drive a speaker or a siren directly from the Arduino or a 555.  You need to boost the voltage/current.

If it's a siren, you don't need the 555.   You hook it up to 12VDC (I assume it runs off 12V?) and it makes noise.   (Do NOT connect a speaker to 12V!)   In that case, you need a MOSFET or transistor (and a 12V power source) to go between the Arduino and the siren.

If it's a speaker, it typically needs a power amplifier between the 555 sound generator and the speaker. (There are lots of power amp chips available.)  Or, in this application you don't really need a clean-linear, non-distorted, audio amp, and you can use a MOSFEET (or two) in non-linear "switching" mode.

P.S.
You should be able to generate siren-like sounds without the 555s by using the tone() function.    (Of course, you'll still need to boost the signal to drive a speaker...)
598  Using Arduino / Project Guidance / Re: How do I change the code to do the opposite? (conductive paint) on: March 15, 2012, 01:24:50 pm
I'm just going to make a guess...

Old code:
Code:
// check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn speaker on:   
    digitalWrite(speakerPin, HIGH); 

Try changing the condition from HIGH to LOW...
Code:
// check if the pushbutton is pressed.
  // if it is, the buttonState is LOW:
  if (buttonState == LOW) {     
    // turn speaker on:   
    digitalWrite(speakerPin, HIGH); 

599  Using Arduino / Project Guidance / Re: Can ATtiny45 be used for this application? on: March 15, 2012, 12:58:54 pm
I'm going to say...  probably... smiley-grin

But, if you are using a Duemillanove (or Uno), what's the ATtiny45 for?

Quote
One of my friends said it might have some problems with "interrupt" or something. I am not really so keen on microcontrolers.
Probably right...

A microprocessor/microcontroller can only do one thing at a time.*  So in your case, it needs to switch between timing the wheel rotations and updating a display (or sending out PWM, or whatever).   

If it's updating the display when the wheel sensor gets triggered, you need to interrupt the display process (for perhaps several microseconds) and "grab" the time before too much time goes by and the timing/speed gets fouled-up.

Quote
The idea is to mount several magnets...
I think it's "traditional' to trigger once per revolution.  The more magnets you use, the more chance there is for a problem.  Maybe go with two if you want to keep the wheel perfectly balanced.    If you have 10 magnets, and one gets knocked out of position or fails for some reason, you'll be off 10% and you may never know...   More readings isn't going to make it more accurate.  It's just going to give you more data/readings.   How many times per wheel revolution can you read the speed display? smiley-grin   For the microprocessor & firmware, it's no problem...   Several triggers per revolution is s-l-o-w for the processor.

Quote
...for a Schmidt trigger on the rear hub.
You're going to need a hall-effect sensor too. smiley-wink



* Your computer is multitasking all of the time, even when you're only running one application.   It's constantly updating the display and monitoring/updating the mouse, and a bunch of other stuff, etc.  But, (assuming a single core) it's really only doing one thing at a time, rapidly switching between tasks and handling interrupts.   



600  Using Arduino / General Electronics / Re: Pull Up / Pull Down / Wired OR on: March 14, 2012, 07:47:11 pm
I'm new to the Arduino, and i don't understand what the pin-13 connection (through a capacitor) is doing... The reset circuit is already ORed (actually NORed) with the reset button.

Quote
Connecting pin-13 being high to RESET would probably inhibit a reset...
Yeah, and if you make a hard connection to +5V (no resistor) pressing the reset button will short 5V to ground.

Removing the capacitor (C5) will break all connection between pin-13 and reset.  Someone else will have to jump-in and explain the effects/consequences.

Quote
Can I break something by eperimenting, short cutting etc.
Shorting is generally dangerous. (Dangerous to the parts... not dangerous to you... smiley-wink )   You can get excess current and burn-out parts.   Often, you can get-away with  things you should never do, like accidently shorting an output to power or ground, but you can blow the chip so you shouldn't try it.  (Shorting the reset to ground won't "damage" anything...  You'll just get a permanent reset condition. smiley-grin ) Cutting traces and opening circuits is generally safe.   "Randomly" connecting-up capacitors or higher value resistors shouldn't damage anything.    I'd say a 10K resistor connected anywhere on the board very-unlikely to damage anything.   I'd be "careful" with values less than 1K.
Pages: 1 ... 38 39 [40] 41 42 ... 52