-
How to Get Started (Fall 2018)
11/16/2018 at 22:01 • 5 commentsFor the Zerobot robot there are different instructions and files spread over Hackaday, Github and Thingiverse which may lead to some confusion. This project log is meant as a short guide on how to get started with building the robot.
Where do I start?
- Grab the STL-files from here: https://www.thingiverse.com/thing:2800717 and print them out following the instructions on Thingiverse
- Get the remaining parts:
- Raspberry Pi Zero W - 2x ICR18650 lithium cell 2600mAh - Raspberry camera module - Zero camera adapter cable - Mini DC dual motor controller - DC gear motors - ADS1115 ADC board - TP4056 USB charger - MT3608 boost converter - Raspberry CPU heatsink - Micro SD card (8GB or more) - 2x LED - BC337 transistor (or any other NPN) - 11.5 x 6mm switch - 4x M3x10 screws and nuts
- Wire up the electronics according to this schematic: In case you are not familiar with this: The schematic is optimized for readability. You don't have to use this exact wiring (e.g. connection LEDs to ADS1115) as long as the electrical connections stay the same. For the wire gauges, use around 22 AWG wire for the signal connections and slightly thicker wire for the batteries and motors.
- The software comes preinstalled on an SD card image. Download it from here: https://drive.google.com/file/d/163jyooQXnsuQmMcEBInR_YCLP5lNt7ZE/view?usp=sharing, extract the files using 7-Zip and flash it to your 8GB micro SD card. Do not boot the Pi before entering your WiFi router name and password in the wpa_supplicant.conf file on the SD.
- After the SD card is inserted you can assemble the robot as seem on the pictures on the Hackaday project page. Make sure that all wires are properly isolated. Lithium batteries are very dangerous. If there is a short circuit between the batteries, they can catch fire.
- Turn the robot on and wait for the Pi to connect to your WiFi. After that you can connect to it by accessing its IP followed by the port :3000 like this: 192.168.2.11:3000. If you don't know your Raspberry Pi's IP use a WiFi scanner like "Fing" on your smartphone to scan for devices.
- After that you are done! Have fun with your Zerobot! Below are some common questions/problems.
The robot spins/ doesn't drive right
The motors might be reversed. You can simply swap the two wires to fix this.
I can't connect to the Zerobot in my browser
The Raspberry Pi itself with the SD card image running on it is able to display the user interface in your browser. There is no additional hardware needed, so this can't be a hardware problem. Check if you are using the right IP and port and if you inserted the correct WiFi settings in the wpa_supplicant.conf file.
I see the user interface but no camera stream
Check if your camera is connected properly. Does it work on a regular Raspbian install?
Zerobot and Zerobot Pro - What's the difference?
The "pro" version is the second revision of the robot I built in 2017, which includes various hardware and software changes. Regardless of the hardware the "pro" software and SD-images are downwards compatible. I'd recommend building the latest version. New features like the voltage sensor and LEDs are of course optional.
Can I install the software myself?
If you don't want to use the provided SD image you can of course follow this guide to install the required software: https://hackaday.io/project/25092/instructions You should only do this if you are experienced with the Raspberry Pi. The most recent code is available on Github: https://github.com/CoretechR/ZeroBot
-
The new Zerobot Pro
02/20/2018 at 22:02 • 28 commentsAll new features: More battery power, a charging port, battery voltage sensing, headlights, camera mode, safe shutdown, new UI
The new software should work on all existing robots.
When I designed the ZeroBot last year, I wanted to have something that "just works". So after implementing the most basic features I put the parts on Thingiverse and wrote instructions here on Hackaday. Since then the robot has become quite popular on Thingiverse with 2800+ downloads and a few people already printed their own versions of it. Because I felt like there were some important features missing, I finally made a new version of the robot.
The ZeroBot Pro has some useful, additional features:
- Instead of a single battery with a power-bank circuit, the ZeroBot Pro is now powered by two 2600mAh batteries in parallel. Thanks to a cheap TP4056 Micro-USB charger the case does not have to be opened to recharge the batteries. 5V for the Pi and 6V (optional) for the motors are regulated by MT3608 boost converters.
- Thanks to a ADS1115 ADC the Raspberry can measure the battery voltage and display it on the user interface
- The entire user interface has been optimized for various screen sizes. There are now buttons for different functions:
- A photo button for taking pictures in full resolution. This is not as easy as it appears. The stream has to be stopped to start the raspistill application and then restarts.
- A toggle button to turn the LED headlights on and off. The LEDs are connected via a transistor to an IO pin. (I adopted this idea from franciscorps version of the ZeroBot: https://www.thingiverse.com/thing:2445551)
- Finally there is a shutdown button that turns the Pi off safely after displaying a confirmation prompt. This should prevent the file system from corrupting
- The 3D printed parts have been optimized as well to reduce warping and to fit the front panel more easily.
If you are interested in building the robot, you can head over here for the instructions: https://hackaday.io/project/25092/instructions
The 3D files are hosted on Thingiverse: https://www.thingiverse.com/thing:2800717
Download the SD card image: https://drive.google.com/file/d/163jyooQXnsuQmMcEBInR_YCLP5lNt7ZE/view?usp=sharing
After flashing the image to a 8GB SD card, open the file "wpa_supplicant.conf" with your PC and enter your WiFi settings.
-
Easy Setup using SD Image
06/24/2017 at 13:07 • 17 commentsAfter a few people ran into problems with the tutorial, I decided to create a less complicated solution. You can now download an SD card image for the robot, so there is no need for complicated installs and command line tinkering. The only thing left is getting the Pi into your network:
- Download the image file from here and unzip it to your PC: https://drive.google.com/uc?export=download&confirm=EUSf&id=0B4WbDsFout-NN1M1dzU0elR3NXc
- Flash the image to an 8GB or bigger micro SD card with the software of your choice (e.g. Etcher). Don't plug the SD into the Raspberry yet!
- In the boot partition of the SD, open the file wpa_supplicant.conf (e.g. using notepad). Change wifi ssid and password to your wifi name and password. The file will be automatically moved to its spot of the Pi's file system on boot. If you make a mistake, you just need to create the file again.
- After the Pi has booted up, find out its IP address using your routers interface or through an app like Fing. Connect to this address (e.g. 192.168.2.3) with any browser on your computer
If you don't want the robot to be restricted to your home network, you can easily configure it to work as a wireless access point. This is described in the tutorial.
EDIT 29.7. Even easier setup - the stream ip is selected automatically now
-
Introduction
05/29/2017 at 20:53 • 1 commentThe goal for this project was to build a small robot which could be controlled wirelessly with video feed being sent back to the user. Most of my previous projects involved Arduinos but while they are quite capable and easy to program, there are a lot of limitations with simple microcontrollers when it comes to processing power. Especially when a camera is involved, there is now way around a Raspberry Pi. The Raspberry Pi Zero W is the ideal hardware for a project like this: It is cheap, small, has built in Wifi and enough processing power and I/O ports.
Because I had barely ever worked with a Raspberry, I first had to find out how to program it and what software/language to use. Fortunately the Raspberry can be set up to work without ever needing to plug in a keyboard or Monitor and instead using a VNC connection to a remote computer. For this, the files on the boot partition of the SD card need to be modified to allow SSH access and to connect to a Wifi network without further configuration.
The next step was to get a local website running. This was surprisingly easy using Apache, which creates and hosts a sample page after installing it.
To control the robot, data would have to be sent back from the user to the Raspberry. After some failed attempts with Python I decided to use Node.js, which features a socket.io library. With the library it is rather easy to create a web socket, where data can be sent to and from the Pi. In this case it would be two values for speed and direction going to the Raspberry and some basic telemetry being sent back to the user to monitor e.g. the CPU temperature.
For the user interface I wanted to have a screen with just the camera image in the center and an analog control stick at the side of it. While searching the web I found this great javascript example by Seb Lee-Delisle: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/ which even works for multitouch devices. I modified it to work with a mouse as well and integrated the socket communication.
I first thought about using an Arduino for communicating with the motor controller, but this would have ruined the simplicity of the project. In fact, there is a nice Node.js library for accessing the I/O pins: https://www.npmjs.com/package/pigpio. I soldered four pins to the PWM motor controller by using the library, the motors would already turn from the javascript input.
After I finally got a camera adapter cable for the Pi Zero W, I started working on the stream. I used this tutorial to get the mjpg streamer running: https://www.youtube.com/watch?v=ix0ishA585o. The latency is surprisingly low at just 0.2-0.3s with a resolution of 640x480 pixels. The stream was then included in the existing HTML page.
With most of the software work done, I decided to make a quick prototype using an Asuro robot. This is a ancient robot kit from a time before the Arduino existed. I hooked up the motors to the controller and secured the rest of the parts with painters tape on the robot's chassis:
After the successful prototype I arranged the components in Fusion 360 to find a nice shape for the design. From my previous project (http://coretechrobotics.blogspot.com/2015/12/attiny-canbot.html) I knew that I would use a half-shell design again and make 3D printed parts.
The parts were printed in regular PLA on my Prusa i3 Hephestos. The wheels are designed to have tires made with flexible filament (in my case Ninjaflex) for better grip. For printing the shells, support materia is necessary. Simplify3D worked well with this and made the supports easy to remove.
After printing the parts and doing some minor reworking, I assembled the robot. Most components are glued inside the housing. This may no be professional approach, but I wanted to avoid screws and tight tolerances. Only the two shells are connected with four hex socket screws. The corresponding nuts are glued in on the opposing shell. This makes it easily to access the internals of the robot.
For powering the Motors and Raspberry, two separate power supplies/ batteries should be used to protect the Pi from overvoltage. I decided to take apart a power bank and attack the 3.7 V battery directly to the motor controller. The regulated 5 V from the power bank's board are fed into the Pi. So far, this works perfectly fine. The robot can be charged with a micro-USB cable from the inside. I might have to add a charging port later for better accessibility.
In a last step I configured the Raspberry to act as a Wifi Access Point using this script: https://gist.github.com/Lewiscowles1986/fecd4de0b45b2029c390. This way, the robot works anywhere and is not restricted by a Wifi router.