im pretty sure i have a million questions floating around here now lol.
my question/s is about supplying more power to the pwm (and the digital out's once i get them working).
i currently want/need 12 relays to switch on and off.
the problem is it seems there is only enough juice from the board to power 4 sometimes 5 on at the same time. they are rated at 5v, 106.4 mA each. (im guessing this is because (i think) usb output is limited to 500mA )
if i get a external power supply will this allow all the relays to work by allowing more power to be sent out of the pwm and digi outs (so not reaching the limit of 500ma from the usb)?
well no ideally i would like to be using the digital out's... but i cant seem to get them to work with max msp. (it's a mega and have no idea how i am going to get the digi's to work... i gave up and set the pwm's to 0 or 1.)
driver transistors? are you meaning the ... erm something like 2n2222 ?
i used these before (on a previous prototype) and they stopped the whole thing working!!!???? avr pins? (sorry im kind of new to arduino's and circuitry)
snubber diodes? ? er,..... ok well thing's are grounded well.
First, drivers. Unless the drive current for the relays is considerably less than 40mA you MUST use some sort of driver transistor for every pin / relay. There is probably a per-package current limit for the processor too.
Snubber diodes are used on inductive loads like relays to absorb the high voltage induced in the relay coil when the relay is switched off, and so prevent damage to the rest of your circuit.
before and it only allowed one relay to work (there was 4 separate 2n2222's)... without them in place (the 2n2222's) all four worked?!?
do i need the resistor in place before the transistor in the diagram?
also why does the diode bypass the coil? then go to the relay? i only want the arduino to power the switch coil. the current going through the gated part is from and external source and will not be going to or from the arduino.
thanks again for the help... at some point im sure all this electricity stuff will make alot more sense lol.
OK, the relay "spec" was pretty useless - it didn't give the coil resistance.
The resistor on the base of the transistor is to limit current.
The diode across the coil is the snubber diode.
It doesn't bypass the coil, it is there to absorb the back EMF when you turn the relay off. When operating, the coil prodces a magnetic field which operates the relay contacts. When power is removed, the field collapses and induces a current in the coil in the reverse direction (back EMF) which could damage the circuit. The diode absorbs the spike.
I don't know why your circuit with transistors didn't work, but I certainly don't recommend trying to power a relay directly off the AVR, so I suggest you persist.
ok this may be because it's so early... but...
looking at this:
do i need an additional 5v supply for the relays? ? ?
so the wiring should run 5v supply > relay (diode around the relay) > transistor > ground (arduino) and from the arduino > resistor > transistor > ground (arduino)
so it could be considered 2 separate flows?
i'm guessing that the transistor is like a mini relay? is this correct?
and the diode just stops a surge of power the wrong way?
the resistor's just ... erm.... resist ... or regulate the amps going to the transistor?
i need to go do some stuff today but when i get back i will make a circuit diagram and post it. lol... better than my explanation.
also if someone could let me know what sort of resistors and transistors and diodes i need it would be great!
will this work? (i should also mention that there will be 12 relays (coil activation at 5v 100 (and something)mA, but i only put 2 in diagram for reasons of laziness )
it's a bc183 transistor, with a 200 resistor (so it should limit to 200 mA right?) and the grounds are sent to the negative on the dc supply for the relay coils? (creating a loop) i would rather they went to that than the arduino.
the 200 means 200 ohms, so no its does NOT necessarily mean it will limit things to 200MA. Which, by the way would be 4 times the current that an Arduino pin can provide - meaning it will blow out the Arduino!
the formula for calculating the base current limiting resistor (which is what that is) is as follows:
R (in Kilohms) = (5-.7) / 30ma
R = 4.7 / 30
R = .156 Kilohoms, which is 156 ohms. You can use the next larger standard size of 220 ohms to safely provide current limiting.
With 220 ohms, the current from the Arduino pin would be:
I (in milliamps) = (5-.7) / .22K
I = 4.7 / .22
I = 22 milliamps
Twelve relays driven with this transistor circuit would then draw
I (total in milliamps) = 12 * 22
I (total) = 256 milliamps - which can be safely drawn from the USB port alone. BUT since the total current will be that PLUS the current needed to actually power the relays themselves, you are UNLIKELY to be able to power all that from the USB port. Thus you should use an external 5V support for the relays.
By the way, I always push my students on this point - get in the habit of drawing and sharing COMPLETE schematics rather than excepts or snippets. Until you are more experienced with this you are likely to accidentally leave out an important detail!
On your most recent post you gave a partial schematic. On that one, the 200 resistors can be 200 ohms or as calculated above 220 ohms.
BUT you need to connect the - side of that 5V supply to the Arduino's ground to make the circuit actually work.
will grounding the extra to the arduino mess it up?
or should i have it as in diagram and send the ground's from the transistors to the dc power supply (for the coils) AND the arduino? (im worried it will melt it or keep tripping the saftey on the laptop (or will it just take all the extra through usb? im guessing it would be best to ground it to the one for the power on the board)
once again thanks alot for all this help
im thinking of etching it as soon as i can get the parts and will post pic's up