Show Posts
Pages: [1] 2
1  Community / Exhibition / Gallery / My New Robot- GreaseBot Mk I(pics) on: March 03, 2011, 01:53:10 am
Hello,

I just finished building my robot.Here are some pics

It uses an arduino Uno,l293 motor driver and 2 12v 100 rpm dc gear motors and a Sharp Ir rangefinder GP2D12 mounted on a servo as its sensor.
It works pretty well for now, but i have to iron out a few kinks.It definitely does not compare to some of you bots
but i think its pretty good for a kid smiley-grin
Ill upload a video later today.
 Please ignore the crapiness of the construction, most of it is held together
with masking tape and prayers  :-[ . I have the breadboard on a box because inside the box there is the battery
I wanted the the center of gravity to be in the middle of the robot as much as possible so that both wheels had
equal traction and it moved more or less straight(all the heavy parts are more or less in the center).
Please tell me what you think.
Enjoy the pics ;D(sorry for crappy pics)





2  Using Arduino / Sensors / Sharp IR problem on: March 01, 2011, 07:15:24 am
Hello,

I just recently finished building my robot, it has a sharp IR gp2d12 sensor on a servo for basic obstacle avoidance,
I'm using an arduino uno and l293d motor driver.
It worked beautifully(relatively, remember this is my first bot!!) for a while and then it seemed to detect obstacles all
the time, it never went straight.
It seems to stop working after the unplug the battery, I have 2 power supplies a 12 900mAh NiCd for the motors and
a 9V battery for the arduino (i haven't forgotten common ground, I checked  ;D)

It seems to work fine for sometime and then goes completely haywire, this has happened 3-4 times, each time i reloaded the code smiley-sad

Does anyone know whats wrong or what im doing wrong, tell me if you need picks of my setup.

Is this a hardware or software problem??. It gives weird readings like 30cm,14cm etc (i powered the uno thoguht the usb and saw the readings via serial) even when when i tilt it towards the ceiling and there is no object to be seen .



here is the code I'm using



Basically whats its supposed to do is move straight until it finds an object, then it stops and scans 90 degrees to its left and right and then moves in the direction of greatest object distance.



Code:
#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo

int motor_left[] = {2, 3};
int motor_right[] = {7, 6};
int IRpin=0 ;
        
void setup()
{
 myservo.attach(9);// attaches the servo on pin 9 to the servo object
 // Setup motors
 int i;
 for(i = 0; i < 2; i++)
 {
  pinMode(motor_left[i], OUTPUT);
  pinMode(motor_right[i], OUTPUT);  
  }
}
 

void loop()
{
 myservo.write(90);
 delay(250);
 int sharpir=getsharpdata();
 drive_forward();
 
 if(sharpir<20)
 {
  
   servo_scan();
 }
 
}

// --------------------------------------------------------------------------- Drive

void motor_stop()
{
 digitalWrite(motor_left[0], LOW);
 digitalWrite(motor_left[1], LOW);

 digitalWrite(motor_right[0], LOW);
 digitalWrite(motor_right[1], LOW);
 delay(250);
}

void drive_forward()
{
 digitalWrite(motor_left[0], HIGH);
 digitalWrite(motor_left[1], LOW);

 digitalWrite(motor_right[0], HIGH);
 digitalWrite(motor_right[1], LOW);
}

void drive_backward()
{
 digitalWrite(motor_left[0], LOW);
 digitalWrite(motor_left[1], HIGH);

 digitalWrite(motor_right[0], LOW);
 digitalWrite(motor_right[1], HIGH);
}

void turn_left()
{
 digitalWrite(motor_left[0], LOW);
 digitalWrite(motor_left[1], HIGH);

 digitalWrite(motor_right[0], HIGH);
 digitalWrite(motor_right[1], LOW);
}

void turn_right()
{
 digitalWrite(motor_left[0], HIGH);
 digitalWrite(motor_left[1], LOW);

 digitalWrite(motor_right[0], LOW);
 digitalWrite(motor_right[1], HIGH);
}

float getsharpdata()
{
  float val = analogRead(IRpin);
  float distance = (2914 / (val + 5)) - 1;
  delay(50);
  return distance;
  
}


void servo_scan()
{
 motor_stop();
 myservo.write(0);
 delay(1000);
 int left=getsharpdata();
 myservo.write(180);
 delay(1000);    
 int right=getsharpdata();
 
 if(left>right)
 {
  turn_left();
  delay(500);
 }

else
 {
   turn_right();
   delay(500);
 }
 
}


Any and all help appreciated hehehe  smiley-wink

Thanks
3  Forum 2005-2010 (read only) / Interfacing / Re: Will this schematic work? on: December 11, 2010, 04:26:58 am
Ah thanks for explaining it richard,
that thing in the middle is a 5v regulator, can be anything,
but i will be using a 7805 and i know that the batteries provide 3v
i said assume it contains 6 or 8 AA batteries smiley-grin,
and that thing on the left is a sharp IR rangefinder which gives an analog output proportional to the distance of the object its seeing ,

so it should be something like this?



4  Forum 2005-2010 (read only) / Interfacing / Re: Will this schematic work? on: December 11, 2010, 04:03:04 am
Why do i need a common ground when i am powering the board and other stuff separately.
Please explain (I'm a beginner)
5  Forum 2005-2010 (read only) / Interfacing / Will this schematic work? on: December 11, 2010, 03:25:47 am
Hello,








image developed using fritzing.



Will this work, I know the 2 AA batteries wont provide enough power,
just assume its a collection of 6 or 8 AA batteries.Basically only the signal lines go to the arduino and the power is provided from a separate regulated 5v source,also assume the arduino is powered separately.

So will this work?

if there are any mistakes, please tell me how to correct them.

Thanks
6  Forum 2005-2010 (read only) / Interfacing / Re: Seeedstudio ultrasonic rangefinder on: November 29, 2010, 08:22:53 am
thanks for the reply
however i don't think there is an error in the pulsin signal,because even
if the pulsin was delayed,the time measured would be only from the
time the pulin signal left to the time the signal was recieved,and
since the resolution should be 1 cm,you are getting about 2.54 times
the error i think,
Please correct me if i am wrong
7  Forum 2005-2010 (read only) / Interfacing / Re: Seeedstudio ultrasonic rangefinder on: November 28, 2010, 09:57:03 am
Thanks guys for the fast reply,,
@bill what sort of accuracy and repeatability issues are you having exactly,could you please expand??

has anyone owned any two of the above mentioned 3 sensors,
which one would you prefer ping or srf05 or seeeduino??
what about accuracy,quality etc etc,
 thanks
8  Forum 2005-2010 (read only) / Interfacing / Seeedstudio ultrasonic rangefinder on: November 28, 2010, 05:40:38 am
Hello,
has anyone ever used this senso----http://www.robotshop.ca/seeedstudio-ultrasonic-range-finder-2.htmlr??
any problems with it??
which of the following ultrasonic rangefinders do you prefer
1)devantec srf05
2)parallax ping)))
3)seeedstudio ultrasonic rangefinder

Im interested because it costs about half as much as the other two,
but if it has problems,ill go with one of the other two.
9  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Absolute beginner on: January 05, 2011, 10:56:17 am
if you plan to do thermal imaging using IR,
it definitely is not possible with the arduino,
your going to need a single board computer to
do that(at the very least),
10  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Arduino as ISP on: January 05, 2011, 10:49:01 am
hehe many people would love to be able to do that,
unfortunately its not possible smiley-sad,

you need a hardware programmer to configure the atmega328 to
use its internal clock;
11  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Arduino as ISP on: January 05, 2011, 09:39:27 am
scroll down,

you can use 2 boards OR 1 board, 1 chip and a breadboard  smiley-wink
12  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Arduino as ISP on: January 05, 2011, 09:32:24 am
Yes you can, you can use the duemilanovae
but not the uno currently(it says a revision is underway smiley ),

see this---------->http://arduino.cc/en/Tutorial/ArduinoISP;

once you burn the bootloader to the empty atmega328, you can replace the chip on the uno or use it as a standalone arudino compatible chip  smiley-wink

btw google is your friend  smiley-wink
13  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Can the arduino handle this on: January 01, 2011, 08:29:49 am
Thanks everyone for the replies,it really helped
and crossroads, you are right  I plan to leave the
uC permanently or atleast for along time in the robot
so that it can function as a development platform,


Does anyone have the FEZ Panda, what are you experiences, suggestions etc,do you suggest it ???
Does anyone sugest the FEZ panda???

14  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Can the arduino handle this on: December 29, 2010, 10:46:30 am
Thanks for alleviating some of my fears,
but im not really concerned about the reading the sensors
just the acutal mapping taking place because it will probably be a
2D int array, probably 16X16 or 32X32.
15  Forum 2005-2010 (read only) / Frequently-Asked Questions / Can the arduino handle this on: December 29, 2010, 10:03:09 am
Hello,

I plan on making a robot that uses 5 - 7 sensors,
there will be one Parallax Ping ultrasonic sensor, 4 sharp
IR rangefinders and probably 2 more infrared sensors
for table edge detection and/or line following.
While I have no doubt that there are enough pins on the Uno
to handle all of these, I'm worried about the memory,

Should i buy a second uno/duemilanove(first one is doing some stuff in garage, don't ask:smiley) or buy a FEZ panda
sadly my budget is only around 30-35$ so I cannot use the Mega  smiley-sad.
I plan on the robot creating a 2D map and navigating according to
that.I plan on using 2DC motrs with pwm speed control, so there's
4 pwm pins gone there and probably 2 more for servos, so since both
have 6 pwm outputs , all 6 will be used.
This is still in the preliminary planning stage and the first
program will probably just implement basic obstacle detection
and from there I plan on expanding it to include mapping capabilities.

Are there any issues with the FEZ panda, I have some coding expereince in c++ and moving to c# will not be too difficult for me,
Even though it runs at 72 Mhz,its also native code,
does this mean its slower than the 16 Mhz arduino in most tasks?,
and what effect does this have on ram??

So, please tell me if this is within the capabilities of an arduino
because if it is, I wont even consider anything else due to the huge
libraries and support community 8-)

So which one FEZ Panda or arduino?

Thanks
Pages: [1] 2