The Best and Worst Microcontroller Kits

Selecting the right microcontroller kit may seem like a daunting challenge, mainly because there are hundreds of kits to choose from. Here’s a list of the best and worst microcontroller kits to help you guide your way!

Microcontroller PIC

These 8 bit microcontrollers are by far the simplest and cheapest microcontrollers available. Being 8 bits, these microcontrollers aren’t very good at floating point arithmetic, but are good at many other tasks. You can even build an El Cheapo Programmer for these microcontrollers for a couple dollars, which is very cheap. Use these microcontrollers if you have a fairly simple project, and you don’t mind programming in assembly language. There is a C compile available, but that costs money. You can buy a microcontroller and make a programmer for less than twenty dollars.

Microcontroller PIC32

These microcontrollers are simply awesome. PIC32 microcontrollers have every interface you can imagine, including CAN, I2C, SPI, RS-232, and more. As a bonus, there are usually plenty of I/O pins to satisfy even the most complicated projects. Of course, being 32 bit helps out with floating point arithmetic.

MAKE Controller Kit

The MAKE controller kit is a decent microcontroller with plenty of I/O pins. The controller kit makes it easier to get access to all the pins on the chip by using easy access terminals. Many other microcontroller kits make it much more difficult to gain access to all the pins. The cost is about $110.

Thames & Kosmos

This microcontroller kit is for kids age 12 and up. Most websites sell these kits for $150, but I’ve found some websites which sell the kits for as low as $120. These kits are pretty expensive for what you get, but this is definitely the most kid friendly kit around. I would not recommend buying this kit if you a professional engineer.

BASIC Stamp Kit

Okay, I have to be honest about this one. In my opinion, the BASIC stamp kits aren’t very good. Stamps are very small, very simple microcontrollers, and you use the BASIC language to program them. Sure, they’re easy to program. Unfortunately, these microcontrollers seriously lack in features. If you’re doing a project which requires many I/O pins, or communicates over a bus protocol like I2C, I wouldn’t recommend a BASIC stamp kit. These kits are usually cheaper, but sometimes it’s better to pay a little more and get a decent microcontroller kit.

Posted under Saving Money, Shopping, Technology

This post was written by admin on December 13, 2008

Tags: , , , ,

How to build a speed detector for a coilgun project

If you are building a coilgun (or gauss gun) or rail gun, a necessary part of your project will likely be some sort of speed detector. Getting a coilgun to work is rewarding, but you can’t continue the project without a reliable, accurate device to measure speed. A speed or velocity detector allows you to objectively quantify the performance of your gun. Given this information, you will hopefully be able to tune your project for maximum performance. For example, you can double the size of your capacitor bank and see if there is an improvement in final speed or not. Or, you can use different projectiles and see which ones go the fastest, or which ones have the greatest amount of kinetic energy (you will also need a weight scale to determine kinetic energy).

Here is my speed detector for my coilgun project:

This is quite simple and very cheap to build. In order to build it, you will need two infrared LEDs and two infrared detectors. These are readily available from Radioshack. You can probably buy them for a cheaper price from Jameco or Digikey, but then you would have to pay and wait for shipping. I built my project from two scrap pieces of wood and a piece of metal. As you can see, I didn’t even bother to cut the two pieces of wood to the same length because I’m lazy. You will also need to buy a PIC microcontroller and prototype board. The prototype board is readily available from Radioshack; however you will probably need to order the PIC microcontroller from Jameco or Digikey. The only other specialty components are LM339N and a BAR LED, both available from Radioshack for a fairly cheap price. One last thing I would like to mention is that since you will need to buy a PIC from Jameco, it would probably save you money just to buy all the components from Jameco, with the exception of maybe the prototype board.

How the speed detector works

The speed detector I designed is extremely simple, which is why I’m sharing it with you. There are two sets of infrared emitter and detectors. The emitter is always on. As soon as an object breaks the first beam, the first infrared detector no longer detects a signal. The signal from the infrared detector is analog, not digital. To help interface it to the PIC microcontroller, an op amp is used. This brings the signal to either a full zero or one. This signal is then sent to the microcontroller. Some microcontrollers have ADCs built in, but I would still recommend using an external op-amp such as the LM339N to produce a cleaner trigger signal. For my project, I used a PIC16F627, but there are many microcontrollers you can choose from that will work fine. I do recommend PIC16FXXX microcontrollers because they are very cheap, and you can even build a PIC programmer yourself. One thing that is important is to keep the infrared detectors in a dark place. As you can see, a piece of paper is covering the first detector, and a metal plate is covering the second detector. This helps to get cleaner signals and block out unwanted infrared radiation.

As soon as the processor detects the pin goes low, the software enters a counting state. In this state, the PIC microcontroller simply starts counting from 0. The current value of the counter is always displayed on the BAR LED. When you’re designing your detector, you have to keep in mind how fast you expect objects to pass through, and how accurate you want your results to be. In my case, results are only 8 bits accurate, but that is more than sufficient to get reliable and accurate data for a coilgun project. During the counting phase, you will need to carefully tune how fast the microcontroller counts. Because I’m only using an eight bit display, the counter will overflow very quickly. Therefore, it is necessary to intentionally add delay into the microcontroller program to count at a rate where you don’t expect there will be any overflow. For example, if you don’t expect objects to travel slower than 2 meters per second, you can use that fact and the length between the two detectors in order to figure out how many clocks it will take before overflowing. And oscilloscope is very useful to ensure your microcontroller is counting at the correct rate. Otherwise, all your data will be wrong. Verifying the counting frequency with an oscilloscope is necessary because it is too fast for a human to see. My microcontroller operates at 7.15 kHz.

Once the projectile breaks the second infrared beam, the program stops counting and displays the final count on the BAR LED. You will then have to use good old fashioned math to determine the final velocity in meters per second. I wrote a quick C program to do this, but you could also use Excel to create a simple lookup table.

Posted under Technology

This post was written by admin on September 28, 2008

Tags: , , , ,

Using GPIO for I2C

Originally, this website was dedicated to methods for saving money in your every day life. While I still post those types of articles, I will also start posting a series of technical articles.

This article is about whether or not you can use GPIO pins, or general purpose input / output pins in order to communicate on an I2C bus. The answer is yes! For electronic hobby projects, I2C is an excellent bus protocol to use due to simplicity, ease of debugging, and extremely low cost of bus components. Another great feature of the I2C bus is that there is no minimum speed the bus has to operate at. Simply put, this means that it doesn’t matter how slow you send a message on the bus. This makes it extremely easy to debug, and usually doesn’t even require an oscilloscope to fully debug any problems you might have with the bus. There are two wires of importance in I2C. These wires are the clock and data wires. In order to use GPIO to communicate on the I2C bus, you will need to have exactly two GPIO pins dedicated to I2C. Please note that if you are doing more complicated tasks involving multiple bus masters, then you may need to use additional GPIO pins, but the vast majority of projects only require one bus master, presumably some sort of microcontroller or microprocessor.

The next common question that comes up is how to write the software to communicate with the I2C bus via GPIO. There are two ways to do this, assuming whatever microcontroller your using doesn’t have a built in I2C module (which is why you would want to use GPIO in the first place). The first method is called bit banging. Simply put, the software writes data to the GPIO pins one pin at a time, delays for a short period of time, and then proceeds to write the next piece of data and so on. Often, empty for loops are used in order to create delay between changing the GPIO pins. This is because I2C generally needs to operate below 400 kb/s, and most microcontrollers operate at several megahertz. Therefore, it is important to set the for loop to count to a high number so that the bus isn’t too fast. It is also important not to change the data and the clock pins at the same time because this may create timing issues. Instead, change the clock pin, delay, change the data pin (if necessary), delay, and so on.

The disadvantages of bit banging are that while the processor is communicating on the I2C bus, the microcontroller can’t do anything else. This is because the processor is busy executing empty for loops to intentionally delay the I2C signals. However, if you communicate on the I2C bus for only short periods of time, this con may be more than acceptable for your project.

Another technique is more complicated. First of all, if you don’t have an operating system running on your microcontroller, your only option will be to use a bit banging technique. However, high power microprocessors often have a reduced version of Linux which is loaded onto them. To communicate with I2C, you may create semaphores or threads, which are executed repeatedly on a timer. This is generally a better approach than bit banging because it allows the processor to schedule other tasks in between changing or reading the GPIO pins. However, this is only useful if you have an operating system with a scheduler. If you are unsure whether or not you have an operating system, chances are you do not have one. In either case, bit banging is the simplest approach to use I2C with GPIO pins.

Posted under Technology

This post was written by admin on September 25, 2008

Tags: , , , , ,

El Cheapo, the cheap way to program a PIC microcontroller

If you ever wanted to do a project involving microcontrollers, the first thing you need is a microcontroller, and programmer. Many commercial PIC programmers exist. These programmers cost anywhere from 25 to 250 dollars depending on how many different PICs are supported and how greedy the manufacturer is. In my other article, I gave a great review for the Microchip PIC32 starter kit, which includes the chip, programmer, and debugger. Best of all, it connects to your computer via a USB port, which is excellent since all modern computer have USB. The PIC32 starter kit only costs 50 dollars, which is more than reasonable.

However, there is a cheaper alternative if you are truly trying to save money on your hobby project. The cheapest way to get a PIC programmer is to make one yourself! The design is called El Cheapo, mainly because all the components together cost less than 10 dollars. Luckily, El Cheapo is extremely easy to make. Schematics of the programmer may be found by their original creator here.

What does this programmer look like? Here are some pictures I’ve taken of my El Cheapo programmer which I built.

Unfortunately, the El Cheapo programmer connects to your computer via an LP-25 printer port, which many computers do not have because it is now obsolete. If you’re thinking about building a PIC programmer yourself, be sure that you have a printer port on your computer. Otherwise, it’s best just to get a starter kit from Microchip which has a USB connection.

Posted under Saving Money

This post was written by admin on September 13, 2008

Tags: , , , , , , ,

The cheapest, best microcontroller for hobbyists

Have you ever wanted to do a cool microcontroller project, but found yourself confused as to which controller to get, which programmer to get, or what software to get? Maybe you wanted to do a microcontroller, but found out that it’s simply too expensive. Well, today you’re in luck, because I’m going to review the perfect microcontroller for nearly all hobby projects.

When I first started looking for a suitable microcontroller for my project, I ran across Radioshack’s BASIC stamp microcontroller. The things were awfully small, had very few GPIO pins, had very little compute capability, and were extremely expensive. Overall, I would not recommend BASIC stamps to anyone unless you have a serious desire to avoid learning assembly language. For me, learning is half the fun!

 

So what is the absolute cheapest, overall best microcontroller starter kit? The answer is Microchip’s new 32 bit pit starter kit! Microchip’s PIC series of microcontrollers have been extremely popular for over a decade, but never have I seen a cheaper starter kit available.

First things first, this is pretty cheap and can save you a lot of money and frustration. It comes with the microcontroller, programmer, debugger, and software. Best of all, the kit only costs fifty dollars, which is extremely cheap for starter kits. One of the best things about this kit is that it connects to your computer via USB. Most kits connect to your computer with serial and printer port connections. Unfortunately, most modern computers built today do not have either of these interfaces because they are extremely outdated. When I started programming with microcontrollers, I used a PIC16F84, and I build an El Cheapo programmer myself. I managed to get a project and programmer built for fewer than 20 dollars. Unfortunately, my new computer does not have a printer port, so I can not use the El Cheapo PIC programmer anymore. Instead, the best is to buy a new kit which is USB capable.

The actual microcontroller itself has a wide variety of features and interfaces which can suite virtually any project. Whether you need GPIO, SPI, I2C, UART or RTCC, the PIC32 has them all. It runs at 80 Megahertz which is fast enough for virtually any hobby projects as well. I highly recommend this kit to anyone who wants to build a hobby project with a microcontroller.

Posted under Saving Money, Shopping

This post was written by admin on September 12, 2008

Tags: , , , , , , , ,