Society of Robots - Robot Forum

Software => Software => Topic started by: gunthervde on June 02, 2012, 01:41:20 PM

Title: ARDUINO PROGRAMMING
Post by: gunthervde on June 02, 2012, 01:41:20 PM
Hello,
I'm from Belgium,and new here and also new in programming.
I have a arduino to program
I want to make a robot with it
2 motor (left right)
2 bumpersensors
buttons: START STOP
When the robot hit something he has to stop for 2 seconds and than changing from direction turned under a angle.
Does anyone has experience with it, or can give me a good start to complete my gool?
Manny thanks.

Sorry if I make mistakes in my English writing, it's not my local language.

Kind Regards,
Title: Re: ARDUINO PROGRAMMING
Post by: idee17 on January 24, 2013, 03:36:12 PM
Well, I would first look a the arduino.cc webpage they have all kinds of helpful tutorials.

But what I would do is use two n-channel mosfets (if you don't know what they are look on youtube there are plenty of tutorials) to turn on and off the motors, you would need two 100k resistors to keep the mosfet in the "off" state. Then when a "bumpsensors" is turned to HIGH digitalWrite where one wheel rotates and the other doesn't this will give you a turn. Just set delay times so that the robot car will turn 90 degrees and be off on its merry way again =)

n-channel mosfets tutorial
Transistor / MOSFET tutorial (http://www.youtube.com/watch?v=Te5YYVZiOKs#ws)
Title: Re: ARDUINO PROGRAMMING
Post by: newInRobotics on January 25, 2013, 04:03:26 AM
Hello,
I'm from Belgium,and new here and also new in programming.
Hi and welcome :)

I have a arduino to program
To program Arduino You have at least 2 approaches:

Personally, I never had MCU (augmented board like Arduino). What I did was bought ATmega48 microcontroller for £3 and used Atmel Studio to program it. I didn't get all ready made sockets/connections/pins (as You do with Arduino/Axon/other MCUs), but to start learning all I needed was prototyping board, few resistors, LEDs and caps to get everything connected to my microcontroller. This way, I learnt not only how to program microcontrollers, but also how to setup all hardware.

For useful AVRC tutorials try links in this post --> http://www.societyofrobots.com/robotforum/index.php?topic=14947.msg109175#msg109175 (http://www.societyofrobots.com/robotforum/index.php?topic=14947.msg109175#msg109175)

I want to make a robot with it
2 motor (left right)
To drive motors You need to have motor controller or H-bridge that exceed power requirements of motors. DON'T TRY CONNECTING MOTORS DIRECTLY TO MICROCONTROLLER - IT WILL RUIN IT!!! If You post motors specs, we might be able to guide You towards proper driver for them. There are many choices for motor drivers starting with ready built drivers, with all bells and whistles, like Sabertooth (http://www.dimensionengineering.com/products/sabertooth2x5), going to IC H-bridges like L298 (http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00000240.pdf), ending with custom/DIY built transistor H-bridges (http://www.nathandumont.com/node/249).

Regarding programming related to driving motors - You need to learn how timers and PWM work. Link to timer/PWM tutorial is provided in the post I link You to above.

2 bumpersensors
buttons: START STOP
To detect switch/button actuation You have to use interrupt feature of Your microcontroller. Here's post to get You started --> Newbie's Guide to AVR Interrupts (http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=89843&start=all&postdays=0&postorder=asc).

Good luck :)
Title: Re: ARDUINO PROGRAMMING
Post by: AscanioFX on January 26, 2013, 07:13:29 AM
Well if you need to learn the basics for Arduino you can watch for tutorial on youtube. You can find almost everything there. I have learnd arduino and C programming just with Google and Youtube's tutorial and I have recently build a robot that does something like the one you are building.
Here is a link to a series of tutorial that teaches you the basics of Arduino that i would recommand.

Tutorial 01 for Arduino: Getting Acquainted with Arduino (http://www.youtube.com/watch?v=fCxzA9_kg6s#ws)

Before starting building a robot I would suggest getting to know your platform, I started by playng with the arduino starter kit (that you can buy on the arduino store or any electronic webstore) that had almost everything inside to learn how it all works, then i realized i had a more clear idea of how I could do it and it just tooke few tiem for building the robot.