Show Posts
Pages: 1 ... 37 38 [39] 40 41 ... 78
571  Using Arduino / Project Guidance / Re: Automotive Flasher Relay on: February 06, 2013, 01:48:56 pm
I'm not going to attempt to write your sketch for you...

It looks like you just need some if statements and/or some if-else statments to control what your program is doing.    Conditional execution (if statements, etc.) and loops (doing stuff over-and-over) are the two most important concepts in programming.   They are the things taht make programming worthwhile.

I think you just need to read-through the Programming Language Reference and take a look at a few more examples, and then just start experimenting and learning!     Add a couple more lines of code to your sketch at a time to add features/functions.   

Do NOT try to write the whole program before trying it out!   Add a few lines of code at a time.   That way if there is an error or a bug, you'll know where to look instead of trying to find 100 errors at a time.  smiley-wink

Quote
Hazard warning lights switched on off on within 2 seconds, indicator strobe effect (recovery vehicle etc)...
  That sounds like an if-statement that changes the delay time.

Quote
Finally load sensing so when a trailer is attached it flashes the trailer indicator reminder light on the dash ( optional but already does it on the standard relay).
I don't know how that's wired-up, but the Button Example reads the state of an input pin and with an if-statement, turns an LED on/off.  That should get you started.   ...Don't connect 12V directly to an Arduino input.  Use a voltage divider (2 resistors).
572  Using Arduino / Project Guidance / Re: Looking for enclosure with a slot for dip switches? on: February 06, 2013, 01:17:33 pm
I'd look for a local "Precision Machine Shop" or a "Precision Sheet Metal Shop".   Then, you can bring your box in and talk to them about approximate prices, and if it seems resonable you can get a formal quote.

If you are in the U.S., the set-up time (for each run/batch) is probably going to run a couple hundred dollars.    So, the per-unit cost will depend on quantity.   If you are making 10 or 20 units and you need to keep the cost down, doing it yourself with a hand-nibbler and a file might be the best option.

Quote
If I did decide to go with the custom case route, have them cut it then I might as well go all the way and have my company logo printed/painted on too.
A full-custom (sheet metal) box will probably become economical at around 100 units.      Silkscreening & painting should be the same for a modified box or a fully-custom box.   Again, the set-up costs for silkscreening & painting will be a significant consideration if quantities are low.

Where I work, we use a small simi-custom box.  The box-bottom is sent out for machining (probably in quantities of 100) to add a couple of countersunk holes.   The aluminum front & rear panels are custom made by a sheet metal shop.    These might be made in smaller quantities because the same basic box is used in several different products.   The rear panel is brushed-& silkscreened.   There is a custom adhesive plastic front-panel overlay with printing, a cutout for a switch, and windows for LEDs.   The cost of all this stuff adds-up to about $35 USD per unit.
573  Using Arduino / Programming Questions / Re: How to do exact time blinking for a Led on: February 05, 2013, 02:08:58 pm
The crystal-clock in your camera is probably MORE accurate than the Arduino resonator-clock. smiley-wink

But nothing is perfect, and if you shoot with multiple cameras they will drift apart after several minutes (or maybe an hour) of continuous shooting.  And if the audio is recorded separately, you can start to see "lip-sync" problems after a period of time.

With professional audio/video they use a very-accurate master clock linked to all of the equipment to keep multiple cameras and multiple audio recorders in sync. 

And of course, the playback system is equally important...  If you have two copies of a DVD and two DVD players, and if there were a way to start both players at exactly the same time, but the end of the movie, they would probably be out-of-sync by at least a couple of frames.
574  Using Arduino / Audio / Re: Audio input via computers built-in microphone? minim for arduino? on: February 05, 2013, 01:48:21 pm
P.S.
If your goal is to have fun with Arduino and learn about it, a VU meter could be a good project.  But, if your goal is to build a VU meter, there are easier ways to build one without programming a microcontroller, such as this kit.

...I have a VU meter lighting effect that's built with an Arduino, but it it's programmed to do lots of random things, like reverse, invert, dot-mode, and other sequences/ options that are not VU meter related.

P.P.S.
I didn't read carefully...  Of course you don't have a "Windows" mixer, and GoldWave does not run on a Mac either (but Audacity does).
575  Using Arduino / Audio / Re: Audio input via computers built-in microphone? minim for arduino? on: February 05, 2013, 01:19:25 pm
You know...   most recording/audio editor programs (Audacity, GoldWave, etc.) have a meter display on the computer screen (with no additional hardware).

If you are going to use the Arduino and buld some circuitry, I'd recommend NOT using a computer. But, if you want to use the computer as an amplified microphone, you can simply turn-on the mic in the Windows 'Playback' Mixer and turn it up volume.   Then, the amplified line-level signal should come out of the headphone jack...  You can run the headphone-output into the Arduino (with the proper signal conditioning to block negative voltage swing, which can kill the Arduino).

I normally use a Peak Detector Circuit to condition the audio input.   But, you can also use a pair of  resistors and a capacitor to simply bias the signal at 2.5V.

Here is a little pre-assembled PC board with a microphone and an amplfier.   You can connect it directly to the Arduino and you won't need a computer.  (of course, you will need a computer during the design & construction process to to develop your code and to program the Arduino.)

Before you start making a VU meter, this simple Analog Input Example blinks an LED depending on the analog signal.   You might want to experiment with replacin the pot with an audio input.

Here is a VU Meter Example Projcet
576  Using Arduino / General Electronics / Re: How do you calculate what the voltage will be after a resistor? on: February 04, 2013, 07:48:03 pm
Quote
So that would mean that if I have a 100mA load I'm going to get a totally different voltage than I would I I have a 4A load. That's not what I've experienced in practice. The voltage generally remains the same unless something with a massive amp draw is running.
There is something wrong with your measurement....   The ONLY way to get 40 times the current across the same resistance is with 40 times the voltage!   (With a 30-foot wire, you might not be able to measure that accurately.)   Ohm's Law describes the relationship between voltage, current, and resistance.   It's a law of nature* and it's always true.   i.e. If you double the current through a constant resistance, you double the voltage across the resistor.


The units of measure (Volts, Ohms, and Amps) are man-made, but the relationships are determined by God!  (Or nature if you like.)
577  Using Arduino / General Electronics / Re: How do you calculate what the voltage will be after a resistor? on: February 04, 2013, 07:34:46 pm
Quote
if the resistance of the wire is known, what formula will tell me the resultant voltage?
With a voltage divider, the voltage is divided in proportion to the resistance.   

Or, since the current is the same in both resistors, you can calculate the current from the total resistance and total voltage, and then knowing the current through each resistor, you can calculate the voltage across each resistor.

If you connect a voltmeter to your circuit, the resistance of the voltmeter becomes the 2nd series resistor.   The circuit is completed and a tiny amount of current flows.  (The current is small because the resistance of the meter is high).

Quote
nope. The voltage varies depending on resistance.
Are you measuring a voltage drop with a voltmeter/multimeter?    There is no voltage drop until you connect your meter, (or until you connect something to complete the circuit).  because there is no current flow unitl you connect your meter.    And, you will only measure a voltage drop if the resistance is very high.


Quote
Another example is that same battery and a 30ft wire. the voltage measured at the end of that 30ft wire will not be 12v because of the resistance of the wire.
Again, only if there is current.    And in this case, your meter cannot measure the voltage drop, because the resistance is so low compared to the meter resistance.
578  Using Arduino / General Electronics / Re: voltages questions on: February 04, 2013, 02:19:57 pm
Quote
there is just VCC , VDD, VPWR etc... that's why i was asking for the difference
Those are just names, and they need to be defined/documented somewhere.    Sometimes "knowing" that Vcc is usually +5V, might not be enough, or using the name/label '+5V' might not be enough, because there may be more than one 5V supply and you need to know which 5V supply is connected to which IC.  (i.e., you might have Vcc1 & Vcc2, etc.)

It's like anything else on a schematic...  It helps relate the schematic to the physical circuit.

Typically with an emulator/simulator, you can assign connections/meanings of your choice to these names/symbols.
579  Using Arduino / General Electronics / Re: anyone use these super strong LEDs? on: January 31, 2013, 01:25:38 pm
That same eBay seller offers this 10W LED-driver power supply.

To expand a bit on the voltage & current issue...   LEDs (all diodes actually) are non-linear.    A voltage change of 1/10th of a volt might change the current flow by a factor of 2.    On top of that, the forward voltage drop (at a constant current) varies with temperature, and from part-to-part.   So the proper solution is to use "constant current" power supply.    A constant-current power supply tries to supply the same current no matter what load is attached.  (At some point if the load resistance is high-enough, the power supply cannot supply enough voltage, and the current will be lower.  But, within it's normal operating conditions, the current is (approximately) constant.) 

With "normal" low-power LEDs, a constant-voltage power supply and a current limiting resistor can approximate a constant-current source, and thats how it's done with "regular" LEDs.  The higher the supply voltage, and the higher the voltage-drop across the resistor, the better it approximates a constant-current source.   But, the resistor usually wastes more power than the LED is consuming, so a current limiting resistor is not efficient and not practical for higher-power LEDs.   A constant-cuirrent switching supply (which uses an inductor) can be nearly 100% efficient.  Just about anythhng you buy that has 1W or higher LEDs is going to have a constant-current switching supply.    The downside to a constant-current (switching) supply is complexity and cost.

A "normal" power supply is constant voltage...  A good well-regulated 12 power supply will supply a (approximately) constant 12V as long as the input voltage and current-load are within spec.    Actually, most "things" are constant voltage...  For example the Arduino's output pins are (about) 5V (when  "on" ), as long as you don't exceed the 40mA output-current rating.
580  Using Arduino / General Electronics / Re: Small power source for one century on: January 30, 2013, 09:09:38 pm
...a mechanical watch mechanism might be a better bet for the timing - if you can find a power source with sufficient shelf life to wait to be activated.
That's probably the most "practical" idea!    I THINK I've heard of mechanical clocks that only have to be wound once a year.    One hundred of these mechanisims with one triggering another in series could probably work.    And, for the "final action", probably a bigger spring-driven generator.   

You'd have to make sure there's no corrosion and that the lubrication won't dry-out.   

There are ways of generating electrcity with thermal differences, etc.   But you still need to STORE the energy in a battery (or capacitor) to continuously supply the clock.  It's the long-term reliability of the battery (with its nasty corrosive chemistry) that I'm worried about.

 
581  Using Arduino / Project Guidance / Re: Working With ICs That Are Too Small For Legs To Fit Into Breadboard on: January 30, 2013, 08:39:06 pm
Here's one example.   With most (all?) of these things you'll need to solder the chip to the adapter board. 
582  Using Arduino / Project Guidance / Re: Help! AMBX RGB LED light extension project! on: January 30, 2013, 03:10:23 pm
Quote
These test points (TE4, TE6 and TE7) would be much easier to solder onto, but could they be connected to Arduino safely (within current limit?) and would it be easier to decrease this voltage to the 5v for monitoring instead of using the IC1's LED-level output?
In any case, you will need to reduce the voltage*.   Your circuit has signals between zero and around 18V.   The Arduino can be damaged with voltages above 5V.   Reading voltage pluses with a meter only gives you a rough idea of what's going on, and different meters will "average" differently... 

Looking at the schematic, I don't think those test points are going to give you a good signal (i.e. it doesn't like it will go close enough to 0V).

The outputs of U1 (pins 1, 7, 8 ) are probably the best place to pick-up the PCM signal (which will switch  between around 0 and 18V).   A voltage divider (2 resistors) can be used to knock-down the voltage.     I'd use 10K as the aproximate total resistance for your voltage divider.    2.7K and 7.5K are standard values that will probably work.

Then, if you are going to use an Arduino analog input, you'll need a low-pass RC filter to convert the PWM to variable DC.   I assume a time-constant of around 0.1 Second should work.   And, again, I'd start with about a 10K resistor and you can calculate the capacitor value.  (The resistors in the voltage divider will interact with the filter to an extent, but you'll probably be experimenting with different values anyway.)

I have to agree that the Arduino is probably overkill!   But, it does give you the ability to do anything you want with those 3 color-signals!




* On the Arduion's inputs, we have to be concerned with voltage.   On the outputs, we have to be concerned with current.   The relationship between current, voltage, and resistance (or impedance) are is described by Ohm's Law.  The very-high input impedance of the Arduino (under normal conditions) means that current flow into it is very-very low.
583  Using Arduino / Project Guidance / Re: Random Flashing Strobe Control on: January 29, 2013, 05:49:25 pm
Quote
I will also need to bias my random outputs so that I do not repeat the same strobe twice in a row.
Probably the easiest solution is to put your random-variable selection in a loop (probably a while() loop) and loop 'till the random next lamp is different from the current lamp.

i.e. Pick a random NextLamp number and if NextLamp == CurrentLamp, continue looping and get another random Next Lamp.   If they are not equal (which will be true most of the time), break out of the loop.   As long as this loop is running fast enough (relative to your flash interval), you can randomly pick the same number several times in a row and you'd never see a problem.

Of course when the time is up, CurrentLamp will be assigned the value of NextLamp and you'll have to find a new-random NextLamp.

Another way to do it is to make an array which excludes the CurrentLamp, and then pick a random element from the array.   (Something like this is often done to simulate a deck of cards, where you can't select the same card again after it's removed from the deck.)
584  Using Arduino / Project Guidance / Re: Random Flashing Strobe Control on: January 29, 2013, 05:07:28 pm
Quote
I think I will need to use some sort of psuedo mutitasking or timer variables?
By using the Blink Without Delay technique, you can have multiple delays that don't interfere with each other.

Or, they can relate to each other...  But in any case, you can have more than one timer running at the same time, since your loop runs continuously without any delays in the actual loop.

So you can trigger the 1st strobe

... Then after some delay, send a trigger to the 2nd strobe before the 1st one actually fires.

... Then, after enough time has passed for the 1st on to fire, turn it off before it can fire again.
585  Using Arduino / Project Guidance / Re: Lower the voltage comming into the Arduino Pins? on: January 28, 2013, 06:59:20 pm
First, since 90V can kill your Arduino  I'd recommend a pair of protection diodes* and a series resistor.   (This circuit will knock-down the voltage in a non-linear fasion, so it's just protection against over-voltage...  It is not used to attenuate a 0-90V signal down to 0-5V inearly...   i.e. 90V or 45V would both read "5V".)

Then, you'll need to measure the voltage output under your real-world conditions.    You can experiment with a parallel resistor (probably in the in the megohm range) to knock-down the signal (linearly), if necessary.    You are unlikely to get 90V and you might end-up getting less than 5V depending on your pressure & physical configuration.   (But, I'd still recommend the protection diodes.)   

Or, you can use a regular 'ol voltage divider (again along with the protection diodes).   But, with the high source impedance of piezo will create a 3-way voltage divider, and your signal will be reduced by more than the calculated amount...    A lot more if you use low-value resistors in the voltage divider.

Quote
i need a voltage sensor because i want to detect the voltage comming from the piezo from different pressures. so i want the exact number...
That's only gong to work for quick pressure CHANGES.   A constant pressure (with no physical movement) is NOT going to generate a constant voltage.**   I believe the piezo acts like a small capacitor, so it might sort-of hold the voltage for a several microseconds as it discharges through the load resistance.


* The Arduino has built-in protection diodes, but they are rated for low current and are only there as a "last resort" in case something unexpected happens (such as static discharge).   If you are experimenting with something that puts-out more than 5V in normal operation, you should take steps to reduce the voltage before it hits your Arduino.

** Conservation of energy...   Gravity can generate electricity as water flows down and through a generator.  But, you cannot use the static pressure of water behind a dam to generate electricity.


Pages: 1 ... 37 38 [39] 40 41 ... 78