dheera / robot-botparty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

robot-tethys

A mini telepresence robot. At about $130 total for all parts (including the pictured used Pixel 1 phone), the goal of this robot is to be as inexpensive as possible for a complete telepresence solution.

robot

robot

Completed robot.

robot

If you buy a 5V2A Qi charging sticker, you can charge the robot wirelessly just by driving on top of a wireless charger. Simple and no docking alignment fuss!

robot

You can use Anker Powerline micro-USB cables to charge the robot without taking it apart. Not all micro-USB cables will clear the outer edge of the sprocket.

robot

The motors are driven by a DRV8833 and a TinyPICO ESP32 microcontroller. The phone talks to the ESP32 over BLE. The ESP32 is super feature packed and also has Wi-Fi, capacitive touch sensing, I2C, SPI, UART, ADC, DAC, and lots of other features so you can build off this design and add whatever sensors and actuators you please. Build a security robot, a robot that roams around sensing VOC gas levels, and more!

Assembly

3D printed parts

See .stl files in design/. I recommend printing in PETG. PLA sucks.

Mechanical parts

Electronics

  • Used Google Pixel 1 -- You can get them used or "refurbished" for under $65. The charging cord on the portable charger below just barely fits so if you buy any bigger phone than the Pixel 1, you may need an extension on the charging cable. I do not recommend using an iPhone as Apple is consistently behind the times in terms of in-browser WebRTC support and doesn't even have bluetooth support from the browser. If you use an iPhone you will have to write an iOS native app from scratch.
  • 2 x Micro metal gearmotors -- If you buy from Pololu, HPCB or HP 75:1 is proboblay the best for this use case but you can go up or down to 30:1 to 150:1 depending on your needs. Get single shaft if you don't plan on even putting encoders in, get dual-shaft if you think you might want encoders later. Get MP instead of HP/HPCB if you want a cheaper motor. Or search eBay/AliExpress for MUCH cheaper alternatives although many suppliers don't provide specs on current and stall torque making it hard to choose. There are also sometimes people on eBay reselling authentic used Pololu motors at cheaper prices.
  • Portable charger: YPLANG 9000mAh or BeeFix 9000mAh or Elephant Story 9000mAh -- They are the same charger under 2 different brand names). Make sure you get the version with 1 USB-C out + 1 lightning+microUSB combination out, and not their older version with 1 microUSB + 1 lightning. The chassis and 3D printed parts are designed to match this charger, which allows charging+discharging at the same time, and has two charging ports, one of which can be used for a Qi charger sticker.
  • 2A Qi fast charging receiver USB-C if you want wireless charging where the robot can just drive up onto a charger (optional)
  • 1 x DRV8833 carrier No-name cheap 5 for $8 carrier or Pololu 1 for $4.95 DRV8833 carrier or any other DRV8833 carrier
  • TinyPICO or other ESP32 board of your choice
  • 24 AWG wire
  • 1x2 Dupont connector housing and crimps or just get a kit like this. This crimper has worked well for me for Dupont crimps.
  • JST-EH connectors for ESP32 board and ESP-DRV8833 connection (or use whatever you prefer). This crimper has worked well for me for JST-EH.

Code

esp32/ contains firmware for a TinyPICO. (a) Follow TinyPICO's instructions to enable the Arduino IDE (b) install the analogWrite library for ESP32 and then (c) compile it with Arduino. You can then visit the ESP32 web terminal to test connectivity. Steps to test:

  • Use desktop Chrome on a laptop that has Bluetooth, or Chrome on Android also works. Chrome on iOS will not work.
  • Go to chrome://flags/#enable-experimental-web-platform-features and enable.
  • Go to the ESP32 web terminal and Connect to "tethys-255" which should be your newly flashed TinyPICO.
  • If you connected successfully, you will see "Z" being output every second. That is a heartbeat from the firmware.
  • Type "G 0 255 0 255" to drive the motors, and you can try other values as well. They are just PWM values for 2 H-bridges. The motors will stop after 1 second; this is expected as the ESP32 firmware imposes a 1 second heartbeat on incoming commands.
  • Type "S 4" to set the robot number to 4 or whatever number you want <=255. This is a persistent setting. After a power cycle (unplug and replug the TinyPICO) the device will show up as "tethys-4". This allows you to prevent from connecting the wrong robot phone to the wrong robot ESP32.

server/ contains server code. Run with node and proxy node through nginx for https (see nginx.conf and sites-available/default). Hacky, to be improved.

You MUST go to chrome://flags/#enable-experimental-web-platform-features on the robot and enable it! This is required for Chrome to be able to talk to BLE devices from a webpage. Only the robot needs this, not your participants.

https://yourserver/robot/#room on the robot with Chrome. You need to set a robot id and a passcode. Then every time you load the page on the robot you need to press the bluetooth button and select the "tethys-###" device. Unfortunately this is a limitation of the web bluetooth API and it cannot auto-connect without a user gesture.

https://yourserver/join/#room is for participants. Chrome on Linux/MacOS/Windows should all work. Issues have been reported on Safari and iOS and I need to get a hold of some Apple hardware to debug these.

WebRTC data channels don't seem to renegotiate so I use socket.io for driving and WebRTC for audio/video. Clunky but WebRTC documentation is lacking and all the examples suck at illustrating proper SDP renegotiation.

About


Languages

Language:CSS 66.5%Language:JavaScript 31.4%Language:OpenSCAD 1.4%Language:HTML 0.4%Language:C++ 0.4%Language:Shell 0.0%