Just out of curiocity: if the problem is the current, could I potentially use 5v from the arduino and a transistor to amplify the current?
A transistor cannot 'amplify' current. It can however control higher current if wired to a voltage source that has more current capacity. So your problem is that the arduino can only supply a limited amount of +5vdc current for external stuff and servos are almost always needing more then can be reliably supplied by the arduino. There is no magic component of device that can allow an arduino to supply more 5V current they it presently can, that simply takes an external voltage source with a higher current capacity.
Thanks, that clears this, I had misunderstood the use of the transistor.
Have you provided the servo with its own power, as opposed to driving it from the Arduino 5v? That's a good place to start when faced with servo problems: check the power. That "real" servo may well be trying to draw more current than the "toy" one, and if you're powering it from the Arduino, it may not be getting enough. Best practice is to power servo from outside the Arduino.... if the Arduino can't supply enough current you have no choice anyway.
Aha! Yes, I have been powering the servo from the arduino, so that may be the issue. I think I'll be able to get my hands on some battery holders soon, I'll report back then. Thanks!
Just out of curiosity: if the problem is the current, could I potentially use 5v from the arduino and a transistor to amplify the current?
My pic below shows how to hook two servos up to their own power supply, if you don't already know this. Note that the external power's ground is hooked to the Arduino ground, else the control signal on the yellow has no reference 0V.
Thanks a lot. I have never made a project with external power supply so your advice about ground will come in handy. Just to clear things out: I need 6V and therefore 4AA batteries, right? The 2-battery holder is for demonstration, I guess?
I'm new to arduino and electronics and I am a little bit confused. I recently bought a starter kit and I've been playing around with a toy servo that came with it. In particular, it is a Hextronik HXT900 9GR servo. I include <Servo.h>, the library that comes with the arduino IDE and I have no problems with running simple code, like the following:
However, if I try to use any code, even a simple one like the above with a bunch of "Tower Pro MG90S" servos that I bought separately, I get a seemingly random behaviour. The servo moves for a little bit, then stops, then goes back and forth like crazy for a second or two, then makes clicking noises.. I tried several brand new MG90S's and it is the same "random" behaviour, wheras the HXT900 works fine.
Could you please give me any insight why this happens and if I can do anything about it?
Thanks a lot for the suggestions, that helps. I think I'm starting to understand a few things better now but I still have a couple of other questions:
First, I'm looking at the specifications of the 2 first shift registers you suggested but I don't understand too much: could you tell me if these are serial-in-parallel-out or parallel-in-serial-out? I understand the theory behind lfsr's but when it comes to the actual hardware I essentially know nothing..
The second thing that I wanted to ask is: is using an arduino for that an overkill? I mean, of course you can use an arduino to make a simple cirquit with only one led, but you could as well use some wire, a led, and a battery. Do we have a simlar case here? Could we just use a soldering board, a shift register, a few xor gates, a serial clock (ok, I have a question about that too), some leds, and a battery?
Lastly, I still don't think I understand the concept of clocking.. Do we always need to use a (quite too powerful for such a task, I guess) microcontroller like arduino? Are there any alternatives, like an actual component which is a clock of some sort? For instance in the following picture that I found somewhere, we see that the circuit is connected to a "clock". How could that be translated in real life?
I'm new to arduino (my first kit with uno arrives soon). I am definitely going to spend some time on implementing and modifying some starter projects from the web but I also had this idea that I would like to do.. I would really appreciate your feedback about this.
So I would like to implement a Linear Feedback Shift Register ("LFSR"). The definition from wikipedia is
In computing, a linear feedback shift register (LFSR) is a shift register whose input bit is a linear function of its previous state. http://en.wikipedia.org/wiki/LFSR
A definition that I found for a shift register is:
An n stage shift register is a circuit consisting of n consecutive 2 state storage units ( ip ops) regulated by a single clock. At each clock pulse, the state (1 or 0) of each memory stage is shifted to the next stage in line.
An LFSR, if designed properly, will produce a sequence of huge period with very good randomness properties (e.g. number of zeros ~ number of ones and other). LFSR's are used a lot for pseudorandom number generation (for instance, in cryptography).
A google search for "arduino lfsr" would give some results, but it is pretty much people who have done lfsr simulations, for instance this guy:
However, I would like to do the 'real thing', that is, not create code that simulates the lfsr, but create the circuit itself using a feedback shift register and perform xor operations on some bits of the current stage somehow and then feed the result back to the register. Each bit of the stage would correspond to a led that is on when the bit is 1 and off when the bit is 0.
I don't really have any use for that (although at my level everything contributes to learning!) and the only reason I want to build "the real thing" instead of a simulator is that I'm a math grad student, I have spent lots of my time on the pure abstract mathematics behind lfsr's and I never saw one of those damn things in my life! I want to see a real lfsr live!
So, do you think something like that would be easily implemented? Any hints as of how (and if) I should start planning? Also, what parts should I buy? Any recommendations of the specific parts? What kind of shift register should I buy?
Any feedback would be appreciated.. Many thanks in advance.