Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Interfacing / Re: 12 Servo's, Arduino and external power won't work on: October 21, 2010, 10:44:31 am
I made a custom power supply from an old atx pc supply.
Result is all 12 servo's working at once smiley

Thanks for the info.

(And my topic can be moved to the 'hardware' interfacing if possible, i noticed it today that i misplaced it in the software section smiley-wink )
2  Forum 2005-2010 (read only) / Interfacing / Re: 12 Servo's, Arduino and external power won't work on: October 14, 2010, 04:04:43 pm
Ok cool thanks for the information, i will try this too.

Those batteries arn't that expensive on ebay so i could give it a try, in the meantime i will search the secondhand shop for some other ac-dc adapters with some more current.
3  Forum 2005-2010 (read only) / Interfacing / Re: 12 Servo's, Arduino and external power won't work on: October 14, 2010, 12:44:17 pm
Very cool bot vinceherman!

What is the type of servo you used? I can search for the details myself then.

And how did you connect the servo's to the shield, are there any resistors and/or capacitors on the shield? And what was the mAh of the battery used?? smiley  ;D
4  Forum 2005-2010 (read only) / Interfacing / Re: 12 Servo's, Arduino and external power won't work on: October 14, 2010, 12:08:24 pm
Korman, thanks for your input, but it's not correct; i quote from the arduino servo lib:
Quote
Note that as of Arduino 0017, the Arduino Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega.
so driving them all shouldn't be a problem.. and atm i can't even drive four at once smiley-razz wish i could do 6 smiley
5  Forum 2005-2010 (read only) / Interfacing / Re: 12 Servo's, Arduino and external power won't work on: October 14, 2010, 10:47:23 am
I will read about this de-coupling (don't know what it is yet) thanks.


Some more details about the servo:

Control System: +Pulse Width Control 1500usec Neutral
Required Pulse: 3-5 Volt Peak to Peak Square Wave
Operating Voltage: 4.8-7.2 Volts
Operating Temperature Range: -20 to +60 Degree C
Operating Speed (4.8V): 0.20sec/60 degrees
Operating Speed (6.0V): 0.19sec/60 degrees
Stall Torque (4.8V): 9kg.cm
Stall Torque (6.0V): 11kg.cm
Operating Angle: 45 Deg. one side pulse traveling 400usec
360 Modifiable: Yes
Direction: Clockwise/Pulse Traveling 1500 to 1900usec
Current Drain (4.8V): 8.8mA/idle and 350mA no load operating
Current Drain (6.0V): 9.1mA/idle and 450mA no load operating

And i'm building a robot, so all servo's could be used at one time - i'm even planning on placing more servo's so the solution should be scalable smiley
6  Forum 2005-2010 (read only) / Interfacing / 12 Servo's, Arduino and external power won't work on: October 14, 2010, 10:27:19 am
Hi,

Currently i've got 12 servo's connected to a v4 sensor shield that i modded to have it's own powersupply since the arduino can't even handle one servo without resetting..

But i bought several powersupplys to get the whole thing running.. and all i got so far is three servo's at once with a 5v 800mah adapter.. so i figured that going to a more powerfull adaptor would help.
So i bought a 5v 2A adapter, but now it's the same as running the servo's from the arduino.. only one can try to start but the whole thing shuts down..

So i figured that i'm missing something, but what? I use the same servo's as this guy ( http://letsmakerobots.com/node/2423 ) and he got 12 running with Atmega chips.. but i can't figure out what the difference is between my setup and his.

They are talking about h-bridges and mosfet's .. but on this forum nobody is using them to run more servo's..

So i would really appreciate it if somebody can give me some hints on this smiley  8-)
7  Forum 2005-2010 (read only) / Interfacing / Re: Multiple Servo? on: October 21, 2010, 10:52:32 am
i more or less meant that if the shield (plugged on top of my arduino) got on fire my arduino would also be damaged smiley-razz
8  Forum 2005-2010 (read only) / Interfacing / Re: Multiple Servo? on: October 21, 2010, 10:38:33 am
Today i managed to get 12 servo's working at once (with a custom shield), total of 6A current with a single ATX power supply.
Made a video of it:



Lot's of smoke (almost fire) with the first protoype shield i made..
so be carefull, 6A is a lot of current that can burn your arduino easily.
9  Forum 2005-2010 (read only) / Interfacing / Re: Multiple Servo? on: October 21, 2010, 01:34:19 am
With 5v 1A you will probably get only one working.
AFAIK those servo's draw around 600mah on (heavy) load.
That is 1.8A when all three are busy..

And those wallsocket AC/DC adapters usually have a great voltage droppage when you pull this much Ampere.
So ONE servo will probably work, and with two both will probably try to work and stop/reset all the time because of the voltage drop.

The cheapest way to get those bastards running is using some battery (nimh or lipo) that can handle those Amp. surges.
Or you should buy some decent power supply like a 'lab power supply' that can handle 2A+ but those things are expensive (but they will also be your best friend for life).

What i'm trying atm. (to get 12 servo's running: 6A) is modding an old ATX PC Powersupply that has 3.3v 5v and 12v output. THe 5v output can draw up to 21A (!!). Check out this link for a HOWTO:
http://www.wikihow.com/Convert-a-Computer-ATX-Power-Supply-to-a-Lab-Power-Supply


edit: i see that you're trying to get 5 of them running, that is 3A, so a lab power supply, battery or the atx mod is your only answer. 5 on a wallsocket dc adapter will never work.

Only (maybe) an 15v 1A wall adapter and by putting a (5v or 6v 1A+) voltregulator before each servo, but things will get pretty hot and it will consume lots of wattage.
10  Forum 2005-2010 (read only) / Interfacing / Re: Servo help? on: October 21, 2010, 01:49:37 pm
For one i know that the mg995 will not work without external power supply.
But if you are going to use an external power supply, all servo's will work, and there is never any special shield needed. Shields will only make your connecting life easier.

11  Forum 2005-2010 (read only) / Interfacing / Re: arduino + sensor shield + servo + atx power supply on: October 22, 2010, 11:03:12 am
I managed to do this recently with 12 servo's



But i would strongly suggest not to use the sensor shield, the 5v paths on the board are way to thin for the ampere's your going to surge.

I made a shield myself with only the GRND connected to the arduino and thick threads to some female connectors that lead to the atx power supply.
For my first test i did use a sensor shield, and it smoked/burned the little paths on the board..

For the ATX supply i would suggest following this guide:
http://www.wikihow.com/Convert-a-Computer-ATX-Power-Supply-to-a-Lab-Power-Supply

12  Forum 2005-2010 (read only) / Interfacing / Re: Easy Wireless Communication on: October 21, 2010, 01:57:53 pm
you could always use the chinese knockoff that is cheaper smiley

http://cgi.ebay.nl/Arduino-Wireless-RF-Transmit-APC220-Kits-USB-Converter-/160494901106
13  Forum 2005-2010 (read only) / Exhibition / Re: Arduino Pong on: September 04, 2010, 04:36:19 pm
i made a version with the use of three buttons that can be made from some foil; check the playground for more info; you will need this library:
http://www.arduino.cc/playground/Main/CapSense

code:
(only one control for both paddles; need to upgrade the code if you want two independent controls)

Code:
#include <TVout.h>
#include <CapSense.h>

#define PADDLE_HEIGHT 12
#define PADDLE_WIDTH 2

#define RIGHT_PADDLE_X (TV.horz_res()-4)
#define LEFT_PADDLE_X 2

#define IN_GAME 0 //in game state
#define IN_MENU 1 //in menu state
#define GAME_OVER 2 //game over state

#define LEFT_SCORE_X (TV.horz_res()/2-15)
#define RIGHT_SCORE_X (TV.horz_res()/2+10)
#define SCORE_Y 4

#define MAX_Y_VELOCITY 3
#define PLAY_TO 7

#define LEFT 0
#define RIGHT 1

CapSense rightButton = CapSense(5,4);        // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired
CapSense leftButton = CapSense(5,3);        // 10M resistor between pins 4 & 6, pin 6 is sensor pin, add a wire and or foil
CapSense startButton = CapSense(5,2);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil

TVout TV;
unsigned char x,y;

boolean buttonStatus = false;

int wheelOnePosition = 0;
int wheelTwoPosition = 0;
int rightPaddleY = 0;
int leftPaddleY = 0;

unsigned char ballX = 0;
unsigned char ballY = 0;
char ballVolX = 1;
char ballVolY = 1;

int leftPlayerScore = 0;
int rightPlayerScore = 0;

int frame = 0;
int state = IN_MENU;

int basicInput = 50;

void processInputs() {
  long total1 =  startButton.capSense(30);
  if(total1 > basicInput) {
    buttonStatus = true;
  } else {
    buttonStatus = false;
  }
  
  long total2 =  leftButton.capSense(30);
  long total3 =  rightButton.capSense(30);

  if(total2 > basicInput) {
    wheelOnePosition = wheelOnePosition + 3;
    wheelTwoPosition = wheelTwoPosition + 3;
  }

  if(total3 > basicInput) {
    wheelOnePosition = wheelOnePosition - 3;
    wheelTwoPosition = wheelTwoPosition - 3;
  }

leftPaddleY = wheelOnePosition;
if(leftPaddleY < 0) {
  wheelOnePosition = leftPaddleY = 0;
}
if(leftPaddleY > TV.vert_res()-PADDLE_HEIGHT) {
  wheelOnePosition = leftPaddleY = TV.vert_res()-PADDLE_HEIGHT;
}

rightPaddleY = wheelTwoPosition;
if(rightPaddleY < 0) {
  wheelTwoPosition = rightPaddleY = 0;
}
if(rightPaddleY > TV.vert_res()-PADDLE_HEIGHT) {
  wheelTwoPosition = rightPaddleY = TV.vert_res()-PADDLE_HEIGHT;
}


    Serial.print(total1);                  // print sensor output 1
    Serial.print("\t");
    Serial.print(total2);                  // print sensor output 2
    Serial.print("\t");
    Serial.println(total3);                // print sensor output 3

}

void drawGameScreen() {
  TV.clear_screen();
  //draw right paddle
  //rightPaddleY = ((wheelOnePosition / 8) * (TV.vert_res()-PADDLE_HEIGHT))/ 128;
  x = RIGHT_PADDLE_X;
  for(int i=0; i<PADDLE_WIDTH; i++) {
    TV.draw_line(x+i,rightPaddleY,x+i,rightPaddleY+PADDLE_HEIGHT,1);
  }

  //draw left paddle
//  leftPaddleY = ((wheelTwoPosition / 8) * (TV.vert_res()-PADDLE_HEIGHT))/ 128;
  x = LEFT_PADDLE_X;
  for(int i=0; i<PADDLE_WIDTH; i++) {
    TV.draw_line(x+i,leftPaddleY,x+i,leftPaddleY+PADDLE_HEIGHT,1);
  }

  //draw score
  TV.print_char(LEFT_SCORE_X,SCORE_Y,'0'+leftPlayerScore);
  TV.print_char(RIGHT_SCORE_X,SCORE_Y,'0'+rightPlayerScore);

  //draw net
  for(int i=1; i<TV.vert_res() - 4; i+=6) {
    TV.draw_line(TV.horz_res()/2,i,TV.horz_res()/2,i+3, 1);
  }

  //draw ball
  TV.set_pixel(ballX, ballY, 2);
}

//player == LEFT or RIGHT
void playerScored(byte player) {
  if(player == LEFT) leftPlayerScore++;
  if(player == RIGHT) rightPlayerScore++;

  //check for win
  if(leftPlayerScore == PLAY_TO || rightPlayerScore == PLAY_TO) {
    state = GAME_OVER;
  }

  ballVolX = -ballVolX;
}

void drawMenu() {
  x = 0;
  y = 0;
  char volX = 1;
  char volY = 1;
  TV.clear_screen();
  TV.select_font(_8X8);
  TV.print_str(10, 5, "Arduino Pong");
  TV.select_font(_5X7);
  TV.print_str(22, 35, "Press Button");
  TV.print_str(50, 45, "To Start");
  delay(1000);
  while(!buttonStatus) {
    processInputs();
    TV.delay_frame(3);
    if(x + volX < 1 || x + volX > TV.horz_res() - 1) volX = -volX;
    if(y + volY < 1 || y + volY > TV.vert_res() - 1) volY = -volY;
    if(TV.get_pixel(x + volX, y + volY)) {
      TV.set_pixel(x + volX, y + volY, 0);

      if(TV.get_pixel(x + volX, y - volY) == 0) {
        volY = -volY;
      }
      else if(TV.get_pixel(x - volX, y + volY) == 0) {
        volX = -volX;
      }
      else {
        volX = -volX;
        volY = -volY;
      }
    }
    TV.set_pixel(x, y, 0);
    x += volX;
    y += volY;
    TV.set_pixel(x, y, 1);
  }
  TV.select_font(_5X7);
  state = IN_GAME;
}

void setup() {
  Serial.begin(9600);
  x=0;
  y=0;
  TV.start_render(_PAL);//for devices with only 1k sram(m168) use TV.begin(_NTSC,128,56)

  ballX = TV.horz_res() / 2;
  ballY = TV.vert_res() / 2;
}

void loop() {
  processInputs();

  if(state == IN_MENU) {
    drawMenu();
  }
  if(state == IN_GAME) {
    if(frame % 3 == 0) { //every third frame
      ballX += ballVolX;
      ballY += ballVolY;

      if(ballY <= 1 || ballY >= TV.vert_res()-1) ballVolY = -ballVolY;
      if(ballVolX < 0 && ballX == LEFT_PADDLE_X+PADDLE_WIDTH-1 && ballY >= leftPaddleY && ballY <= leftPaddleY + PADDLE_HEIGHT) {
        ballVolX = -ballVolX;
        ballVolY += 2 * ((ballY - leftPaddleY) - (PADDLE_HEIGHT / 2)) / (PADDLE_HEIGHT / 2);
      }
      if(ballVolX > 0 && ballX == RIGHT_PADDLE_X && ballY >= rightPaddleY && ballY <= rightPaddleY + PADDLE_HEIGHT) {
        ballVolX = -ballVolX;
        ballVolY += 2 * ((ballY - rightPaddleY) - (PADDLE_HEIGHT / 2)) / (PADDLE_HEIGHT / 2);
      }

      //limit vertical speed
      if(ballVolY > MAX_Y_VELOCITY) ballVolY = MAX_Y_VELOCITY;
      if(ballVolY < -MAX_Y_VELOCITY) ballVolY = -MAX_Y_VELOCITY;

      if(ballX <= 1) {
        playerScored(RIGHT);
      }
      if(ballX >= TV.horz_res() - 1) {
        playerScored(LEFT);
      }
    }
    if(buttonStatus) Serial.println((int)ballVolX);

    drawGameScreen();
  }
  if(state == GAME_OVER) {
    drawGameScreen();
    TV.select_font(_8X8);
    TV.print_str(29,25,"GAME");
    TV.print_str(68,25,"OVER");
    while(!buttonStatus) {
      processInputs();
      delay(50);
    }
    TV.select_font(_5X7); //reset the font
    //reset the scores
    leftPlayerScore = 0;
    rightPlayerScore = 0;
    state = IN_MENU;
  }

  TV.delay_frame(1);
  if(++frame == 60) frame = 0; //increment and/or reset frame counter
}

pic:
14  Forum 2005-2010 (read only) / Exhibition / Re: Poorman's 4x4 LED Matrix 74HC4094 on: September 04, 2010, 09:08:02 am
I based my fonts on this:

http://cooltext.com/Download-Font-Pixel+4x4

It was the only 4x4 font example i could find, too bad 4x4 can't make all letters really readable tho, 8x8 would be better.

I probably will create a bigger one (8x8) when i received all my parts (more shifters etc..)
15  Forum 2005-2010 (read only) / Exhibition / Re: Poorman's 4x4 LED Matrix 74HC4094 on: September 02, 2010, 03:15:15 am
More info can be found here:

youtube:


code & extra info:
http://blog.mizusoft.com/?p=52002&code=agptaXp1c29mdDA3cg0LEgVFbnRyeRiilgMM
Pages: [1] 2