Show Posts
Pages: 1 ... 66 67 [68] 69 70 ... 86
1006  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Pro Mini current sinking question on: July 21, 2010, 12:24:02 pm
Quote
Please forgive my ignorance in most things hardware, I'm still taking university classes and specialize mostly in software. Anywho, I am direct driving 6 RGB Leds so I need to sink a maximum of 20mA*3 (common cathode RGB LEDs and 20mA per anode)*6 LEDs for a total maximum of 360mA of current. Keep in mind that is assuming I run them at their peak of 20mA per annode.

You won't be able to drive your 6 leds with 360mA of current.  The Arduino can't put out that much.

See this thread:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1277961099/10

About halfway down the page:
Quote
You can source or sink a maximum of 40mA from each pin.

You can source a maximum of:
150mA total from D0-D4 & A0-A5
150mA total from D5-D13

You can sink a maximum of:
100mA total in D0-D4
100mA total in D5-D13
100mA total in A0-A5

And:
Vcc can source a max of 200mA
Gnd can sink a max of 200mA.

So, 40mA from a pin is the best case scenario, but if you're sourcing current from all the analog pins, then you'd better not be sourcing more than 25mA from each pin, and even less than that if you're also sourcing current from digital pins 0..4 at the same time.

And overall for the whole board, you can't source more than 200mA.

Note, those are absolute maximums.  And as Grumpymike said, you have to subtract the mA needed by the processor from the max.  So the absolute maximum for the whole board to source to any external components is 150mA.

But that doesn't take into account what the onboard voltage regbulator can handle:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1277880350
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1276895551

This will vary according to how much voltage you feed it.  In this case, I'm feeding it 9v, which left me with around 60-100mA to play with rather than the 150mA which the AtMega could potentially supply with a better voltage regulator.  Feed it with exactly 5v and you can get that 150mA.  But no more.

So to feed your leds with 360mA, you're gonna have to power them directly rather than through the Arduino's pins.  You'll need transistors, or a darlington array.  (Which you could pair with a high power shift register if you wanted to drive an array of leds.)
1007  Forum 2005-2010 (read only) / Interfacing / Re: Distance without line of sight? on: July 12, 2010, 09:24:23 pm
Okay, so the problem is walls block the signal.  

So I guess the question is, what sort of signal won't the walls block?

Hm... :/

How about neutrinos?  Neutrinos interact very weakly with matter.  

All you need to do is fit each robot with a tank holding several tons of heavy water to detect the neutrinos, and place them a couple miles underground to avoid neutrinos from other sources interfering with your readings.

Oh, and you'll need to fit each robot with a nuclear reactor to generate the neutrinos.
1008  Forum 2005-2010 (read only) / Interfacing / Re: Distance without line of sight? on: July 12, 2010, 09:08:38 pm
How about using wifi and triangulation?

Each robot transmits a wifi signal, and each has two directional antennas which can rotate and are seperated by some distance.

Once you've found the direction in which the signal is strongest for each antenna, you have two angles and the length of one side of a triangle and with that you can calculate the distance to the object in question.

[edit]

Of course if you are indoors this may not work because it's possible the radio waves will bounce off walls and give you an incorrect direction.
1009  Forum 2005-2010 (read only) / Interfacing / Re: Using Servos in Arduino 0018: twitch when attached on: July 12, 2010, 12:50:23 am
I have the same issue with my servos twitching when I apply power to them.  I tried adding a pulldown, but that didn't do anything.

I did a test just now to see what would happen if I applied power to my servos without the Arduino supplying position data though, and the result was interesting.

If I disconnect and reconnect the power, the servos twitch.  In fact, not only do they twitch... one of them will actually rotate a significant amount if I apply and remove power over and over.  The other will remain in place and simply twitch.  (Same brand, same type of servo.)

It may be when starting up the twitch is due to there being no signal for the servos.  I'm not sure of any good fix for this though.  One would have to switch the power to the servos on after one's sketch is running I suppose.

But... I just did another test with the sketch running and I applied power to the servos, and they still twitch.  Though they don't lose position.  And they seem to twitch less.

Anyway... it seems possible there may be no software solution for servo twitching on power up.  And there may be no easy hardware fix either.
1010  Forum 2005-2010 (read only) / Interfacing / Re: Can anyone recommend a piezo from mouser? on: July 08, 2010, 09:59:01 pm
Anything under Piezo Audio Transducers here would be fine:
http://ph.mouser.com/catalog/catalogUSD/641/1825.pdf

The difference between them is their resonant frequency.  Ie, the frequency they're loudest and and reproduce best.

If you plan on playing music, you might want a large one, because music frequencies are very low.

You might even get away with one of the electromechanical ones on that page.  The one in Figure I only requires 10mA for example.  

Any of these you'll need a current limiting resistor on btw.  Don't just hook em up to the pin like in the examples.  GumpyMike says piezos act like capactitors and will draw a lot of current all at once.  I stuck a 1K resistor on mine to limit it to 5mA, though you could get away with a much smaller resistor than that.
1011  Forum 2005-2010 (read only) / Interfacing / Re: reading switch states into an array on: July 05, 2010, 09:49:42 pm
Well, you could do something like this:

if ((my_switchstates[0] | my_switchstates[1]<<1 | my_switchstates[2]<< 2 | my_switchstates[3]<< 3) == b0101) { blah(); }

That basically shifts the binary 1 that indicates each switch it set varying amounts to the left, then combines them into a single byte, which you can then compare with another byte to see if the bits that are set are the same.  The b before the number on the right specfies it is in binary.
1012  Forum 2005-2010 (read only) / Interfacing / Re: Green LED on Pin 13 blinks once on boot on: July 05, 2010, 06:28:51 pm
The cathode of the led is connected to pin 13 via a darlington array.  So pin 13 goes high, and that pulls the cathode low.

The anode of the led is connected to pin 1, ie: TX.

So if I had to guess, I'd say the Arduino is attempting to transmit at the same time as it's blinking the green LED.
1013  Forum 2005-2010 (read only) / Interfacing / Re: Green LED on Pin 13 blinks once on boot on: July 05, 2010, 02:44:21 am
It's not the LED which is on the board which is the issue, it's an LED on my display which is the issue.

I guess modifying the bootloader is my only option.
1014  Forum 2005-2010 (read only) / Interfacing / Green LED on Pin 13 blinks once on boot on: July 04, 2010, 08:55:31 pm
Is there any way to disable this, short of overwriting the bootloader?
1015  Forum 2005-2010 (read only) / Interfacing / Re: Best multiplexer on: July 06, 2010, 01:10:06 am
Your typical keyboard doesn't have all the keys set up as individual inputs.  

What it does have is the keys laid out on a grid, and when connectivity is made between a particular row and column, you know that a particular key has been pressed.  Thus with just three shift registers, one on the rows, and two on the colums, you can read up to 128 keys.

Of course, this layout means that you can get into keylock where pressing certain keys together results in some keys going undetected, but if you lay out your keyboard carefully so keys which are often pressed together don't conflict with one another, then you can get it to where it's not an issue.
1016  Forum 2005-2010 (read only) / Interfacing / Re: I am tearing my heir out over MIDI! on: July 05, 2010, 02:51:37 am
I don't know anything about midi, so I can't help you here but...  I'm guessing english is your second language. :-)

http://en.wikipedia.org/wiki/Heir
http://en.wikipedia.org/wiki/Hair
1017  Forum 2005-2010 (read only) / Interfacing / Re: Mutiplexing or Shift Registers? on: July 01, 2010, 11:02:30 pm
The multiplexed version will be both easier to code, and easier to build.  

Multiplexing your leds simply requires you to set pins high and low to select the digit and the leds in it you want to light.

Doing the same thing with shift registers would require three additional ICs and bypass capacitors to control your 21 leds.  And depending on what type of shift register you use you may not end up with leds that are any brighter than what you'll get with multiplexing.

To multiplex the display, wire all the leds for each digit up so all the cathodes are connected, and then connect that common cathode to a pin on the Arduino.  If you have six digits, that's six pins.

Once you have that done, you need to wire the anodes up.  For each digit, you're gonna have leds 0..3 represeting the different bits.  Take all the anodes for led 0 in each digit and wire those together.  Then connect them to a pin on the Arduino via a resistor that is sized to power a single led of the type in your display.  Do the same for the other 3 leds.  This will take 4 pins.  (Google led wizard to find the resistor size you need.  Input the higher of the two forward voltages in the led data sheet, 5v source, and 20mA or less.)

Then in your code:
1) Loop through your digits one by one.
2) Set all anode pins low. (So when you select the next digit, none of the leds are already on before you select the ones you really want.)
3) Set all cathode pins high _except_ for the one for the digit you want to light.  
4) Set the anode pins high for the leds in that digit which you want to light.
5) Pause for some period of time.  Since you want to update your display at 60hz, you don't want to spend more than 1000ms / 60hz / 6digits = 2.7 milliseconds or 2700 microseconds, on each digit.  So delay(2) will be fine.

And that's it.  Except for your am/pm led.  You can just wire that up to another pin with the same size resistor as the others going to ground.

Total: 10 pins to display 6 binary numbers, plus one pin to turn on on the am-pm indiciator. 11 pins in total.  

(And if you want to get clever, you could wire the am/pm led up so that it behaves as one of the bits in one of your digits which doesn't require all four bits, like the tens portion of the hour display, which will save you a pin.)


Quote
Well, I ment a binary time clock
Quote
No, you meant a binary-coded decimal clock.

http://en.wikipedia.org/wiki/Binary_clock

You're both right.  Either type can be referred to as a binary clock.


Btw I would never have dreamed of building anything like this when I was 12!  

When I was 12, after burning out all the ics in my electronics kit because I didn't understand anything about how electricity flowed in a circuit, I wired up the two transformers in such a way that they melted and then my mom took away the kit. ;D  
1018  Forum 2005-2010 (read only) / Interfacing / Re: 20K pullups needed with ATMega? on: July 01, 2010, 07:15:04 pm
When I said and for Vcc, I meant how many mA can I safely put through the Vcc pin?  80% of 200mA?  So 160mA roughly?
1019  Forum 2005-2010 (read only) / Interfacing / Re: 20K pullups needed with ATMega? on: July 01, 2010, 02:54:40 am
Yes, thanks for pointing that out.  I know that these are maximums and you should stay below them, but I probably should have mentioned that.

What would you reccomend one use as an effective maximum though, for the outputs, and for vcc?  And would you reccomend one assume the ATMega itself will be pulling 50mA through vcc just to run at 16mhz?  Or something less than that?


Trying to figure out how much I can realistically run through my led array now that I've taken the weak voltage regulator on the pro mini out of the equation.
1020  Forum 2005-2010 (read only) / Interfacing / Re: 20K pullups needed with ATMega? on: July 01, 2010, 01:49:49 am
Okay, well, in that case, it looks like:

You can source or sink a maximum of 40mA from each pin.

You can source a maximum of:
150mA total from D0-D4 & A0-A5
150mA total from D5-D13

You can sink a maximum of:
100mA total in D0-D4
100mA total in D5-D13
100mA total in A0-A5

And:
Vcc can source a max of 200mA
Gnd can sink a max of 200mA.

So, 40mA from a pin is the best case scenario, but if you're sourcing current from all the analog pins, then you'd better not be sourcing more than 25mA from each pin, and even less than that if you're also sourcing current from digital pins 0..4 at the same time.

And overall for the whole board, you can't source more than 200mA.


So complicated. :-)
Pages: 1 ... 66 67 [68] 69 70 ... 86