Connecting a programmable chip to a remote Controlled Car September 11, 2009Posted by GuySoft in Crictor, Electronics, Hamakor, ITU, linux, open source, programming, Uncategorized, wireless.
Tags: C, Electronics, hacking, howto, linux, open source, programming
I have been playing with electronics the last few days, and I thought I might show you the outcome.
I basically took a remote controlled car, and connected it to a 16F84 programmable chip, and now I can control the car using C code.
Although I am using a car in this guide, you should be able to close and open any kind of switch. Anything under 15 volts.
For people who have don’t feel like reading all this (and also for those who do), here is an action-packed video of the outcome:
After you saw that, here is how I did this.
Starting with electronics
This project was really my start on electronics. I guess reading about transistors (on my way to become an amateur radio ham) got me in to all of this. The transistor lets you control circuits with any other circuits. You better just google them, and read, the more you know the cooler things you can build!
Finding what you need is usually the harder part of the job, I better thank #electronics channel on freenode for helping me find the parts I needed. Once you find the part, you better look at its schematic, it will tell you what all the pins do. Schematics are easily searchable on the web. You can also open up old electronics (the simpler the better), and look for parts there, but it is hard to find exactly what you need, and you most likely will need to spend some money on parts (really, they cost nothing!). In Jerusalem you can check out the shop Kashayuf.
Here are the parts I used for my project:
The 16F84 programmable chip (the brain)
The 16F84A is really an obsolete chip, and is very limited. However, it was the only one I could get around here. And since it only costs 8 NIS (under 2$), I got more than my money worth. After all, what possibly could you get for under 2$ that you can write code for?
Usually the programmer will cost you more than the chip. Mine cost 50$, and is called the MPLAB ICD2. I got it off ebay. Although its powerful and can program many PICs, I guess I could have gotten something much cheaper.
The software for the chip
I used an IDE to code called Piklab, it really gave me everything I needed, from programming and compiling, to pin diagrams of the chips.
To compile I sadly had to use CCS (you can see the code here). I should be able to use the open source alternative SDCC, but it seems the delay_ms() function there is not working for my chip. If anyone has any source, I’d gladly use it.
7805 – 5V Regulator
The 7085 chip lets you take anything and turn it to a 5 volt power supply. If you want to try something simple, like building a USB power charger. Watch this systm episode. That video will also explain you how a bread board works.
14066 – The switching transistor
The MC14066 chip I used is a 4-in-1 chip that lets me open and close circuits. Its really a bunch of transistors. Before using it I tried using an IR540 MOSFET transistor, but it needs +5V at its gate, and the PIC only gives out 2.5V. Still it could be used to turn on an off motors with the LPT port, or big lights. Remember: Without transistors, you will only be able to power using the 2.5 signal that comes out form the PIC, or anything else.
Other chips Programmable chips
Next project – The bumble-b
While doing this project I found a really cool looking chip called the bumble-b. I ordered one, and I hope to update once I try it out.
This is really all for now, hope you enjoyed my quick introduction to electronics and my project, and I hope to do more projects before the semester starts.
Update: All 4 directions on the car are working , a friend and I hope to code it a route in the campus!