Show Posts
Pages: 1 ... 47 48 [49] 50 51 ... 78
721  Using Arduino / General Electronics / Re: BJT transistor base current calculation on: October 16, 2012, 01:23:02 pm
Quote
could i potentially use a transistor to limit current that goes on through the emitter to the device? I mean, by placing a correctly valued resistor in series with the base of transistor, to control the saturation current?
Yes...  You can use a resistor (or something else) to control the base current, and as long as you are not in saturation, the collector current is proportional to base current (multiplied by the beta).    In that case, the transistor is operating "linearly", not as a switch.   You can use someting to "linearly" dim an LED.

When you are in saturation the load device (and voltage) determines the current.   If you reduce base current to the point where you are no longer in saturation, the transistor begins to limit the current.

When you are operating lineraly, the transistor will "see" voltage and current at the same time.  It will dissipate power, and it will heat-up.    So, you have to be aware of the transitor's power rating as well as it's current rating, and in some cases you need a heatsink. That is, you can burn-up a 1 Amp transistor with much less than 1A if you are dissipating power.    With an LED, this is usually not a problem.
722  Using Arduino / General Electronics / Re: BJT transistor base current calculation on: October 16, 2012, 01:11:58 pm
Quote
So what I really need to know is, how to calculate the max value of the series resistor that I can wire to the base of transistor, to still allow maximum current through collector-emitter?
We can make some appoximations & assumptions to simplify the calculations.    You need to allow for tolerances anyway, so there is no exact answer.  ( A lot of engineering has to do with knowing what's critical and what can be assumed, ignored, or approximated. smiley-wink )

We do need to know the approximate collector current.  Or the "worst case" or maximum for your application.  (You don't need the transistor's maximum current rating for the calculation...  But, you need to make sure your application doesn't exceed the device's maximum rating.)

You shouldn't be thinking in "maximum" values...   You need to find an approximate value that will work with the actual current in your circuit.

First, I'll assume this is a switching application, and that the emitter is grounded.

Next, I'll assume the transistor beta (current gain) is around 100.   The data-sheet will give you the minimum value (and sometimes a "typical" value).  But since this is a switching application we dont need to know the exact value.   So, we can design a circuit that works with betas between 20 & 50 and we can be sure it will always work.  (Assuming a low beta insures that we alway have enough base current to saturate the transistor.)

The base-emitter voltage is around 1V with the transistor turned-on.   The exact voltage (usually) isn't important, since (in most applications) most of the voltage is dropped across the resistor...  A rather large-percentage change in B-E voltage won't change the voltage across the resistor that much.  In fact, you can assume zero B-E voltage, and most of the time it will work, since we are assuming a low beta and providing plenty of base current.

Now, you can calculate a resistor value that gives you a base current that's about 1/50th (to 1/20th) of your collector current. 

Example - If you need 1 Amp, and you have 5V into the resistor (4V across the resistor).  Ohms' Law says you need a ~200 Ohm resistor.


         

723  Using Arduino / General Electronics / Re: How to Connect Device to Relay? on: October 15, 2012, 07:12:46 pm
Quote
In short, how would one go about taking any normal, say, 2-prong desk lamp and connecting it to a relay? Do I have to cut its wire and wire it that way, or what is the best thing to do?
Don't "distroy" the lamp.   

For temporary-experimental purposes, you can splice the relay into an extension cord.  But, you gotta' be careful, and you might want to put the relay board in a plastic box, or wrap it in electrical tape while you're playing around.

Sometimes a regular electrical box (like the kind inside your walls) works really well, and is very economical.  You put your relay in the electrical box, and simply plug-in the lamp.  But, you'll have to make sure the relay board and the outlet both fit into the box. 

You just go the hardware store and get an outlet box, an outlet or two, and a cover plate.  Outlet boxes come in various sizes and in plastic or metal.   Make sure you get one that fits the outlet.  In the U.S., an outlet-plug and light switch have the same mounting holes and fit into the same-size rectangular box.

You'll also need a power cord so that you can plug-in your relay box.   The easiest way is to pick-up an extension cord while you're at the hardware store, and whack-off the female end.  Or you can get some lamp cord and a plug, and make the power cord yourself.

As an alternative, you can get an AC outlet socket that you can install in your "project box".  But whenever it's practical, I like to use a separate high-voltage "relay box" and a separate low-voltage box for my regular low-voltage electronics (the Arduino, etc.).  (There has to be some low-voltage going into the relay box to turn the relay(s) on & off.)
724  Using Arduino / General Electronics / Re: How do professional engineers prototype using compact surface mount devices? on: October 15, 2012, 03:50:08 pm
Quote
How do professional engineers prototype using compact surface mount devices?  Obviously if you have a pick-and-place machine and a PCB it's no problem, but you are not going to set that up a prototype.
That's exactly what we do!   I work for a small electronics manufacturer.   All (almost all) of our PCB assembly is done by an outside contractor.    We don't do "breadboards".   We get a small quantity of bare PC boards fabraicated and send out a "kit" (usually 5 boards) to the assembly house where they have the pick-and-place and all of the other equipment to do it "right".

It's expensive and it's all part of the development cost/budget.  But in reality, it's probably not much more expensive than having an engineer or technician spend a week or two building a breadboard.  And, it's usually just not practical to build a breadboard.

If there are a few small changes or corrections, we can usually do "cuts & jumpers" in-house.  (An assembler does it, not the engineer.)

So far, I've been able to avoid surface mount on my home projects.  In fact, lately I've been building the permanent project on plug-in breadboards (whenever practical) to mimimize soldering at home.
725  Using Arduino / General Electronics / Re: Looking for switches... on: October 15, 2012, 03:06:05 pm
Quote
First, I need a 3-way switch, ON, OFF, AUTO.  I'm not sure how they work with adruino.
You can do that with a "center-off"(on-off-on) toggle switch  (example), or a rotary switch.  The toggle switch I linked to is a double-pole (6 connection) switch.  You can use a single-pole double-throw (3-connections) center-off switch, or ignore the 3 extra terminals on a double-throw switch.

You can find rotary switches with adjustable stops, so you can adjust the number of positions, in case you can't find the "right" 3-position rotary switch.

With a center-off switch, you can use two Arduino inputs and you'll have 3 states*...   Input "A" can be on, or input "B" can be on, or both inputs can be off.   You can use if-statements in your sketch to take different actions depending on the switch/input states.

This example shows you how to connect a switch an read the state.    Most likely, "on" will mean that you are grounding an input and reading zero.

Quote
I also am looking for a 2-way switch, ON and OFF.  Basically the same thing, I need to determine the position of the switch.
Any-old SPST (single-pole-single-throw) switch will work for that.


* With 2 inputs, there are actually 4 possible states.  But, with this type of switch, there is no way to turn-on both inputs at the same time.
726  Using Arduino / General Electronics / Re: LED's & Relay Boards on: October 11, 2012, 02:50:30 pm
Quote
Old School Programmer - ARGH ( COBOL ) - Yes I still pump blood, lol.

New to arduino & electronics and don't want to burn anything up...
smiley-grin I want to write a program, but I don't want to create any bugs... smiley-grin

Hardware errors aren't as common as software errors, which is an indication of how difficult programming is...    But sooner or later, you are going to hook-up something wrong, or backwards, and something bad is going to happen.  I'm an old-time hardware guy and it still happens to me once in awhile.

Be careful, and hopefully you won't burn-out your Arduino or your relay board.    When it comes to LEDs, resistors, capacitors, and cheap IC's or other cheap parts...  Buy extras! smiley-wink 
727  Using Arduino / General Electronics / Re: LOL - Exploded cap. on: October 11, 2012, 11:45:24 am
Quote
and as for why my computer died (power on, screen off) usb is not connected there's no shared link, it's isolated,
My guess is that the high-voltage arced back throught the power supply into your house-power, causing a power-line spike.
728  Using Arduino / Project Guidance / Re: Arduino VU meter using 240v lights. on: October 10, 2012, 07:37:49 pm
Well...   It would probably "work", but I wouldn't recommend mechanical relays in this application.   They are basically a mechanical switch controlled by an electromagnet and they don't "like" to be switched on & off many times a second. 

And, they will "click" or "chatter", which could be an issue....  Probably not a big issue if the music is really loud! smiley-wink

There are solid state relays that operate from less than 15mA.  I don't know if you'll find one you want to use, but for example  this one has in input resistance of 1000 Ohms, which means 5mA @ 5V.   But, it's more bulky and more expensive than the one you are planning on using.
729  Using Arduino / Project Guidance / Re: minimum temperature for electronics/mini-heater on: October 10, 2012, 05:52:43 pm
Most electronics will work fine around 0 degrees F.  The ATmega chip is rated to -40 degrees C*.   But, I wouldn't trust the "average" LCD, and batteries don't usually work "perfectly" when cold either.

A Mini-heater should be easy to build.   You can just use resistors (probably 2W resistors or bigger... 10W (or more) resistors are common too, so it wouldn't be hard to make a 100W heater..    All of the power dissipated in a resistor is converted to heat. 

The hard part is calculating how much power you need.   If you have a small insulated box, less than 10W will probably be enough...   You'll probably just have to experiment to see what kind of heat-rise you can get.   In case you don't know, you can calculate power (Watts) as Voltage squared divided by resistance.   (And, the power dissipated in parallel resistors simply sums-up.)  As a rule-of-thumb, you should use a resistor rated at twice the actual continuous-power.   

Since this thing is apparently battery powered, all of the power is going to come from your battery!   The heater is most-likely going to take more power than the circuit.   

Are you going to run the heater full-time, or will you have a temperaure sensor and turn it on only when needed? 


* WOW!  I just realized that -40 is an "interesting" number when converting between Fahrenheit and Centegrade!  smiley-grin
730  Using Arduino / Audio / Re: MSGEQ7 reading constant values on: October 10, 2012, 04:58:30 pm
Well... This is getting a bit more difficult.  At this point you might want to buy another MSGEQ7 chip to find-out if yours is bad or "blown".  (I rarely buy one of anything...  New components are almost never bad, but I like to have extras.)

There are 3 possibilities -
1. A bad component.   Since we know the Arduino is working, it could be the  MSGEQ7, or one (or more) of the resistors/capacitors connected to it.   Or, one of the resistors/capacitors is the wrong value.

2. The circuit is mis-wired, or there is an open (missing connection) or a short (wrong/unintended connection).   It looks like the schamatic matches the datasheet, so I don't think there is a [i[design[/i] problem.

3. There is a bug in the sketch.

I assume you don't have a mutimeter?    It might be a good idea to get one.   If electronics is going to be your hobby, you need a meter.    If you live in the U.S. you can order one from Jameco for about $10.  An oscilloscope would be really nice, but most of us don't have one at home.

And/or, you can make yourself a little probe with an LED & resistor and you can use that to check for the presence of voltage, or to see if a signal is high or low.   I actually built one into a meter probe with one LED for positive voltage and another for negative voltage.   Sometimes, it's more handy than an actual meter.

Once you have a way to check voltage, you can "probe around".    The first thing I'd want to check is the reset & strobe pulses.   But,  you'll have to put some delays (maybe 1 second) into the sketch to slow-down the signals so you can see the LED go on & off, and to have enough time to check the pulse-sequence.  (It also takes time for a meter to react.)

As an experiment, you might want to try adding a delay (maybe 1mS to start with) between the reset and strobe commands (I don't know how fast the Arduino writes or how fast the MSGEQ7 responds,and it might not have enough time to "settle".)  And, you can try increasing the 30uS delay (to something like 1mS).  If those delays make it work, you can experiment with shorter delays.
731  Using Arduino / LEDs and Multiplexing / Re: big led project on: October 10, 2012, 03:44:33 pm
Quote
the MOSFETS I could not find in the stores they had some IRF*** some numbers but all were 100v or more not too sure if I can use those if not...
The 100V rating is not a problem.  That's the maximum Drain-Source (output) voltage you can apply without risking damage.     

CrossRoads mentioned "Logic Level MOSFETS".    That relates to the Gate-Source (input) voltage.   Most MOSFETs require more than 5V at the gate to "turn on".  A logic-level MOSFET can be turned-on with the 5V signal out of the Arduino.


So for example, with a logic-level MOSFET you could use the 5V output from the Arduino to control 100V.   (But that would be getting a bit dangerous for the human... smiley-wink )

P.S.
Just a suggestion...  I'd "start small".   I assume you've already played around with resistors & LEDs connected directly to your Arduino.   Next, I'd try one regular-little LED with one MOSFET at 12 or 24V (with the appropriate current-limiting resistor on the LED).  Then replace the LED with the higher-power LED strip.   Once you know your basic design is working, you can build the other "channels".

You might just want to leave regular LEDs on the Arduino outputs along with the MOSFETS, at least during development, to help with troubleshooting & debugging in case something goes wrong. 
732  Using Arduino / Project Guidance / Re: Arduino VU meter using 240v lights. on: October 10, 2012, 02:05:17 pm
Quote
You may want to read the SSR's datasheet to make sure that it can be turned on / off that fast
The point is...  You simply cannot use analogWrite() or PWM with 50/60Hz AC and solid state relays.

This is not a dimming application anyway...  (You can get a "dim flash", depending on the programming.)    He will need to use digitalWrite() and hold the output on at least long enough for the filament to start glowing.

This is a Vu meter...  Typically, the lamps at the bottom of the meter are almost constantly-on and the top-lamp will only flash-on on during the loudest parts.  (The VU meter "effect" that I made also has a "dot mode" where there is only one lamp on at any time, and a "dots mode" where a random number of lamps indicate the volume.... just to keep things interesting.)
733  Using Arduino / Project Guidance / Re: Arduino VU meter using 240v lights. on: October 10, 2012, 12:39:45 pm
Quote
Yes, the pin Mode was OUTPUT.
And it was set to high yet still only 3 out of 4 of the Volt meters showed 5 volts.
Something "funny" is going on...   With only a voltmeter (or multiple voltmeters) attached, you should be able to turn on all of the pins.  Do you have "real" voltmeters?   Most of us don't have 4 multi-meters, and if we did we'd only be using one at a time to measure one output at at time.

Maybe you've got a bad Arduino (unlikely), or there's something wrong with your measurement, or your software (sketch).

With 15 solid state relays you are slightly exceeding the specs.   Your solid state relay requires 15mA.   The ATmega chip is spec'd for 40mA maximum per pin, but limited to a total of 200mA.   

So... To be perfectly reliable, you'd need to reduce the number of outputs to 13, use a different relay, or use a MOSFET (or something) in-between the Ardunio and the SSR.   But, if it was me....  I might just say 225mA is "close enough", and go for it!    If the Arduino burns-out, then I'd work on a better design, keeping everything in-spec.  smiley-razz

There's usually some safety-margin in the specs.  The relay might take a bit less than 15mA, and the Arduino might be able to source/sink slightly more than 200mA.  It's up to you if you want to risk it.

-----
There is no coil in a solid state relay...  Lefty is a bit confused.

There was also some previous discussion about switching  speed...   With an incandescant lamp, the limiting factor is how fast the element can heat-up and start to glow.     I don't know how long it takes, but it's somewhere between 1/10th of a second and 1 second to reach full-brightness...
734  Using Arduino / LEDs and Multiplexing / Re: Shift Registry Question on: October 09, 2012, 07:18:43 pm
It might be good to know what you mean by "pretty big LED".

The 74HC595 is a general-purpose logic device (not specifically for LEDs).   It has 8 outputs (for 8 LEDs), but it doesn't have built-in current limiting so you need a current-limiting resistor for each LED.  (You can get "resistor packs" with 8 resistors in one "device".

The WS2801 is a special-purpose LED driver chip.   It has 3 outputs for 3 LEDs or for one RGB (multi-color) LED.  It also has built-in current-limiting and built-in dimming features.

I can't tell you not to consider cost...   But, it's usually better to look for the best or easiest solution rather than the cheapest solution, especially when you are building a one-off gizmo.   If you are building & selling hundreds or thousands of an item it becomes really important to minimize cost.

Just to complicate things more for you... smiley-grin Maxim makes several constant-current LED drivers with up to 16 outputs.  But, I think they are more costly than what you're considering.   I'm using 6 of Maxim's 8-port LED drivers in my current project to drive 48 LEDs.   

735  Using Arduino / Audio / Re: Digital noise on my audio circuit on: October 09, 2012, 03:48:03 pm
You might need separate voltage regulators for the digital & analog circuits...  Depending on what kind of power supply you have, that might require a new/different power supply. smiley-sad

First, I'd just try a capacitor (1000uF or more) across the audio power supply.   A diode in series before the capacitor usually helps too.  The diode prevents the digital circuitry from discharging the capacitor...  The capacitor can only discharge into the audio circuit.  (The diode will lower the supply voltage by about 0.7V, so hopefully this isn't a problem for the SpeakJet chip.)     Another diode & capacitor on the digital/LED side may help too. 
Pages: 1 ... 47 48 [49] 50 51 ... 78