Hobby Project: Where to get stuff and how much to expect to spend?

  • Thread starter Thread starter TylerH
  • Start date Start date
  • Tags Tags
    Project
AI Thread Summary
The discussion centers on building a small wheel-based robot and the components needed, particularly focusing on obtaining a PIC microcontroller. Participants recommend using suppliers like SparkFun for purchasing PICs and programming tools, noting that the PICAXE offers a simpler entry point for beginners, albeit with some language restrictions. They discuss the necessary configuration for getting a PIC running, including setting up the oscillator and watchdog timer, and emphasize the importance of using motor drivers for controlling motors effectively. The conversation also touches on the affordability of components, with suggestions for keeping costs low while still achieving project goals. Overall, the thread provides valuable insights into sourcing and configuring microcontrollers for hobby robotics projects.
TylerH
Messages
729
Reaction score
0
Basically, I want to build a small wheel based robot. I can get a range finder, the soldering thing, the wire, the solder, and so on. But what I can't find is a PIC. I could probably manage to stay below a few KiB of memory, but would need 6-8 IO pins. Who would sell me a single PIC(with necessary tools) for a good price usable for some simple programming?

I don't want to waste a lot of money just screwing around. How much can I expect to need to buy the PIC(along with flasher etc.)?
 
Engineering news on Phys.org
I'm a big fan of www.sparkfun.com

They sell PIC micro's, the PICAXE (which you may want if you're new to this), and necessary programs although I recommend you get a Pickit 2 or 3.
 
That's exactly what I was looking for, thanks! I was beginning to think everyone only sold this stuff in bulk.

I noticed the PICAXE programmer is a lot cheaper. Does the PICAXE restrict you to BASIC, or is the BASIC just an option among others? I'd really prefer C, or maybe assembly.

Assuming it does restrict language options, and I get the PIC. How much initialization is required to get a PIC into the normal running state? For example, do I have to configure RAM(like the BIOS does with x86)? I know I have to configure everything I put on the board with it, I just mean stuff that is part of the microcontroller itself.
 
PICAXE only let's you use a very high level BASIC language as far as I know. The PICAXE substantially reduces the learning curve for micro-controllers using the BASIC compiler and a bootloader already loaded onto the chip.

If you want to use regular C, Microchip's MPLAB is the classical option. But since you appear to be new at this, I would recommend using the PICAXE.

Yes, there is some configuration that goes along with using the PIC. Things like the main PLL, the PBPLL, oscillator modes, watchdog timer, etc all need to be configured but MPLAB can will also provide a default configuration. You can configure the memory if you're doing things like an ROTS or want to change how the thing starts up although that commonly isn't done.
 
The Arduino uses C but modified to handle the many input/output functions.
The home page of Arduino is this one:
http://www.arduino.cc/
Or, you can buy them here:
http://www.sparkfun.com/search/results?term=arduino&what=products
They are not cheap, though.

Picaxe chips come in various sizes but all (except the optional surface mount ones) have the standard 0.1 inch pin spacing. So, you can solder them into circuits or put them in sockets and program them with a simple interface to your computer which only involves 2 resistors and an old mouse cable.

The language is very simple and there is on-screen help and debugging for getting syntax right. It is like Basic, but most of what anyone does involves the I/O pins, so the actual language doesn't matter much.
Arithmetic is Integer, meaning no floating point.

These are also available as above:
http://www.rev-ed.co.uk/picaxe/
http://www.sparkfun.com/search/results?term=picaxe&what=products
http://www.phanderson.com/picaxe/
As you can see, the chips themselves are quite cheap and elaborate boards are nice but not necessary. You could get started for under $10.


If you want to get results quickly, one of these systems would be worth considering. For example, to get a delay of 1 second (1000 mS) with the Arduino, the command is
delay (1000)
With a Picaxe, it is
pause (1000)
In assembler, it involves much shuffling of registers and accumulators just to get a simple delay which you would use to flash a LED on or off, for example.
 
I will put in a plug for the Mark III robot:
http://www.junun.org/MarkIII/Store.jsp
which includes a programmed PIC chip to run it.

Depending on how convincing you are you may be able to get samples from microchip.com (the PIC mother ship), and they do have a complete C compiler suite you can download.

Also digikey.com will sell anything in any quantity with a (IIRC) $25 order minimum.
 
If you're in Canada, the aforementioned PICAxe and Arduino (and others), along with motors, gear boxes and such, are available at SolarBotics, a little robotics hobby store:
http://www.solarbotics.com

It's lower level, but the ATMEL AVRISP mkII programmer (programs many ATMEL microcontrollers, usually fairly reliably) is around $40. Unfortunately, if you set the fuses incorrectly (or have incorrect crystal / oscillator input) you can brick the microcontroller, which requires using a more advanced programmer (e.g. the STK500) to unbrick.
 
I'd say what you have decided on should do you fine.

However...

If you can handle the extra pins and connector, I suggest that you go the In Circuit Serial Programmable (ICSP) route: A) You don't have to keep switching the chip in and out of the target so development iterations go faster, and B) you can program devices where you _can't_ get them in and out of the target, like surface mounts and boards buried deep in robots...

Also the 18F series PICs are somewhat more capable than the 16's for about the same money if you a doing low volume you might as well not skimp on the PICs.
 
  • #10
I plan on keeping it pretty simple, so the in circuit programmablity isn't going to be necessary, I hope. Also, I imagine the extra circuitry for that could get complicated, for a beginner.

While looking into motors, I noticed in the "Related Products" list a "driver", are drivers necessary, or can I control a motor through the I/O pins on the PIC itself? By control, I mean have a loop that, during each iteration, sends output to the pin connected to the motor, and loops until it's gone far enough.
 
  • #11
You may need drivers. The pins on PIC chips can typically provide 5 volts at about 20 mA and this would not usually be enough to run a motor.

If it is just an ON/OFF control, you could control a relay via a small power transistor and switch the motor with the relay contacts, or you could control the motor directly via the power transistor.

Schip666's suggestion:
I will put in a plug for the Mark III robot:
http://www.junun.org/MarkIII/Store.jsp
which includes a programmed PIC chip to run it.
This is a great source of rare components. I've bookmarked it already.
 
  • #12
Dumb question, I know. But which kind of transistor would that be? In terms of NPN and PNP. Or am I completely off?

I don't know how transistors work, or even what they're for. Not because I haven't tried to learn, but because most information on them is mostly inaccessible. Basically, from what I can gather, they are switches. My current understanding is that, they have 3 "pins", one for on/off, one for the ground, and one for the thing to be switched on/off. I also believe that sending power to the on/off pin sets it to the opposite state. Is this correct?
 
  • #13
[PLAIN]http://dl.dropbox.com/u/4222062/relay%20driver.JPG

If you had a circuit like the above and connected a positive voltage to the resistor at the left, you could start increasing the voltage from zero, nothing would happen until you got to nearly 1 volt.

Above that, current would start flowing into the base of the transistor and then to the emitter, but a much larger current would start to flow through the coil of the relay, to the collector and then to the emitter. Eventually, enough current might flow to make the relay work and switch the contacts. These can then be used to switch some other circuit like a motor or some lights.

The important thing about this is that a very small current is able to control a much larger one.

So, you could have the output of your processor controlling the much larger current of a relay coil or even a small motor.
 
Last edited by a moderator:
  • #14
OK, here we go... motors ...

Perhaps you said what motors you are interested in already but I'm to lazy to look. You have a number of choices, almost all of them will require a "driver" of some sort.

The simplest driver is as shown by vk6kro above -- note that you can put a DC motor in place of the relay if the power requirements fit the transistor's abilities. Unfortunately this circuit will only operate the motor in one direction -- if you want reverse yer out'o'luck. A fancier circuit that allows for bi-directional operation is an "H-bridge", and for lower powers you can get a chip like the L298 that does it for you.

Or you can go more advanced and use stepper motors, or commercial servo motors with control boards like those made by geckodrive.com. However, now we're talking money and a lot more circuit experience...

Which brings me back to the Mark III and it's ilk. Many small robots use what's called a "Hobby Servo" motor that has been modified. Normally a hobby servo is used to control the angle of flaps on a model airplane, where the "servo" portion refers to an internal feedback circuit that measures the angle of the output. The beauty of these beasts is that they are little DC gear motors that have a built-in driver, so you can run them directly from a PIC output pin. They can be hacked in order to run continuously with variable speed, rather than just go to a certain angle. Instructions for this use are on that MarkIII site someplace.

The downside is that once you do the hack they are no longer servo motors. This means that you don't know exactly how fast they are running, or how far your 'bot has gone. You may think you don't really care, but trying to get that MarkIII to go in a straight line at a slow speed is a bit of a challenge. To this end I have instructions for "re-servoing" them with an optical encoder here: http://www.etantdonnes.com/ROBOCAR/encoder/

That last re-servoing bit is for your second time around, but it's an example of the endless optimizations and improvements in which you will eventually become mired should you decide to take this challenge...
 
  • #15
schip666!, as "fun" as that sounds, I think I'll take the easy route with the transistors. :) Thanks for the info though. It's not that I don't want to do it, it's the money I'd have to spend to get all the stuff necessary. I've already almost hit the $100(as small as it sounds, it's a lot when you're in HS, with no job) mark for a totally for-fun project. I found some tank tracks(very small turning radius), so I SHOULD be able to do a 180 when necessary.
 
  • #16
I think PIC microcontrollers should not be so difficult to get. You don't have to buy in bulk if you don't want to. You simply find electronics stores which sell parts. Of course if there is one in your neighborhood or in your city. You can also order online since there are lots of them selling these stuff.

And of course you are going to need a PIC programmer. A good one the Cana PIC Programmer Kit With USB port. The ZIF socket also makes it easier to insert and remove.
 

Similar threads

Replies
13
Views
2K
Replies
3
Views
4K
Replies
10
Views
3K
Replies
13
Views
4K
Replies
11
Views
7K
Replies
17
Views
14K
Replies
27
Views
16K
Back
Top