Python + Arduino, CarControl V.03
Intro: Python + Arduino, CarControl V.03
Have you ever bought something just to take it apart? I bought this remote control car hoping to drive it from my computer. I used Python, an Arduino board and about 300 lines of code. Took me a couple of hours work to get it together and another couple to put this tutorial up. For full instructions and working code checkout http://thelivingpearl.com/2013/01/04/drive-a-lamborghini-with-your-keyboard/
Things you will need:
Remote controlled car and remote
A computer
An Arduino board
The Arduino IDE
Wires
Batteries
Things you will need:
Remote controlled car and remote
A computer
An Arduino board
The Arduino IDE
Wires
Batteries
STEP 1: Step 0: Get Comfortable With the Arduino.
You can get an Arduino Uno from Amazon for about $15 and you will need to download the Arduino IDE from Arduino.org. The language is based on c/c++ and you will find many tutorials on this and other websites. I suggest you walk through the examples and get comfortable with Arduino before you try to take on this or any other project. It will help. The Arduino IDE has more the enough examples you can play around with to get to know the board.
STEP 2: Step 1: Taking Apart the Remote
We will begin by taking apart the remote. Be careful not to force anything apart. Be sure to stop and test the remote operation at each step. If you mess something up you will make life a lot harder for yourself. Pay attention to the details.
STEP 3: Step 3: Study the Board
You will have to figure out how the board operates in order to figure out how to connect it to the Arduino. Using a wire you should be able to trace the board and figure out which 2 connection you need to connect in order to move the car. Once you figure that out you can send a signal from the Arduino pins and test weather you are moving the car or not. Remember that you are looking for 4 connections, one for each car command, forward, reverse, left and right.
STEP 4: Step 4: Python + PyGame
Using Python and the PyGame Library you can receive keyboard keys pressed and output a command to the serial port. This will allow us to process key events and send an sppropriate signal to the Arduino via USB.
STEP 5: Step 5: the Arduino Code
You will have to write some Arduino code that will implement the logic of movement. The signal coming from the python program is a number which correspond to a particular mvment. That means that a command is simply switching the output pin from LOW to HIGH or from HIGH to LOW. You can Download CarControl complete from my website.
STEP 6: Step6: Wire Everything Togther
After you have your Python code and your Arduino code ready and tested, wire everything up. Now it is time to enjoy you computer controlled remote controlled car and show off your skills.
8 Comments
indhug19 4 years ago
Srini7848 4 years ago
Cheers
Srini B
sh.comsat 4 years ago
HimanshuS180 6 years ago
Thanks in advance
tshala 6 years ago
Very good project, but im missing the full instructions. your link is not opening.
Gyu Beom EdwardI 6 years ago
thx for sharing such a nice work :-)
russ_hensel 8 years ago
I love the combination of Python and the Arduino. So I have created a collection about it. I have added your instructable, you can see the collection at: >> https://www.instructables.com/id/Arduino-and-Pytho...
ProBodger 11 years ago