Software > Software



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,

Well, I would first look a the 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


--- Quote from: gunthervde on June 02, 2012, 01:41:20 PM ---Hello,
I'm from Belgium,and new here and also new in programming.
--- End quote ---
Hi and welcome :)

--- Quote from: gunthervde on June 02, 2012, 01:41:20 PM ---I have a arduino to program
--- End quote ---
To program Arduino You have at least 2 approaches:

* Use Arduino IDE and their C Libraries, which are very handy, however somewhat restricted to Arduino devices only.
* Use Atmel Studio 6 IDE and their C Libraries. This way gives You more flexibility later on if You don't want to use Arduino as this approach works for all Atmel microcontrollers
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 -->

--- Quote from: gunthervde on June 02, 2012, 01:41:20 PM ---I want to make a robot with it
2 motor (left right)
--- End quote ---
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, going to IC H-bridges like L298, ending with custom/DIY built transistor H-bridges.

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.

--- Quote from: gunthervde on June 02, 2012, 01:41:20 PM ---2 bumpersensors
buttons: START STOP
--- End quote ---
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.

Good luck :)

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

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.


[0] Message Index

Go to full version