Hello all! Ive owned an arduino now for about a year. Ive been practicing in and out but I wanted to get seious about a project. Im looking to assemble a Start Here style of robot but with an Arduino Uno for a brain. Currently i have...
Arduino
SeeedStudio Motor shield
a morphibians RC toy (essentially the same base as SHR)
mini breadboard
all the connections that should be required
IR sensor
a few photosensors.
I feel confident that I can assemble the lil guy, but Im lost when it comes to the programming. I understand some basic C++ but when I add in the motor shield, I just get overwhelmed. Would you guys suggest not using the shield? Using a different one to get me started?
Welcome! My suggestion to you is to try some prototyping before you go whole hog. Take the baby steps of understanding each piece, ensuring it works separately, then work your way up to integrating the pieces together. You are much more likely to be successful.
I personally really like these tutorials on adafruit.com. They do a very nice job on how to wire, what to use etc. We also have a Start Here robot which you can do,
but since you already have some parts, you could go the harder route of getting what you have to work. Good luck and don’t be afraid to ask for help. Just be sure to be specific in your question since we can’t help you if we don’t know what you are trying to do.
Arduino based SHR copies floating around LMR. chickenparmi also has a website and a YouTube channel that you may find useful.
I agree with the piecemeal approach. When one is taught a language they are taught little bits at a time and build on them. Thinking about it that way should suggest to you that taking things slow will probably be a better way for you to learn. Try to pick up on good programming practices as you go though.
Also like JerZ and nhbill said, of you get stuck do your research then come here and ask a detailed question. Admittedly any number of us could write code that would work for you, but, how will you learn.
Thanks for all the feedback! I made a lot of progress today. Assembled the “body” put a switch in, and loaded the motor test code from the Seeedstudio site just to see what happens. It works, sort of! Im about to make a project log, but thought i’d squeeze one more question out of here cause it relates to arduino as a whole…
The bot can move forward and back well enough, but it has trouble going left and right… the little guy is trying… but the arduino buzzes and it cant turn. If it pick it up it seems ok, but not on the floor.That makes me think its a lack of power, but it uses a 7.2v RC car battery. Another idea is that the code has the wheels spinning too slow. the number in the code is 127… not sure what it means lol
Really I just want to know that the buzzing doesnt mean that Im destroying my microcontroller lol
a range of 0 to 255. 127 is basically half speed. I imagine the buzzing is as you guessed low power. If your base is of the differential drive variety, you should be able to go full speed for the turns.
the motor shields I have have a jumper to select between powering the arduino from the motor shield or standalone power. if you have it set the wrong way you might be drawing too much power away from your h-bridges.
also go through and make sure all your screw terminals are connected well.
a lot of times you’ll need a seperate power source for your controller than your motors. The motors and servos require a lot of juice and its inconsistent. a lot of motors spike when they start up.
The shield contains H-bridge chips which are essential if you want to have any kind of control over what the motors are doing. If you want to have the Arduino hijack your RC car, the motor shield is a great place to start. If you don’t know anything about H-bridges, then you already know what you should be learning.
The best advise I can think of is start in small steps. As you’ve already noted, it can get overwhelming with a pile of parts that you’ve never used before. Get a motor to spin one way and when you push a button have it change direction. When you have that working, get the LED on pin 13 to light up when your light sensor is in the light, or in the dark. Once you have that working, you should be able to have the sensor control the direction of the motor.
If you pay attention to where and how much voltage you are plugging into things it is quite difficult to kill an Arduino, so don’t be afraid to try things. If you’re not sure or have a question about something, make a forum post. Chances are good that someone has ran into the same trouble so be sure to search first.