Show Posts
Pages: 1 ... 47 48 [49] 50 51 ... 79
721  Using Arduino / General Electronics / Re: Powering LED array from mains on: October 22, 2012, 01:36:50 pm
Quote
3.2-3.4v @ 25ma is the rating for the LED's, if I were to string 36 of them in series, that makes 118v give or take.  Unless I misunderstand, all I would need then is a current limiting resistor (56 ohms by my calculator) per string of 36 LED's.  This also works out conveniently to just about three watts exactly per string, including the dissipation from the resistor.
I'd go with Jack's calculations...  smiley-razz  With 56 Ohms, you'll get about 1Amp peak through the LEDs and probably fry 'em all!   (I assume your mains voltage is 120V (not 220V)?

One more consideration - The voltage across the LED's is approximately constant. That means the less voltage you drop across the resistor, the worse your "brightness regulation".  With 50V across the resistor, a 10% change in the 170V peak voltage is 17V.   That entire change appears across the resistor, which means a 34% change in current (and brightness).    So with an unregulated power supply, don't try to stack-up as many LEDs as possible in order to minimize the voltage across (and power wasted in) the resistor.
722  Using Arduino / Project Guidance / Re: Light switches - Doable? on: October 22, 2012, 12:41:43 pm
Take a look at this example and this example.

The examples use momentary pushbutton switches, but a toggle switch would be wired the same way.

BTW -  A regular light swith is a SPST (single-pole, single-throw) on-off switch.  It has two terminals and works like any other SPST switch.

A "3-way" switch (like when you have one switch at the top of the stairs and another at the bottom) is a SPDT (single-pole, double-throw "on-on" switch with 3 terminals.    You can use a SPTD switch in plqace of an SPST switch if you leave one wire/terminal disconnected.  (But, "3-Way" light switches are more expensive.)
723  Using Arduino / LEDs and Multiplexing / Re: Help needed with 10 LED driver lm3914 on: October 18, 2012, 06:59:06 pm
As you may know power (mW) is heat.

A couple more bits from the data sheet:
Quote

Power Dissipation (Note 6)
Molded DIP (N) 1365 mW

Note 6: The maximum junction temperature of the LM3914 is 100°C. Devices must be derated for operation at elevated temperatures. Junction to ambient thermal
resistance is 55°C/W for the molded DIP (N package).

Gluing a DIP heatsink would help too.

Quote
You can probably do it a lot more efficiently with your arduino.
I'm not sure what you mean by efficient...   A microcontroller is total overkill when a single-simple cheaper chip will do the job.

Now, for the VU Meter "effect" I'm working on right now...   It reverses, inverts (lights go off with loudness), it has bar-graph mode, dot-mode, and dots-mode  (with a random variable number of "dots").   And, it has does several other non-meter audio-driven effects.    That design "needs" a microcontroller.  I actually started that project a couple of years ago with an LM3914 and a bunch of other logic and shift registers, etc...    It got really "messy", and I decided to "go programmable" and do all of the hard stuff in software.
724  Using Arduino / LEDs and Multiplexing / Re: "Fooling" constant-current control loops in LED driving? on: October 18, 2012, 06:20:56 pm
Uh...  Yeah.... Dynamic range is the difference between full-bright and fully-dark.   You can't get any more dark than "off", so you can only go brighter ...  and you can't (or shouldn't) go over the device's maximum current rating on the bright-end.

16-bits (converted to decimal) gives you a range from 0 to 65,535.     I'm sure you can't tell the brightness-difference difference between 0 and 1, between 65,534 and 65,535, or between 30,000 and 30,001, etc.!   
725  Using Arduino / General Electronics / Re: DIP replacements for SMD parts for light dimmer schematic. on: October 18, 2012, 04:54:30 pm
Quote
I’ve breadboarded the zero crossing part of the schematic, and it doesn't seem to work
I’ve replaced r2 and r3 with 120K Ohm because it’s on 230V over here...

That looks about right...

Quote
I think I need a oscilloscope, to figure out where the problem is. Or has somebody an idea?
A 'scope would be nice if you have access to one, but to you have a multimeter? 

I'd want to know if the ZERO CROSSING signal is stuck-low or stuck-high.  Do you know that?

The voltage out of the full-wave rectifier should read around 2V DC (of course it's "pulsing") with the opto isolator connected.  With the opto disconnected, you should get the full-rectified 230V.   (I'm not sure what your meter will read on the DC scale with rectified AC, but you should get something in that ballpark.)

P.S.
I can't see any reason why this won't work., but if you give-up and want to try something else...  When I made a dimmer circuit, I also bult the power supply.   So, I used the low-voltage out of the transformer to get the zero-crossing signal.   The transformer takes care of the isolation, so you don't need that optoisolator and you don't need the higher-power resistors. 

It's hard to detect the actual exact zero crossing point, and  1V of noise on the AC line can cause errors when you are trying to find "zero"...  It's hard to detect the peak too, since it varies and the rate-of-change is less at the peaks of a sine wave.   So, it's better if you can detect somewhere around the midway point (around 45 degreees) and compensate for the time/phase difference.    (When I did it, I used an op-amp comparator to find a voltage somewhere around the mid-point, and I just experimented to find the timing-shift that "worked"... I don't have a 'scope at home.)

Since you know the frequency and you have a microcontroller to keep track of time, you don't need a full-wave detector.  You can use a single diode (half-wave) to detect every-other zero-crossing.
726  Using Arduino / General Electronics / Re: 4 pins on a Speaker? on: October 18, 2012, 04:12:12 pm
The data sheet is not clear and I've never seen that before, except some woofers have dual voice coils...  Can you see any small wires soldered to the terminals?

I would guess that two termminals are connected together and connected to +, and the other two terminals are connected together and to - .

Do you have a multimeter to check if any of the terminals are connected together?

If you have a series resistor (a couple-hundred ohms or so) to limit the current, you can simply try it out.    If you connect a "short" with a current limiting resistor in-place, nothing bad will happen.

Quote
...is it not just Gnd and V+ usually?
If it's just a speaker/transducer and not a "buzzer" or "beeper", you don't connect V+.    You connect signal and ground.  It won't make any noise with V+ connected.     V+ won't hurt a piezo, but it's not good to put constant DC voltage into a speaker with a coil.   5VDC into an 8-Ohm speaker coil is 3 Watts of heat, with no sound. smiley-wink

727  Using Arduino / General Electronics / Re: Running a stepper motor directly from Arduino outputs... will zeners help? on: October 18, 2012, 03:57:23 pm
Quote
If I was connecting anything else coil-based (like a relay) to an Arduino, I'd stick a diode across the coil facing the other way, so when the coil's power goes off and the magnetic field collapses, any voltage it generates can dissipate through the diode rather than zapping my Arduino. That approach won't work with my stepper, as the voltage across the coil could be in either direction depending on which step the motor's at.
DISCLAIMER - I haven't completely thought this through, or analyzed the circuit and current flow.

You can reverse the coil connection, but from the Arduino's point-of-view, you cannot reverse the output polarity and put-out a negative voltage.    So, I think a "regular" diode (silicon or schottky) to ground on each Arduino output will protect it from negative spikes, and another diode to +5V will protect it from positive spikes over 5V.
728  Using Arduino / Project Guidance / Re: How do I get input reading? on: October 18, 2012, 02:55:40 pm
I've never done anything with a joystick, so I'm just going by what I'm reading....

You don't need digitalSerialRead.  The joystick is not serial.   You might be confused by how the regular computer is reading the joystick.   That's not too important because the Arduino can read both analog & digital signals. 

Of course, you need to connect +5V and ground.

Let's start with the buttons - These are digital, so use a digital input pin and read the state of the pin with digitalRead().  It looks like the when you push the button, a connection is made to ground.   That's fine, but you need something to change when you push the button.   If you configure the input pin with pinMode, you can can enable the internal pull-up resistor.   Now, when the switch/button is off/open the digital input will read 1 (high).   When you press the button to ground the input, it will read 0 (low).

The actual joystick X & Y outputs connect to an analog input pin, and you read the position with analogRead().   Both should read somewhere around 512 (half way to 1023) with the joystick centered.
729  Using Arduino / General Electronics / Re: Should a serious hobbiest/EE own both a digital and and an analog oscilloscope? on: October 17, 2012, 06:46:45 pm
I don't own a 'scope, but sometimes I lust for one!  smiley-grin

I've rarely needed one (for analog or digital stuff), and since I work in electronics I can bring my hobby projects into work on the weekend.

We don't have any analog 'scopes at work anymore.    As far as I know, there is no advantage to an analog 'scope as long as they both have the same speed (MHz).    The Tektronix digital 'scope on my bench right now is rated at 100MHz, with a sample rate of 1.25GS/s. 

Analog waveforms look perfectly "smooth and analog".  The measurement features are a nice bonus...  It measures period/time, frequency, and voltage (and maybe some other stuff I don't use).  Another nice thing with a digital scope is that you get a "nice picture" no matter what you are looking at.   For example, when you look at a very low-frequency waveform (let's say 1Hz) on an analog 'scope you don't get a waveform, you see a dot tracing across the screen.  If the frequency is a little higher, you'll get a waveform, but it will flicker.    Or, if you're looking at a short pulse with a low repetition rate, it can be very-dim.  On the digital 'scope you can always see the pulse, and I never even touch the brightness control.

It might be like the analog audio myths…  A lot of audiophiles seem to think that analog vinyl has “infinite” resolution.    That’s nonsense, since the noise floor makes the resolution/accuracy far worse than a CD.   It’s OK to prefer analog sound if that’s what you like, but digital is technically superior.   Or, it’s like saying that my “analog” ruler is better than my digital calipers.

One “interesting” thing is that the screen resolution on my Tektronix ‘scope is “only” 8-bits.   That seems terrible, but that’s 256 “dots” which is about half that of DVD.  I'm pretty sure you can't see a 1-bit change on a 4-inch screen. 
730  Using Arduino / Programming Questions / Re: C++ What is and isn't implemented in the Arduino IDE on: October 17, 2012, 04:30:46 pm
Quote
The Libc (run-time libraries included with the AVR port of GCC) documentation can be found here...
http://www.nongnu.org/avr-libc/
Thanks for that!   The Language Reference on the Arduino website seems very abbreviated.

Quote
sprintf is a function in the C(++) run-time library.  It's only connection to C(++) is that it is included with most toolsets.
Actually, sprintf() is part of the official ANSI/ISO C and C++ language standards. 
731  Using Arduino / Project Guidance / Re: how to blink a light on: October 17, 2012, 01:39:14 pm
Quote
what about making it standalone? this is one very small project i wanted to start off with, i don't want to lose a 40 dollar arduino board just for this small circuit
It's probably not worth the trouble to make a "stand-alone" circuit if you are going to use a microcontroller... That's up to you, bit I think it's really cool that the Arduino comes on a fully-functional circuit board with USB and a voltage regulator, boot loader, and all that.  I might have a custom PC board made if I needed to save space or if I was manufacturing a product for sale.   But for a one-off hobby project, I'm going to use the pre-assembnled board.

A microcontroller is total is overkill for blinking an LED.   The "blink LED" example serves two purposes...   It introduces you to programming with the simplest possible program (sketch), and it helps you to confirm that the complier is working and that you can upload your program to the Arduino.  (It also assures you that the Arduino is working.) 

When you take a "regular" programming class, your 1st program is "Hello world!".  All it does is display "Hello world!" on the screen.   Since the Arduino doesn't have a screen, we blink the LED.

Even if you already know how to program, whenever you get a new compiler (or new development system), or you are learning a new programming language, you always try to get "Hello world!" working first, before any real programming. 

A '555' sells for less than $1 USD.  It doesn't use programming/software/firmware, and you don't need a microcontroller/microprocessor.   The timing is controlled by resistor & capacitor values (R-C time constants*).   

It can be used as a "one shot" or as a multivibrator (continuous oscillator).

Quote
i need to turn the led on for aproximately 1 second then off,  then on for 2 seconds then off and not have it repeat.
I'm not sure I understand...   If it doesn't repeat, how can it be off for only one second?  ...It's off "forever" (or until triggered), on for 2 seconds, and then off "forever" again.

Or, is that a delay?  i.e. It's off and you trigger it... One second later it comes on for two more seconds?   For that, I think you'd need two 555 timers (or a 556, which as two 555s built into one package).    You might also need a couple of "logic chips" (and-gates, or-gates, flip-flops).   ...No, I think it can be done with one timer and some logic, but I can't design it in my head. 

I assume you learned enough from your digital class to do that...  It should be really "simple", but not as simple as copying an example sketch, if you are a beginner in electronics & programming.   


*  R-C time constants are not as accurate as the crystal oscillator in a microcontroller.   So for example, if you are blinking once per second, and it's really important to blink exactly 3600 times in one hour, an R-C oscillator won't cut-it.   You can use a cristal oscillator with simple logic circuits (instead of something like a 555), but they don't come in "slow", so you need a divider (more logic circuitry) if you're going to use a megahertz crystal to blink an LED at 1 Hz.
732  Using Arduino / Project Guidance / Re: Measuring solar panel voltage on: October 16, 2012, 07:11:45 pm
I assume we are not talking about a 120V or 220V solar panel that powers your house? 

The maximum voltage you can connect to the Arduino is 5V.

For anything that's "safe", say below 40 or 50V, you can use a Voltage Divider (2 resistors) to scale-down the voltage into the Arduino.     You don't want the voltage divider to put a "load" on the solar panel, so I'd use resistor values that add-up to around 10k Ohms.
733  Using Arduino / Project Guidance / Re: Lots of IO ? on: October 16, 2012, 05:40:15 pm
Quote
For the seven 220 V/0.5 A outputs you don't even need relays.  Since the current is only going to be about 0.5 A, a MOSFET rated for 250 V would suffice...
MOSFETs don't work with AC.  (You could do it with a pair of complementary MOSFETs on each output, but would get "messy".)    Plus, he needs some "safety" isolation between the 220V and the Arduino.
734  Using Arduino / Project Guidance / Re: Relay and current on: October 16, 2012, 03:46:07 pm
Quote
The fuse in the lights are rated at 3 Amp (yes...Christmas lights- led type)...

The solid state is rated at 2 Amp...

yeah, I'll check the current...
Check the current, but I'm pretty sure you'll be fine.   Power = voltage x Current, so 3 Amps is more than 300W!  That would be a ship-load of power (and light) for a string of Christmas lights...  Especially LED Christmas lights.

Is there a Wattage rating listed somewhere?  I looked-up a string of 70 LED lamps online, and it's rated at 4.8W (0.04 amps = 40 mA).  That "feels" about right to me.

The only "gotcha" could be an "inrush" current when the lights are switched-on.   Highly unlikely, and the only you'd find that is if you smoke a relay.

735  Using Arduino / General Electronics / Re: BJT transistor base current calculation on: October 16, 2012, 01:48:07 pm
The problem with current gain is that its "poorly characterised" - which is gobbledygook for "varies a lot between devices".
That's a good point!    It might OK if you are dimming one LED for a hobby project, or if you are just experimenting.  But if you are building a product on an assembly line, or if there are several transistor/LED dimmers in your project, every LED would have different brightness with the same "settings".

Typically, you'll design the circuit so that resistor values control everything.  For example, if you study op-amp based amplifiers, you will see that the large amounts of negative feedback are used, and the resistor values determine gain.  (Or you do it digitally, such as PWM dimming. smiley-wink )
Pages: 1 ... 47 48 [49] 50 51 ... 79