Welcome to Annamacharya Mechanical Group
go to my homepage
Go to homepage

our basic robo


read more "our basic robo"

How to make a robot?



    STEP-BY-STEP ROBOT TUTORIAL
    Step by Step Robot Tutorial
    Ever wanted to build your own robot but didn't know where to start? Here is your chance! I will outline step by step exactly what to do to build a robot for under $50. Remember, if you ever have any questions or need help, just send a post to the robot forum. Here is a video playlist of what the robot will do when you are finished. Enjoy =)  
    The robot is programmed to be a photovore and is therefore trapped in a 'box' of sunlight coming in through my window. Now that you have detailed instructions easy enough for a beginner, you now have no excuses. Go make your robot! =P 
    Step 1 - Basics In this part, we will talk about the motivation behind building such a robot, what you will learn in this tutorial series, what the robot will be able to do, and the parts required to be purchased.
      Step 2 - Mechanics In step two, we will build the chassis of your robot. This part can mostly be done with parts around your house, and has room for creativity on your part. There are many ways to do this, I offer only one of them. 
    Step 3 - Electronics The electronics steps (AB, and C) will be the most expensive and most difficult. Few of the parts can be found around your house, and electronics itself can be difficult without a good understanding in the basics. I will do my best to guide you step by step to build your robot controller. In this step we will do all the wiring to build the brains and sensors of your robot. 
    Step 4 - Programming Now that you have done the hard part, sit back and relax as programming will be simple. Better yet, this step is 100% free! Download the software, plug in your robot, upload the code to the robot controller, and away it goes!
read more "How to make a robot?"

Step-1


    - THE $50 ROBOT -STEP-BY-STEP ROBOT TUTORIAL STEP 1: UNDERSTAND THE ROBOT
    Step by Step Robot Tutorial
    Build a quality robot for under $50 - on your own! Motivation Before we get started, I want to tell you about the motivation behind writing this tutorial. I remember back when I began building my very first robot. I had been wanting to build robots for years, since 3rd grade actually. I was completely fascinated by them. But unfortunately I never had any outside influence to do this - none. Not a single person I knew understood what even a resistor was good for, even through highschool! No one to help me, no one to explain anything, no guidance from teachers, no SoR either! I bought robot like toys, dabbled with electronics, but didn't have a clue on where to start. Nature, failed by nurture . . . Blue Robot Chasing Carrot on a Stick Then in my sophomore year in college, I took my first robotics class. The professor gave us an optional project to build our own robot, and offered money to anyone up to the challenge. It was my chance! Still had no idea what I was doing, but I had money to do it! I immediately started drawing up plans, and began talking with people. Still clueless, I spoke to two mechanics, a biochemist, a CS prof. Combined I knew enough to go to Home Depot and buy a bunch of steel beams that I knew somehow magically connected together. Soon after, I remember walking into theCMU Robotics Club and saying 'I have these steel beams and I want to cut them to size, how do I do it?' At first confused by my high level of incompetence, they agreed to show me how to use the bandsaw. From that point on, if I needed help, I knew where to find it. Ok so my first robot was a complete failure, but its where I learned all the basics to get me started on my own . . . and the rest is history . . . The point of that story is that people need just two things to build a robot:
    • a chance/opportunity
    • outside guidance
    As you have realized, SoR has been the outside guidance people need. Got a question? Post it in the forum. Need expertise? Read the many tutorials. But what I haven't offered, at least up to now, is an opportunity. About This Tutorial What I am offering in this tutorial is an opportunity for you to build your own very first robot, step-by-step, for under $50. I spent the time to design a robot for you, the beginner, based on three metrics. The first is simplicity - it has to be something that can be easily done by anyone, where mistakes are hard to make and easy to fix. The second metric is cost - most people typically cant spend more than $50 to $100 on projects like this. The robot kits you can buy, at least the good ones, all cost more than $100 thereby making them very prohibitive to buy. The last metric is quality. I can design for you a robot that costs under $25, but it would probably take you 5x longer to make it, and would be significantly harder for you to understand anything. I dont want you to be a lemming, I want you to understand, too. But that's not all I'm offering in this tutorial. I'm also going to teach you the basic steps to going about designing and building all your future robots. And I am going to do it in a manner so you can use tools from around your house and the local hardware store. Serious About Robotics? One more thing before we begin. Ask yourself how serious you are about robots. Do you just want to just try it out? Maybe make something for your child to learn with? Perhaps encourage your highschool students in the direction of engineering? Or do you want to study it in college? Maybe you want robotics to be your professional career? If you fall in the latter two categories, you need to stop being cheap. Seriously, if you want to be a professional, you need to go all out. Buy yourself some good equipment, make investments in robot parts, don't cut corners because of cost. Of course, you don't need to go out buying $5k laser rangefinders, but don't spend 10 hours making an accelerometer when you can buy one for $10. Serious Blue Robot If you are a serious builder, build/buy your robot parts under the assumption they will be scraped for robots in the future. Beginners often spend between $100-$400 for their first 2 or 3 robots, while experts spend about $0-$40 for their robots. Why is this? Its because they made the long-term investment. If you are going to build robots the rest of your life, spend for the long term. The investment will pay for itself. In all honesty, you may end up spending $150+ for this robot, but if you are willing to make the investment, in the long term it will pay off. Either way, I will give multiple options throughout the tutorial to match each persons wallet (or lack of). Speaking of which, are you just too poor to invest? If you want to know more about paying for robots, read my robot funding tutorial. And just so you know, I designed this robot in such a way that people who arent serious wont waste money, and those who are serious get good parts to scrap for their next robot. A quality robot, for under $50. =P Beginning the Tutorial - Design and Part Selection As I mentioned, I will teach you the process of making a robot, as you make it. The very first step anyone would make would be to design your robot. Interestingly this is where beginners fail. Beginners spend 90% of their time building, and 10% designing. Experts are the opposite - 90% designing and 10% building. Of course when you are a beginner its hard to design - you dont always know what works until you try it. But planning never hurts. A good example of planning a robot would be the CAD work I did for my sumo robot, Stampy: Robot Design Sketch Typically the design phase is an iterative process/cycle between design and part selection, meaning the designer juggles between the design he would like, and the affordable parts available on the market. The designer will keep redesigning until both reach a harmony - often a long and tedious task. There have been several times where I spent a week designing a circuit, only to find out a key chip I need has been sold out and no longer exists! It forces me to redesign the whole darn thing. Pain! Design vs Part Selection Cycle But lucky for you, I designed this robot using highly available, easily replaceable components. For this tutorial you can mostly skip the design/part selection phase, but its still a very important skill you will need to learn. In the future, if you are looking for robot components, I have written up a robots parts list to save you time. Parts List Starting you off, these are the parts you need to purchase. Buy them right after you read through this tutorial, but before you start building anything. That way the parts have time to ship while you are building the robot chassis. Note that some of the parts in the optional list can replace the more expensive parts in the required list. Required Parts:
    ItemCost each ($)QuantityWebsite, Part #
    Hitec HS-311 servo
    (modify the servo)
    8.992Servocity.com
    31311S
    5V Linear Regulator.501DigiKey.com
    KA7805ETU-ND
    ATmega8 AVR3.661DigiKey.com
    ATMEGA8-16PU-ND
    28 pin DIP socket1.681DigiKey.com
    ED3128-ND
    220uF+ Electrolytic
    Capacitor
    .321DigiKey.com
    565-1038-ND
    .1uF Ceramic
    Capacitor
    .131DigiKey.com
    399-4454-1-ND
    36 position
    breakaway male header
    1.742DigiKey.com
    WM6436-ND
    340ohm resistor.955 packDigiKey.com
    PPC340YCT-ND
    1.62Kohm resistor.495 packDigiKey.com
    1.62KXBK-ND
    LED.191DigiKey.com
    160-1034-ND
    CdS Photoresistors2.995 packRadioShack
    276-1657
    Grid-Style PC Board
    with 371 Holes
    1.991RadioShack
    276-149
    And more optional parts. You will need one of the listed programmers (I will explain the difference later inpart 4).
    Enclosed 4 AA Battery
    Holder (with On/Off switch)
    1.991RadioShack
    270-409
    9V Battery.251any store
    6v 1400mAh
    NiMH Battery
    11.951
    AVR STK Serial Port
    Dongle Programmer
    12.951
    AVR-PG1
    AVR ISP2 Programmer34

    ATAVRISP2-ND
    Pocket AVR Programmer151
    PGM-09231
    Part costs may change due to market factors. Last price update Dec 2008 . . . prices go up with inflation so at some point it'll be over $50 for sure! Although not necessary, I posted the datasheets of all parts (4mb) for more information. If you live in Britain, a generous user has suggested this parts list to save you money in shipping. Thanks Paula! And if you live in Australia, Smash has suggested this parts list. Tools/Misc List Ok so to be honest, you will probably have to spend more than $50 on your robot. This robot was designed to use parts you are likely to have around your house, or that can be borrowed from friends or school . . . but if you like live in a box, and don't have friends or something, you might have issues finding these items.
    • wires
    • screws
    • four 1.5V batteries (rechargeable NiMH are best)
    • cardboard
    • waterbottle
    • two rubber bands
    • chopsticks/popsicle sticks
    • scotch/duct tape
    • serial port on your computer
    • if no serial port, get a usb to serial adaptor cable
    • sharp scissors
    • soldering iron
    • solder roll (22 to 25 gauge)
    • multimeter (not required, but good to have)
    • safety goggles (you only have two eyes)
    If you cant find any of these items, your local hardware store will have them. Remember, if you are serious about robotics, make an investment in good tools and equipment. What Kind of Robot Are We Going to Build? In one sentence: we are going to build a differential drive robot, using thephotovore algorithm, with photoresistors, capable of basic object avoidance. This means your robot can run around your house without running into objects such as furniture and your cat . . . preferably just the furniture . . . Please read those tutorials before continuing, as they can give you a fundamental knowledge of what we will do in this tutorial series. The Balance - Mechanics, Electronics, and Software You have probably noticed how I often divide robotics up into these three separate categories - such as I do in the forum. This is because making robots involves three independent skills. Only combined, can you make a functioning robot. When a robot designer makes a robot, he has to account for all three in the design phase so that each falls into balance. But for this tutorial, I will do one at a time to make it easier for you to understand. First will be mechanics where we build the robot, then electronics where we hook up the brains and sensors, and finally software will be written to program the robot. Mechanics, Electronics, and Software
read more "Step-1"

Step-2


    STEP-BY-STEP ROBOT TUTORIAL STEP 2: CONSTRUCT THE CHASSIS
    Step by Step Robot Tutorial
    Mechanics - Chassis Construction In step 2 we will build the chassis of our robot. I didn't use CAD or CNC or a high precision mill. No space-age materials, either. I built this robot just using stuff I found around the house, using really common tools. At each step I will offer ideas of other ways to go about making your chassis, Chassis Optimization To optimize anything, you must understand it first. I have assembled a few additional tutorials that are optional reading to help you understand robotic mechanical design. The first is on robot chassis construction, giving key pointers in assembling your robot. The next tutorial is calculating the robot motor factor, helping you quantitatively choose robot velocity, the motor torque, and wheel diameter. Optimize your Robot If you would like to use or know about more 'professional' materials than just stuff found around the house, have a look at the list of robot materials. Chassis Construction We will now construct the chassis, step by step. When building your robot, use my example as more of a guide - your imagination is more important. Remember, I just gathered some things I found in the closet and recycle bin, and used very basic tools. Do the same, and figure out ways to connect it all together. Your house has a lot of stuff, be creative! In total, this took me about one hour of work. update: Webbot has graciously written up a tutorial on an alternative method to construct your $50 robot.
    The first part is to make the wheels. Either take wheels off an old toy, or get a sheet of material such as cardboard or plastic. Try to chose a material that is wide and has high friction. After testing I found that cardboard works fine on carpet, but slips occasionally on wooden floors. You could also double up the material, or wrap a rubber band around the rim for better grip. CD's can make good wheels, too.Now find a round object, and with a pen trace the object on the material. I did it the professional way by having my lovely assistant trace a can of tunafish for me (she requested that I point this out). The recommended wheel diameter is about 6", but it doesn't really matter. A larger wheel diameter will allow your robot to go faster and climb bigger objects. We made a second version of wheels later on using a CD to trace the circle - this diameter worked really well. Cut Out Your Robot Wheels You can also use the lid of a peanutbutter jar, or use a can of tunafish, as wheels - and wrap rubber bands around them for improved friction.
    This is a servo. The HS-311 servo is the most basic, and 2nd cheapest servo in the market. You could of course buy the cheapest servo in the market, but its tiny and wont offer much strength to move your robot.First you must modify your servos so that they can rotate continuously. The factory default will only allow the servo to rotate 180 degrees. After modifying your servo, in the servo you will see a screw in the horn. Take the screw out. Warning: The screws on these servos are of low quality. Use a fine tip screwdriver, and be careful not to strip the screw head. Remove Screw in Servo
    Cut out the traced wheel, and poke a hole into the center using something sharp (a thumbtack would be fine). Stick the servo screw through the center.After poking the screw through the wheel you will notice some flange material sticking up around it. Cut that off using something sharp, like a razor blade or pointy scissors. Stick Screw Through Wheel
    Your servos come with two black box shaped rubber things that have holes in it. They are called servo mounts.Attach Servo Mounts
    Using the larger screws that come with the servos, attach the servo mounts to both servos.Two Servos in Position
    Now find a piece of rigid cardboard or plastic, and cut it into a rectangle about 3" x 6". Poke 4 holes into it spaced so that the servo mounts can be screwed into it. Use the screws that come with the servos.I used my favorite type of robot material, HDPE since I had some laying around. But you can use wood or even a cereal box if you wanted. If the material bends too much, duct tape some sticks onto it. Servo Attached to HDPE Another method: I didn't try this, but I can imagine just using 'borrowed' restaurant chopsticks and duct tape, using the chopsticks as sort of a wooden frame. Put a chopstick on each corner of the servo, then wrap with the tape. Then connect the other servo in the same manner. Popsicle sticks should work, too . . . This is a mockup of what I am thinking. The chopsticks will need to be cut in half, and I didn't put tape on it, but you get the idea. Robot Chopstick Concept Update: Just two months after I posted the idea, a SoR member tried out the chopstick idea successfully and sent these pics: Chopsticks and Duct Tape Robot "What I did was cut some chopsticks down to about 6 inches, and stuck them through the screw mounts on the side and taped it up. After that, there was enough room to put a piece of cardboard in between, put some Velcro on that, and put a 9 v. on it." - Radiken Battery Attached
    This is what it should now look like. I put some black sticky velcro on the center to attach things, but this is entirely optional and not required for your robot.Two Servos Mounted
    Next, place some tape onto your servo horn. I used folded Scotch tape, but I found that double-sided foam tape holds better. What this tape does is holds your wheel to the servo horn to prevent it from spinning independently.Tape on Servo Horn
    Screw the wheel onto the servo shaft using the screw in the wheel. This is the completed wheel attached to the servo.Attach Wheel to Servo There are also better ways to attach wheels to servos.
    Now what you need to do is make a castor. This castor is the 3rd point of balance for your robot, and needs to be low friction when sliding across your floor. There are many many ways to do this, but I found this way to work great.Get a water bottle, and cut off the mouth. Cut Water Bottle Cut the bottle in half, but leave the bottom fully attached. Cut Water Bottle
    Lay the bottle over your robot as so. The bottom of the bottle will contact the ground and be the castor.Attach Water Bottle to Robot
    To attach the bottle to the robot I used two rubber bands. These held really well, despite how ghetto it looks. You could also use tape or screws to hold the bottle on.This is what your final robot chassis should sort of look like. Add Rubber Bands If you went with the chopstick method, you can get two long sticks that jut out from the four on the servos, and stick them into a ping pong ball. The ping pong ball would be the castor.
    Optional: Since I had some basic RC equipment around, I made my robot temporarily remote controlled just for fun. It is a useful method for testing all new robots you build to help you work out the mechanical bugs, and truely see what your robot is capable of. Here is a tutorial on remote control robots.I attached a battery to the velcro, and put the receiver inside the bottle. Both servos were attached to the receiver. Completed Robot Chassis
    Bonus Video! Just for fun I decided to have a battle between the $50 Dollar Robot (remote control mode) and Stampy. Ok so it got the crap beaten out of it, but it held up and didnt break!
read more "Step-2"

Step-3

    STEP-BY-STEP ROBOT TUTORIAL STEP 3a: CONSTRUCT THE CONTROLLER
    Step by Step Robot Tutorial
    Electronics In step 3 of the step-by-step robot tutorial we will now build the brains (electronics systems) of our robot. This step should take you about three to four hours from start to completion. There are three major electronic systems for all robots, and you will build each of these in this tutorial: 1) Power Regulation - this system ensures your robot always gets enough power and the correct voltages to run all other systems without interruption. 2) Microcontroller - this is the actual brain of your robot. It is the device you program, and controls all other systems of your robot. For your robot, you will be using the AVR ATmega8 (the big black chip with all the pins sticking out of it). 3) Sensors and Actuators - for any control system you need both a sensor for the robot to 'see' the world, but also actuators to react to what it sees.
    Transistioning between mechanical construction and electronics, we need to setup the batteries. There are two ways I will show you how to do this. The first way I will show you, and also the better yet more expensive method, is by using a 6V RC battery pack. This is the same battery pack I used in Step 2 to test as a remote control robot.6V RC Battery Pack You can probably locate a pack like this from a remote control car you own, buy online for ~$10, or make your own by putting 5 AA batteries in series. For small robots I recommend NiHM type batteries at 1500mAh and above. If you are serious about robotics, put in the money and buy a battery pack! Its a good investment (I own like 4 of this type of battery, not including all the other types I got). You should also consider getting an ON/OFF switch for your battery pack, although it isnt really required (you could just unplug your battery). I got this one for ~$2. Plug your battery into one end, and the other end can go to the battery connection on your robot. Also, notice the velcro on the bottom of the battery. I will talk about this in the following section. RC ON/OFF Switch Now just place the battery pack on the velcro already on your robot. You could also use long cable ties or tape, but I don't recommend it. What I like about the water bottle on the robot is that I can put stuff into it - batteries, sensors, baby squirrels, etc. You could also mount a small box on top of your robot to store the batteries. As a matter of fact, the Olimex programmer you bought for this project comes in a box that is just the right size. You are only limited by your imagination and what you have available to scrap. RC Pack On Robot And you're done! (with batteries) For more battery information, check out the batteries tutorial.
    But suppose you don't have the money or don't want to buy a battery pack. There is another way.The other battery method is to get a battery holder, use the AA's that you have in your digital camera to power servos, and a 9V battery to power the AVR microcontroller. These are three different types of battery holders I own, but the middle one is best because its encased and has a built-in ON/OFF switch. All three can be bought from RadioShack (buy the middle one!!!). Battery Holders
    Opening the battery holder up, I put four AA NiMH type batteries into it. Make sure you use rechargeable batteries, as they last much longer and supply much better power to your robot servos (thereby making Al Gore happy). You need four batteries.If you dont own AA batteries (cause you're weird or something), you can buy them for like $5 at any convenience store. Get the ones with the highest number for mAh and that say NiMH. Buy a charger if you don't already own one, too - or continue reading later on how to make your own battery charger. I assume you have batteries already cause most people own a digital camera (so I didnt include it in the $50). Put 4 NiMH Batteries into Battery Pack
    I like to use velcro to attach batteries to small and medium sized robots. This allows me to easily remove batteries for recharging, or to quickly put on other robots I've made that share the same battery pack.Cut a small sheet of velcro into a square as shown. Size Velcro to Fit Remove the protective backing from the velcro and stick the velcro on to the bottom of your battery pack. I realize at least one person out there is going to make the dumb mistake of covering up the screw with the velcro - don't do that! =P Stick the Velcro Onto the Battery Pack
    Then just simply attach the velcro to the velcro already on the robot.Using Velcro to Attach Your Battery Pack If you don't have velcro, you can also drill a small hole inside the plastic, and put a screw through it. Then drill another hole in your robot, and pass the same screw through that hole too. Lastly, use a nut to tighten the screw on. This is a demonstration of me doing it, although I didn't actually drill a hole (pretend, please!). Using a Screw to Attach Your Battery Pack If you plan to build many robots in the future, I recommend going out to buy a 25 foot roll of velcro for like ~$20. I use it all the time for attaching batteries, and it will last you like 5+ years. Definitely a good investment.
    Before we continue, I want to show you a cheap way to recharge your batteries. Search around for a power supply in your house that you are no longer using. They are fairly easy to find and/or scrap.Power Supply Make sure it outputs the same voltage as your batteries. For example, if you have a 6V RC battery pack, make sure the power supply says 6V. If you put four battery cells together, make sure it says 4.8V (because 4 cells at 1.2V each equals 4.8V). Make sure it outputs a low current (trickle charge). 100mA seems to work fine for me. If the output current is too high, your batteries could overheat and as a consequence become damaged (or start a fire). Typical recharge times will be about 10+ hours. The more professional chargers out there that you can buy could take significantly less time, as they are designed to charge as fast as possible without damaging the battery. These chargers range from $10 to $60, dependent on features. Power Supply and Connector Now cut off the adaptor end of the long wire. There are two ways you can attach it to your battery. You could use aligator clips to connect the power supply to your battery pack wires (make sure ground and power aren't reversed). The method I used is to attach a male header to the wires so it goes right into the RC pack plug. I will talk more about male headers towards the end of this page.
    Now lets go over the components you will need for your first robot. If you would like to learn more about basic electronics, have a look at the electronics basics tutorial.This is a 5 pack of photoresistors I bought from RadioShack. This variety is great, cause now I can choose the 2 photoresistors I like best (aka, give the best sensor readings). For more information on photoresistors, read the photoresistor tutorial. Photoresistors
    This is a prototyping board (known by RadioShack as a 'Component PC Board,' wherever they got that from . . .). To use it, stick your components into the board and solder them in according to the schematic, as I will soon show. These boards are also known as 'perf boards', short for perforated boards (has lots of holes in it).Permanent Prototyping Board You can also get what is called a breadboard. It works in a similar way to a prototyping board, but none of the connections are permanent. The benefits are that it doesn't require any soldering, and that you can quickly change your circuit as you please (great for experimenting!). The one shown here is a mini-breadboard, small enough to fit on your robot, and it has a sticky backing that you can stick right on to your robot with no effort. Mini-Breadboard There are two disadvantages to the breadboard: they can be a little costly, and the connections aren't as secure as with a prototyping board. I wont be using the mini-bread board for this project, but if you plan to build more robots in the future, I suggest you to make an investment =P
    These are the parts I got from the DigiKey Order. Note the two grayish bags labeled 'Static Shielding Bag' on the bright yellow warning labels. This basically means that the components inside these bags are static sensitive, so be careful. Keep these bags, as they could be useful for your future electronics projects, or at least a good storage place for sensitive electronics.DigiKey Order
    Your battery is never a fixed voltage. Just because it says 6V doesn't mean it couldn't be 7V or 5V. This voltage always changes, and can cause havoc on your microcontroller and sensors. To correct for this, you need a 5V voltage regulator. What this does is ensures 5V will always be supplied to your sensitive electronics.Voltage Regulator The voltage regulator will have three pins: Unregulated Input, Ground, and Regulated output.
    The large capacitor is not entirely necessary, but is good to help reduce electric noise and keep the system powered during sudden power drains. Even a short lived sudden drop in power could reset your robot microcontroller (bad). The value of this capacitor doesn't really matter, but 100uF and above is a good starting point. More servos you use, the higher you want it to be. It should also always be rated twice that of your input voltage. Your input voltage is ~6V, so you would want it rated for 10V or 15V.Capacitor
    A second 0.1uF capacitor must go between GND and AVCC, as close to the microcontroller pins as you can make it. This capacitor is required to create a low pass filter for the analog-to-digital (ADC) converter.If you ever do high precision ADC measurements (unlikely), put a 0.1 uF cap in between AREF and ground as well. The point behind having the AREF pin is so you can feed it an input from a super-stable voltage source, and it will scale the ADC inputs from ground up to AREF with the full 10 bits of precision. Of course, you need to make sure none of your analog inputs go over AREF if you are using it like that. Capacitor
    The LED will be used as a status indicator. The LED is useful for knowing if your microcontroller is powered properly, and can output other useful information for testing purposes. A resistor wired in series is required so keep the LED from frying. Any resistor value from 10 ohm to 1 kohm will probably work. Higher resistance values reduce the power drain (good), but also decrease brightness (bad).Status LED Note that the two wires on the LED are different lengths. The longer wire is always + and the shorter is -. The LED is polarized, meaning they will only work if current goes the correct way. If you connect it in reverse, they will either fry, or just simply not work.
    The long black thing with pointy metal pins sticking out of it is called a male breakaway header. These things, useful for plugging in servos and sensors, can be easily broken to your custom length requirements.Breakaway Header To break them, you can either use your hands, or a pair of sharp snips or scissors also works. Break three of length 6, five of length 5, and one of length 3. Custom Length Breakaway Headers
      STEP-BY-STEP ROBOT TUTORIAL STEP 3b: CONSTRUCT THE CONTROLLER
      Step by Step Robot Tutorial
      Electronics, Continued Continuing from Step 3A, I will now show you the schematic we will use to build the circuit, followed by step-by-step instructions on how to wire your robot controller together.
      Now you need a schematic. A schematic is a wiring diagram that tells you where to attach wires to all the parts in your circuit. A schematic, to the uninitiated, can be a little overwhelming at first.So instead of possibly confusing you, I invented what I call a colored dot schematic. I'm willing to bet a 3 year old can understand this enough to build the circuit . . . (apologies to all 3 year olds reading this tutorial) Click the below image to open up an enlarged version. As you can see, I color coded each of the pins to determine which wire goes where. For example, all red dots should be connected to the + of your battery, and all purple dots should be connected together. If you're saying, 'gasp! I'm color blind!' Well, I numbered/labeled the pins too. Ill assume you know how to connect the dots, so I wont go into much detail into which wire goes where. =P Schematic (Click to Enlarge) Note: If you are a dot-o-phobe, you can find a visual $50 Robot schematic on this forum post. Now I must point out that this schematic (and the following tutorial instructions) is for if you decided to use an RC battery pack (or an assembly of batteries equal to 6V or greater). But if you went with the battery holder method, you must make the following changes:
      • A 9V battery must connect to the battery + of the voltage regulator andground of the voltage regulator.
      • The 4.8V from the battery holder must connect to the ground of the black capacitor and the servo power bus.
      • DO NOT connect the battery + end of the capacitor to the battery + end of 4.8V battery!!!!
      This is the slightly modified schematic for battery holder users. The blue circles with a red dot in the center represent the 4.8V, while the red only dots represent the 9V battery connection. All this means is that the servos use power from the 4.8V pack (which can supply a lot of power), while the sensitive low power electronics use the regulated voltage from the 9V battery. Remember that all grounds need to be common. If you have never soldered before, check google for soldering tutorials first. I've had a lot of practice soldering so I make it look a bit too easy. Feel free to practice on an unused part of your board first with scrap components. Also recommended YouTube solder tutorial videos. Now lets begin building our controller!
      As shown, place the DIP socket into your perf board. DO NOT add the microcontroller IC to the socket yet.It is not required, but I recommend copying the placement of all my components. If you look on the perf board, you will notice a number and letter grid system. This should be used as a guide to help you. DIP Socket on Perf Board Turn the board over and solder it in. To do so, heat up the pin for about a second or two, then add the solder second. Make sure each and every pin is soldered. Also, make sure the side you are soldering has the copper padding - this makes it much easier! Solder onto Perf Board If you don't own a soldering iron, you can get a cheap one for around ~$10. RadioShack also sells them. If you want to make an investment, get a soldering iron that you can adjust the temperature on, and get nice tips. Remember, if you overheat the iron and apply pressure on the tip, the tip will dull and bend.
      Place three of the 6 pin male headers as shown. These pins will be used in the future to plug in your robot sensors.Put Headers on Board Then turn it over and solder each pin in. Solder Headers
      In this step we will add more headers and a resistor (do one at a time!). I designed the programmer header for an older programmer version, so chances are you will need to convert it to the new 6 pin header. It is easier to wire, it just requires a bit more of thought. Just check the number of pins on your programmer cable to know if you need 6 pins or 10 pins. Add all Headers, Resistor First add the three 5 pin male headers and solder them in. Also, I want you to connect all the pins as you see in the image (or schematic). For the pins closest to the DIP socket, connect each one individually. For the outer rows, connect them in parallel, as shown. These parallel rows are your power buses (they 'bus' power around). Click on the image for an enlarged close-up. The pins will be color-coded to show how to connect them. Notice how I skipped a row for the 5 pin headers. Click to Enlarge Next add two more rows of the 5 pin headers at the bottom right. Solder those in (pic not included). This will be for the ICSP connector of the programmer. Note that if you are using the more expensive programmer, you should check out this post concerning the different pinouts of the programmer. Now bend the leads on the resistor into perfect 90 degree angles. Bend Resistor Add the resistor to the perf board, and bend the leads again as shown. Solder both leads, but DO NOT cut the leads! (not yet) Add Resistor to Perf Board
      Now add the LED as shown, slightly above the board. Make sure the longer lead (+) of the polarized LED is on the side closer to the DIP socket. Solder it in, but DO NOT cut the leads! (not yet)Add LED to Perf Board Turn the board over, and solder as shown. Click the image for an enlarged close-up. Red represents wires, and blue represents a connection with a pin. Reference the schematic if unsure. Notice how I bent the LED wire and resistor wire to connect several pins together? You can also use normal wire, but I use this method out of laziness and l337-ness all rolled into one. Make sure the wire doesn't touch the copper padding. Click to Enlarge You may now trim the leads.
      Now we will connect all grounds together. I like to use black wire to represent ground because it can save me a lot of confusion if my wiring gets messy. Click the image if you need an enlarged close-up. The blue coloring represents connections.Click to Enlarge Relax, you are already half-way done!
      Add the big capacitor and solder the pins in. Make sure that the longer lead is on the side closest to the DIP socket. Notice the (-) sign on the capacitor? This is the negative side, which should have the shorter lead. This is important because the capacitor, just like the LED, is polarized and only works plugged in the right way. Make sure the capacitor negative lead is inline with the male header row farthest to the perf board edge. Check the schematic if unsure. (DO NOT CUT LEADS YET!)Add Capacitor Add in the voltage regulator. Make sure you do it as shown! The middle pin of the regulator (ground) should be inline with the negative lead of the capacitor (ground). You may trim the three voltage regulator leads after soldering them in. Add Regulator Now add the 3 pin header. If you are using the single cell batteries (ie 4.8V battery holder), you would not need this header. But if you are going to use a RC battery pack, you could plug it directly into this three pin header. DO NOT CUT THE LEADS YET! note: There is a minor mistake I made here that I want to point out. For the 3 pin header, shift it one hole over to the right (from holes CDE to DEF). Have it so the farthest left pin is connected to ground and the middle pin is connected to power. Add Plug Now turn the board over and solder as shown. I bent the leads of the capacitor to use as connecting wires, but you can also make the connections using real wires. Be aware that these two wires will receive 100% of all current in your circuit - it could be several amps! Click the image to see an enlarged close-up (red for wires and blue for connections to pins). Click to Enlarge Note for those using the 4.8 battery holder: You want the power from the 9V only going to the electronics, and the power from your AA battery holder going only to the servos. They both share ground, but the + voltages are different and so shouldnt be connected. As such you need to make a small correction to the circuit. Please see this graphical representation. First, dont solder where the green X is. This seperates the two different power sources. Second, you want the large black capacitor to connect between ground and the servo power bus. Do not have it connected to the voltage regulator input pin. Third, attach the AA power and ground as shown in the graphical representation. If you are using a 6V battery pack, you can ignore this note.
      While you are at it, add in this purple wire. This wire will transfer the output 5V from your regulator to the middle row of the sensor power bus.Connect wire from Regulator Output to Sensor Power Bus
      Now we want wire up the Programmer ICSP Header (see schematic). I used thin yellow wire for this, so as not to confuse with ground or 5V power. Click to enlarge.Click to Enlarge
      Finally, we will add a ceramic capacitor (non-polarized) between pins AVCC and GND, and connect AVCC directly to AREF.Add Ceramic Capacitor Flipping it over, here is a close-up of the connections. Add Ceramic Capacitor You are almost done (yaaaaay!)


        STEP-BY-STEP ROBOT TUTORIAL STEP 3c: CONSTRUCT THE CONTROLLER
        Step by Step Robot Tutorial
        Electronics, Continued Continuing from Step 3B, I will now show you how to test your circuit to avoid serious failure, how to connect it to your computer for programming, and how to make your sensors.
        If you don't have the proper testing equipment, plug in your battery pack and pray to the robot gods that your circuit doesn't melt in a pretty fire . . .The first test is called a connectivity test. Get out a multi-meter and do a connectivity test to make sure the pins that aren't supposed to be connected aren't connected. If by chance you accidentally bridged power and ground, your circuit could spark and your batteries melt. If you put the multi-meter on the resistance setting, make sure all non-connected pins have at least 5 kohm resistance or you may have power issues. You may need to get your soldering iron back out to fix any potential problems you find. Connectivity Check Then do what I like to call a 'smoke test.' This is when you power up your circuit with a power supply. Plug your circuit in, start the voltage at 1V and work your way up slowly to 6.5V. The current draw should be under 50mA. If you see a huge current draw (or smoke), there is a mistake in your circuit so turn off power immediately. Otherwise, at 6.5V, get out your multi-meter again and check voltages on all the pins to make sure everything is working. Smoke Test The sensor bus should read 5V (as long as the input is greater than 6V), while the servo bus should equal your battery voltage.
        Plug in the black ATmega8 IC (finally, eh?). Be careful of static electricity. You may also have to bend in the pins so that they all go in. Be patient while doing this. After the pins are in, push the IC into the socket carefully.Plug in ATmega8 IC
        Plug in the battery. For the 6V battery pack, just plug it in to the 3 pin male header. Remember to verify that the black wire is going to ground and the red wire to power! I was dumb and didn't . . . but was also lucky that nothing fried (the regulator provides some reverse polarity protection, apparently). Check the schematic for reference.Plug in RC Battery For the battery holder method at 4.8V: Solder in the black wire to ground and solder the red wire to the servo power bus. Check the modified schematic if you aren't sure. Plug in Battery Holder For the battery holder method at 4.8V: Then with a 9V battery, attach the - to ground and the + to the voltage regulator input. A good method is to remove a 9V battery connector from an old toy (or buy cheap from RadioShack) and directly solder the wires onto your perf board. Plug in 9V Battery
        Now we will plug in the programmer. On the end of the programmer is the ICSP header (the black boxy thing). Look for a triangle on the front of it, as in this picture. This arrow marks pin 1.ICSP Header Triangle Plug in the header as shown. As always, if you aren't sure, check the schematic. The arrow side should be closest to the ATmega8 IC. Plug in Programmer To finish the connection, plug in the other end of the programmer into a serial port of your computer. If your PC does not have a serial port (such as my Dell laptop), you will need to buy a serial-to-USB adaptor cable (~$15, left cable in picture). Optionally, you may also want to buy a serial extension cable (~$5, right cable in picture). Plug Programmer into Computer The extension cable is great if you want to keep your robot plugged in while it runs around (for sensor output by serial, etc).
        Your servo should have three colored wires: red goes to the + of your battery, black goes to - of your battery, and white (or sometimes yellow) goes to a digital output pin on your microcontroller (for the control signal). Again, if you would like to learn more about servos, check out the servo tutorial.HS-311 Servo And if you haven't figured it out yet already, plug your servos into PD0 and PD1 (pin 2 and pin 3). The black wire of the servo goes to the ground power bus (the one furthest away from the ATmega8). Plug in Servos Congratulations, you now have functional robot brains! Yum!
        Now you must make two photoresistor sensors. Go to the photoresistor tutorialand follow the detailed instructions. I used a 1.5kohm resistor for R with the middle sized photoresistors in the RadioShack kit, but your situation might be different so you might want to recalculate your R value.Finished Photoresistor Sensor You dont need to do the crimping method described to make this sensor, but its a more professional method and makes your sensor more modular (can be scrapped for future robots). The disadvantage to it is that the crimping tool can be a little expensive.
        Now attach your photoresistor sensors to the robot. I used packaging tape, but any method would work. Make sure the sensors are evenly spaced and at a decent angle. Later, when testing your robot, you will probably need to adjust the position of the sensors. I also tried poking holes into the bottle for the sensors to stick out of, but the sensors didn't stay put.Mount Photoresistor and Circuit Board Now plug your sensors into your circuit board, and mount your board onto your robot. Personally, I recommend using the four big holes in the perf board corners to screw your board into your robot. But I was lazy and just stuck it into the water bottle. The problem with this lazy method is that its difficult to attach your programming cable to your robot when the circuit board isn't mounted properly. I expect you to mount it properly =P Finished $50 Robot! You will probably have a huge jumble of wires sticking out above your robot. This is bad design because wires could jostle loose or get tangled on something. Get a twist-tie from a bag of bread and use it to tie the wires together, as shown in the above image. Your robot is almost complete! We just need to program it now . . .
read more "Step-3"

Followers