Close
0%
0%

Wi-Fi-controlled car (turtle bot) with FPV

Combining some <£100 worth of hardware to make a modular system with a car that can be controlled in different ways including Wi-Fi with FPV

Similar projects worth following
183 views
Long time ago I bought a couple of £9 "smart car robot kits" on Ebay and I had planned to use them to build a remote-controlled car for a while. The idea is to be able to control them through a Wi-Fi connection with a video feed available. I also wanted to separate the hardware that deals with the motor control from the hardware that deals with the video and the Wi-Fi connection to keep these as separate elements I could repurpose for other projects. There are 1,000 projects out there about Wi-Fi and remote-controlled vehicles, I believe the only specific feature of this one is this physical decoupling between the hardware elements.

I will explain this project step by step in the project updates. The roadmap is fairly simple:

  1. Build a small Arduino-controlled autonomous turtle bot / robot car
  2. Implement BLE communications to be able to control the car from a phone/laptop/Raspberry Pi.
  3. Build a more sturdy prototype.
  4. Add a Raspberry Pi handling the bluetooth communications and providing a video feed for FPV.
  5. (potentially: use OpenCV to implement some basic autonomous driving)

robot_joy_udp.zip

3rd PC-side Python program. This one enables the joystick to be attached to one computer while a different computer connected to the same LAN communicates with the car by BLE. The connection between the two uses UDP. The code doesn't have any features to deal with connection drops, this is just a 10 line demo.

Zip Archive - 1.15 kB - 04/02/2020 at 06:44

Download

adapter_board.zip

Design files of the PCB that connects the Arduino Mini to the nrf8001 module and the TB6612FNG motor driver. The board is designed to be milled and I didn't pay attention to the location/visibility of the component IDs. The design files are from a Kicad project, I algo include the gerber files of the front layer, back layer and board cutout in a separate folder.

Zip Archive - 73.12 kB - 03/31/2020 at 21:40

Download

robot_joy_evdev.py

2nd PC-side Python program that reads the joystick input and sends it to the car controller via BLE. This does pretty much the same as the 1st program but it uses the evdev library instead of the PyGame library. The transition wasn't straightforward but I had to do it in order for the program to work on a Raspberry Pi with no screen attach and not running an X server (apparently, PyGame isn't meant for headless)

x-python - 1.07 kB - 03/31/2020 at 21:28

Download

robot_joy_pygame.py

1st PC-side Python program that reads the joystick input and sends it to the car controller via BLE. This uses the PyGame library to read the joystick data. Modify the MAC address in the code to match your nrf8001 module.

x-python - 915.00 bytes - 03/31/2020 at 21:27

Download

ble_car.ino

1st Arduino code that reads nrf8001 BLE connections and controls the motor driver to make the car move. The code is borrowed from the wheelchair project removing the local physical controller

x-arduino - 14.55 kB - 03/28/2020 at 18:51

Download

View all 7 components

  • From nothingness to somethingness

    adria.junyent-ferre04/02/2020 at 08:02 0 comments

    I had the idea of making a radio-controlled car "my way" for a long time. My main goal was to create an FPV vehicle I could control from the internets using components that gave enough freedom for customization and replacements of parts once obsolescence kicked in. 

    Last year a group of students of mine started an open source electric wheelchair project. I spent some time over the summer completiing their work and learned a couple of practical things in the process. The details of that project can be found here: Open electric drive kit for wheelchairs - alpha v. The control board of the wheelchair had a BLE module that could be used to control the wheelchair from a mobile phone (don't ask me how this feature was justified) and I had the chance to learn how easy it is to implement basic BLE communications. 

    This gave me the idea of using BLE as the means of communication between hardware elements. Perhaps it is a very bad idea for real-time "life-critical" applications, perhaps from the design point of view it is a poor option because of all the physical complexity and the reliability concerns this brings, HOWEVER it is certainly an attractive option to keep hardware elements electrically separated, reusable and easy to debug (you can play with it with your phone/laptop/etc).

    So fast forward to the last few weekends, I took some hardware I had kept in my cupboard for ages and put together a quick prototype of an Arduino-controlled car with BLE communication. I used the chassis of the old robot project our 1st year students used to do and I got this ugly monster running:

    I used an Arduino Nano because of the form factor, a TB6612FNG H-bridge MOSFET motor driver to drive the two DC motors and an (obsolete?) mRF8001 module from Adafruit for the BLE communications. 

    On the software side, I borrowed the Arduino code from the wheelchair project, which provided a simple means of reading joystick commands from the BLE stream and translating them into the PWM signals given to the motor driver. This software is fairly sophisticate and includes a few interesting features such as a jerk/acceleration limiter and a cruise control. The original phone app that was developed for the wheelchair project could be used to control the car straightaway. Again, you can find all the details in the page of the wheelchair project.

    This worked very well as a proof of concept but I wanted to make the prototype more sturdy before proceeding to the next steps. On the following weekend I made this improved version:

    (a "snow plow" accessory was added on the front to make this push stuff around)

    An assessor here demanded that the car was painted in a fabulous colour scheme and I placed all the circuitry on the bottom of the base using the ugliest hot-glue cable management known to men:

    Breadboards are the worst friend/enemy of electronic engineers, therefore I made a PCB adapter to replace the spaghetti breadboard circuitry by something more sturdy and "electrically better". This PCB is fairly simple:

    There are a couple of tricks anyone planning to make a PCB using a mill or DIY etching should take into account. For instance, holes aren't plated, therefore the two pads (ie top, bottom) for each leg of a through-hole component have to be soldered if there are traces reaching them from both sides. This is OK to do with some components that leave the legs exposed on the top side but it is a serious nightmare with others. The lack of solder mask only makes the problem worse because it is harder to keep the solder from running away from the pad by the track. 

    Further, bias aren't plated either and they have to be connected manually, typically using a short piece of wire soldered from both sides. The easiest bias to solder are the ones where the copper area on one side is significantly bigger than the copper area of the other side: if you solder the side with the big copper area first, it is unlikely...

    Read more »

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates