I am working on a sumo bot project and can't decide on which arduino to use I was looking at the mega2560 but not sure if it will work the best for my needs also I am using a qik 2s9v1 motor control and a few sensors
Any guidance will be great. Thanks
How many digital I/O pins do you need?
How many serial ports do your need?
...R
Hi
If you need not to much I/O pins you can use also an Arduino uno but if you would include big libaries you should look after an arduino with more memory for example the arduino mega2560
If you would use an Arduino mega2560 it is important that you check if all your libaries are completle campatible with the mega and not just with the uno or something else.
If your sumo but should be very small you can also get something like the Arduino nano or the Arduino mini pro.
I will have 2 infred sensors a ultrasonic sensor and the pins used by the motor control I was also reading that the mega is faster than the Uno I'm not to familiar with the library's I have to use so any help with that would help a lot
The Mega and the Uno both work at 16MHz so there is no difference in speed. All the specifications are in the Arduino Products section.
Most libraries and add-on hardware are designed to work with the Uno. There is some risk that things will not work with the Mega - but until you decide what you want to use it will be impossible to check.
Can you post a link to the datasheet for the motor controller you are planning to use. A link to the datasheet for the motors would also be useful.
How do you plan to power the motors?
...R
Hi
The second thing you said is wrong both arduinos had the same speed (16MHZ). If you're serching something witch is really fast you should take a look at the arduino Due (http://arduino.cc/en/Main/ArduinoBoardDue). This one has 84MHz clock speed so it's much faster than any other arduino you can buy at the moment.
But if your code is not to long jet, I think the Arduino Uno is the best one for you.
Here is my motor controller Pololu Qik 2s9v1 Dual Serial Motor Controller
And I am using 2 560 oz in gear motors 1
- Hcsr-04 ultrasonic distance sensor
And 2 infred sensors
I am not to familiar with the library's I will have to use if I get a mega compared to the uno so any help is well appreciated
also i am powering everything with a 3 cell 2200 mah lipo battery. i was looking at using the new ping library is anyone familiar with it? will it work with the mega?
I don't mean to be pushey but I just found this data sheet to not sure if it will help any http://www.atmel.com/Images/Atmel-2549-8-bit-AVR-Microcontroller-ATmega640-1280-1281-2560-2561_datasheet.pdf
Also I am not familiar with the serial ports I think I am only going to need to use one but I'm not totally sure I'm just getting into this and my sumo bot is due in about a month so Im freaking out a little Thanks for any input
I have the impression that you don't yet have enough Arduino experience to know what you don't know.
Are you sure that controller can handle the current required by your motor? You did not post a link to the motor specifications.
That motor controller needs to be sent commands over a serial interface and, for that, a Mega would be more convenient because it has 4 USARTs. The Uno has only one so you have to use SoftwareSerial to create an extra serial port. Pololu seems to have a library to simplify the control code.
Assuming SoftwareSerial works with that device the whole project will be well within the scope of an Uno.
There are many alternative motor controllers that don't need a serial connection to control them.
As far as the other components are concerned there are lots of Threads in this Forum about them and almost certainly Google will find relevant tutorials. When you see what code and/or libraries other people are using you will be able to check whether they work with a Mega.
...R
I am sure that my motor controler can handle my 2 motors each motor draws 1 amp at full load and that is what the controler is rated for. I will read more about the uno and mega differences today and I have to see how many pins inputs I will need I think it's either 14 or 15 but I'll check to make Sure. Here's the data sheet for the controller http://datasheets.globalspec.com/ds/4096/RobotMarketplace/BE95B5DD-083B-4B3B-B8E8-7F6EEADCF554
Hi
So, for this project I would use an Arduino mega.
I think it would be fast enough for this
Normally it would have enough pins for what you would do, because there are 15 Analog Input pins.
For the Hcsr-04 ultrasonic distance sensor I have already written an sketch:
// ---------------------------------------------------------------------------
// Example NewPing library sketch that does a ping about 20 times per second.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#include <LiquidCrystal.h>
#define TRIGGER_PIN 39 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN 37 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() {
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Distanz..");
}
void loop() {
delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).
lcd.setCursor(0, 1);
lcd.print(uS / US_ROUNDTRIP_CM);
lcd.print("cm ");
}
I think your motor drivers are strong enough for what you like to do but if your motors are quiet bigger, I think the L298N motor driver are better for the motors or just use the arduino motor shield
thanks for the code and I have already bought the qik 2s9v1 motor controller so im stuck with it now, it should work, it will just be on its limits. how do I use the different USARTs on the mega if that is what I am going to go with. I have only used the uno before and didn't have to deal with the different ones the mega has. does the motor controller need to be on a different USART?
also here is the datasheet for the mega 2560 http://www.atmel.com/Images/doc2549.pdf
16wennekyl00:
I have to see how many pins inputs I will need I think it's either 14 or 15
For the items you list in Reply #6 I would expect that you would only need about 8.
Can you list what you think you need pins for?
There is nothing to be gained by spending money on a Mega if the cheaper Uno would work just as well.
I just saw your latest post ...
If you want to communicate with the PC as well as the motor controller then you need the USART that is used by the USB connection to talk to the PC and another USART on the Mega (or SoftwareSerial on an Uno) to talk to the controller.
...R
I think I am going to use the mega 2560 it is only 5 more bucks than the uno and for the pins. I have 2 infred sensors so that's 6 pins, the ultrasonic sensor that's 4 pins and 4 pins for the motor control so 14 pins so far without adding anything else which I might depending on how it works with that setup
And il have to read up more about the ports for the motor control tonight
16wennekyl00:
it is only 5 more bucks than the uno
That is very good. I think mine cost nearly twice as much as my Uno - hence my caution.
...R
The one I'm going to buy is 18 buck with shipping
would a picture of my robot help for an idea with the code
Photos don't provide any useful information for programming or wiring connections.
When you get your Arduino work through some of the examples in the Arduino IDE. You will find examples there, or online, for all the parts you want to use.
Try each part in a short program on its own to be sure you know how it works before trying to combine them in your project.
This Thread planning and implementing a program may have useful stuff.
...R
Ok thanks with all the help
when I get my arduino and start playing around with it I'll probably make another post for help checking code, probably in a week or so thanks for all the info