Show Posts
Pages: 1 ... 71 72 [73] 74 75 ... 91
1081  Forum 2005-2010 (read only) / Interfacing / Re: How can I limit current to my servos? on: July 24, 2010, 08:00:34 am
Well, here's some wire wound resistors I found which in theory could handle 1A at 4.8v:|0&FS=True

They're a little bigger than I'd like, but maybe I could fit a 1/2" resistor or two in there.
1082  Forum 2005-2010 (read only) / Interfacing / How can I limit current to my servos? on: July 24, 2010, 06:53:09 am
Hey guys,

You may recall that recently I was having an issue with my circuit where my leds would dim when my servos activated, and occasioanlly my atmega would reset because my batteries were unable to supply enough current.

One of the solutions I'd briefly considered was using a resistor to limit the current.  But at the time, I didn't explore this option further.  Well, I recently revisited it, and determined that at 4.8v, I was gonna need pretty large resistors if I was planning to feed 1A to my two servos, and resistors that can hande that much current seem hard to find on Mouser, and space is really limited with this project.  So I wondered is maybe there wasn't some other way to limit the current to the servos.

So I've been doing some research in that area, and it seems like it's possible to limit current using a diode or two, a resitor, and a transistor.  But I haven't been able to find a source which explains how to choose the right transistor, resistor, and diodes.  Because of this, I'm not even sure if this is a viable solution.

I really think I need to solve this problem by limiting the current to the servos rather than by using two voltage regulators and two batteries, because I need to fit like four chips, 8 dip switches, two trimpots, a bunch of molex connecotrs, and whatever resistors and capacitors I need on a board which is like 2"x4", and an extra voltage regulator and another ser of batteries is just gonna make things even tigther.  Plus I'm hoping to integrate a dac and an amp onto the board as well and I don't know if I'm gonna need a seperate power source for those, so I'm hoping I can at least power the rest of the board and servos with the one power source.

Maybe I don't even need a transistor though.  It might be that I have done my calculations on how much power my resistor needs to dissipate incorrectly.  It seems a bit odd to me that the lower the value in ohms I have for my resistor the bigger the resistor I need.  I mean I don't need a huge wire to conduct 1 amp, so why would I need a super large resistor?

Yet when I use the ohms law calculator:

...and input 4.8v and 1 amp, I get 4.8ohms for my resistor value.  And if I then put in 1 amp and 4.8 ohms I get 4.8 watts.  Does that mean I need a resistor that can handle 4.8 watts?  Or is that simply the watts flowing through it, and I need to do some other calculation to determine how much of that power it's actually dissipating as heat?  And how do I calculate that?
1083  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Pro Mini current sinking question on: July 21, 2010, 12:24:02 pm
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:

About halfway down the page:
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

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:

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.)
1084  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.
1085  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.


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.
1086  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.
1087  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:

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.
1088  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.
1089  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.
1090  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.
1091  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?
1092  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.
1093  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. :-)
1094  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.)

Well, I ment a binary time clock
No, you meant a binary-coded decimal 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  
1095  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?
Pages: 1 ... 71 72 [73] 74 75 ... 91