# Beginner questions

Status
Not open for further replies.

#### mattg2k4

##### New Member
My high school is starting a robotics club next school year, and we need some info on getting started. The robots will be (hopefully) competing in the USFirst competition ( www.usfirst.com ). If you know of any other competitions we should look at, tell us please.

What I want to know:

As far as sponsors, we plan to ask Office Depot and Radio Shack. What other companies in Southern CA are good prospects? How much money do you think we should shoot for our first year? We were thinking around $1,000 if we can swing it. What are good places to buy the components, such as motors, sensors, and electronics? We know a bit about electronics, but not enough robot-specific. What is a good way to control motors? From reading posts here, an H-bridge looks like a good project. What about MOSFETs? Would either of these allow for speed control? A PIC microcontroller seems a good choice for a robot's brain, but there are so many of them, which one should we get? Any good info on physical construction is appreciated, since we only have experience with lego robots. We should have access to an arc welder if all goes according to plan. Any helpful suggestions for some beginners would be really appreciated. Thanks! Edit: We don't want to make a single robot for that competition, we want to make as many as we can. One project suggested that we hope to do is a line-following robot. #### Doug3737 ##### New Member lotsa questions... but I'm interested in this to if someone would take the time to answer them #### Scubasteve ##### New Member Matt, It sounds like you are just starting out with this, it is good to see that you are interested. You need to do a lot of research on the internet, do some searching. Those questions are too broad to answer completely and there is plenty of information on the internet to keep you busy for a very long time. Instead of trying to figure out how a MOSFET can be used to control a motor, try to learn what a MOSFET does on its own. Learn how a motor works. Then tie the peices together, it will all make sense. It is quite clear that you are a beginner, and this will make it very difficult to get any sponsors for your robot. Companies only invest in people with a lot of technical knowledge and experience to back them up. It is best for you to do some fundraising around your school and to find surplus motors and mechanical parts, it would save you a lot of money. Steve #### mattg2k4 ##### New Member It's true, we're all beginners 8) Pity about companies not wanting to invest in newbies.. perhaps some more local-type stores would be willing to contribute. I know a couple fairly well-off and generous people who I could count on for a bit of contributions. Anyone who has experience at fundraising, give us some ideas. Our school has two typical fundraisers, running the lunch carts and selling candy. Both will get money, and we'll do both, but we don't have too many people in the club, so we'll be looking for some fundraisers that offer a higher yield per person. Maybe create two line following robots and have a race with us raking off a percentage on the bets? Any ideas would be great. As for finding "surplus motors and mechanical parts" where should be look for these types of things? I can't think of any store besides radioshack that carries electric motors. We would really like to spend the least amount of money possible, so any help finding cheap components is great. We'd like to order our microprocessor ASAP, as in sometime in May, so we can start learning to program and experiment with it. Since we've never used one before, we aren't sure what features to get. Like how much memory should we get? We'd like a good number of I/O pins as well, at least 8 I'd think, for at least two motors, and several touch/proximity sensors. I mentioned the PIC before, but I understand the basic stamp is also common in robot control. Any recomendations as to which microprocessor(s) to buy would be really appreciated. #### pebe ##### Member mattg2k4 said: ...........We know a bit about electronics, but not enough robot-specific. What is a good way to control motors? From reading posts here, an H-bridge looks like a good project. What about MOSFETs? Would either of these allow for speed control? A PIC microcontroller seems a good choice for a robot's brain, but there are so many of them, which one should we get? Any good info on physical construction is appreciated, since we only have experience with lego robots. We should have access to an arc welder if all goes according to plan. Any helpful suggestions for some beginners would be really appreciated........ This is a good source of circuit theory and know-how. http://4qdtec.com #### Scubasteve ##### New Member Hey Matt, If you know some wealthy and generous people, go for it! Also, some more successful local stores might be able to support you with your projects. Microcontrollers sure are handy when you know how to use them, I am just getting into programming for a project I am working on. There are tons of families of microcontrollers that you can use, you just have to choose one that is appropriate for your application. These specs. include processing speed (MIPS), processing power(8-bit, 32-bit?), memory (ram, sram, flash) size, I/Os, interrupts, on chip peripherals (timers, SPI, I2C). Then you need to figure out how to program them. The best bet is to find a new controller that you can solder or get a development board (www.olimex.com has some controllers with their crystals and I/Os easily accessed) with in-system programming capability. These are the cheapest programmers you can get a hold of, and they can still program powerful devices. Also, you need to learn a language of choice for the controller. You can either choose to learn a low-level language or a higher level language. The lower-level language is the most tedious to work with, it is basically doing assembly instruction at a time that you specify. For more information on this, check out a controller from the various manufacturers such as www.microchip.com www.atmel.com www.ti.com www.national.com and the list goes on, and read the datasheet on the programming language. It gives you the proper syntax and how to use each instruction. A higher level language involves using a compiler for a different language such as BASIC and C. This is pretty much the easiest way to make a complex program, but it will run less efficient for code space then assembly language. I am using a www.mcelect.com (i think that is right) BASCOM AVR BASIC compiler, which is extremely easy to use. If you could consider using straight logic to control the line follower, then do it. You cannot beat the speed of logic on a controller, but it isn't as robust and you might need to make a change. For motors, don't go to Radioshack, their stuff is garbage. Search for surplus electronics motors at www.google.com and you'll see some places which will have some nice motors for cheap. You don't need a massive motor to do what you want. Goodluck, Steve #### mattg2k4 ##### New Member Thanks for the input Scubasteve, and for the site pebe. Memory and I/O's on a chip are pretty straightforward. But processing speed and power, peripherals, and interupts aren't so self-explanatory. What should I consider when choosing speed and power? Typically more is better, but I'd rather only pay for what I need. What are interupts used for? For a touch sensor perhaps that warns the robot it's about to hit a wall? I understand timers, but what are the SPI and I2C peripherals mentioned? Thanks for all the help #### Scubasteve ##### New Member Sorry Matt, Much of what I said is irrelevent to your application, I just trying to emphasize the variety of microcontrollers available. You do not need much to do this. An interrupt would be useful for you to use. It does exactly what it says.. It can be used as an input to halt a program whenever it occurs and to execute a new program then it will return to the main program loop. The SPI, I2C, etc. are communications protocols, which aren't very useful in your application. You only need an 8-bit microcontroller for this.. I am not sure about MIPS, but you don't need a lot. If I were you, I'd just get a more beefy controller then what you need. They aren't too much more and they allow for expansion and a lot of flexibility. You can afford to be inefficient with your code, and etc. Checkout that BASIC compiler (AVR or 8051) and checkout the instruction manual on the site. It will explain how to use each command with proper syntax. You will need a programmer.. I am ordering an ISP programmer from www.atmel.com 's distributors soon. Once connected, it can program your code in directly and you can run the controller to see how it works. Since this isn't too complex, this method is okay. No real need for simulation unless you are willing to see how it works. I think it would cost around 10$-15$for a nice microcontroller(DIP PACKAGE!) with some support components (~10$, crystal(throughhole), caps). You need a good breadboard that you can work with and some wires. If you can find a DIP to 0.1" header (2 X 5) adapter, then you will be set once you get the ISP programmer. You will need some LEDs for logic indication and maybe the use of a scope to see what is going on sometimes. Of course you will need an ultrasonic transducer with a drive transistor. There are circuits all over, just take a look for something along those lines. Also, I am assuming you have a 5V power supply to work with...

Once you get all of this, which will set you back a bit, future project development will be easy. You can always go the Basic stamp route which is around the same money, but there are some more features on their development board. The price of each stamp is quite expensive compared most atmel controllers, with not much more performance and benefits.

Someone out there might have a better solution, but this is the way that I would do it.

Steve

#### speedingpenguin

##### New Member
botball? anyone heard of that? maybe its just around here...
search google for botball and i'm sure it will say something

#### lavenatti

##### Member
If a line following robot is what you want, why not start with the chassis from a remote control car? I've done this and the work and money you save are incredible. By the time you buy your motors and batteries and material to fabricate a chassis you'll have spent a pretty penny and lots of time. A remote controlled car with the electronics stripped off makes a great base for what you want to do.
Make sure the car you get actually steers in both directions, you're going to need a toy in about the $30-$40 dollar range to make a decent line following robot.
I'm a big fan of the PIC microcontrollers. Especially if you have one of the basic compilers available (and a programmer). They are easy to use this way and about one-tenth the cost of a basic stamp. I'd recomend the PIC16F877 it's way overkill for what you want but leaves plenty of pins available for extra features you may want to add.

#### para_cavern

##### New Member
check out www.tech-supplies.co.uk, www.maplin.com (or .co.uk) or radio shack for components. It is possible to control speed of a motor using a MOFSET but a polar type of transistor would usually be cheaper (n-p-n,p-n-p). Tell me what other info you require as i am very knowledgable on this subject. You can e-mail me directly as [email protected] :shock: [/img]

#### mattg2k4

##### New Member
Thanks for that suggestion lavenatti, but we've already purchased the components for our robot. We are using the batteries and motors from an RC car though, so we're meeting your suggestion halfway :wink:

I'm actually trying to learn microcontrollers at the moment using a PIC16F628, but it's not progressing very fast. I put it off during end of the year exams and haven't gotten back to it yet. All I've actually managed so far is the blinking led. I'm looking through amazon for some good books, if anyone has input on good books for microcontrollers, I'm definitely interested. But this robot will be controlled by comparators on the light sensors. It won't steer nearly as smoothly, but it's a heck of a lot simpler and I already know how to use comparators.

Right now we're using transistors for the motors because they're cheaper and I've got plenty lying around. It would be nice to use MOSFET's eventually though, since they don't drop as much voltage and generally are rated for more power. This first build won't have speed control, just on and off, but in future builds I think we'll use PWM. One thing I'd like to be able to do though is have the motor brake. I seem to recall that if for a DC motor the two connectors are shorted, it will brake, right? If not, what's the way to do it?

#### Scubasteve

##### New Member
Hey Matt,

You are right about the braking function, all you need to do is short the windings. The voltage generated is fed back into the motor, which causes it to reverse.

I have settled on a simple BASIC compiler for AVR microcontrollers called BASCOM AVR for my programming needs. It is quite simple to use and can be very powerful, but it is not as efficient as assembly. There is a course I am taking in school soon to learn assembly and all of that fun stuff.

Steve

#### dr_scrapper

##### New Member
First USE THE AT89c2051 very easy code...
They have all the pdf files you need to read to understand how to work with that, you just need to have a programming kind of mind WHICH IT ONLY APPEARS IN SOME PPL ( when i was 17 i thought that didn't exist everybody kould programm, IT ISN't true i meet some ppl that it is very HARD to programm for my is quite simple) and some minor eletronic knowledge!! if you have the commands datasheet you kan do a lot, maybe i kan help you kreat baud-rates and turn INTERRUPTS ON! Stay kool

:idea: www.atmel.com try to find documentation in 8051

#### Occult

##### New Member
I just wanted to make something clear. You said you were interested in entering the USFirst competition. That's great. I've helped out with USFirst and it's a great experience.

#### joi

##### New Member
I'd like to congratulate you. You have picked out the most difficult, time consuming and
sophisticated hobby on earth. But on the other hand, this is the most fun hobby one can
imagine.

I'd just like to advice you that you shouldn't be too agressive in this hobby. As said before,
it's difficult and time consuming. Like with myself; I had been reading books and internet
posts for more then two years before starting to build my first robot..

I also learned that it's good to start on small projects.

check out http://www.dprg.org/ Although I don't live in Dallas and am not a member of DPRG
their webpage was of great help when I was starting.

Have fun!

#### evert

##### New Member
If its a problem for u to find out what models of PIC u shuold pick (sorry)
U can looking for some particular interesting features.

Some PIC-models have something called H-PWM.

It means that the microcontroller have an or several outputs the user can configurate as a PWM-output. With H-PWM (Hardware-PWM?), the microcontroller can work with another tasks more easy. So in first place u should look for a PIC with 2 H-PWM or more.......and think about the input interface.......do u need AD-converter? .......and so on. I the end u will find out what PIC u need :?

Status
Not open for further replies.