Tubby Bot a Wifi/Smartphone controlled two wheeled bot – STEP BY STEP GUIDE

This article is originally published at http://codelectron.com/tubby-bot-a-wifismartphone-controlled-two-wheeled-bot-step-by-step-guide/

I wanted to design a novel two wheel bot which is easy to build and provide simple user interface. Although I have built bots earlier they were all in way scrambled parts of other devices and projects. And because of this its not  possible to remake or recreate them again by myself. I wanted to present ideas to public which I can make or in other words “makeable” . Apart from this I wanted this bot to be Arduino IDE programmable. Now if I look at the  market there are some two wheel bot but they were not having a visually appealing design. My aim is to build this like a Pet Desk Bot.

I named this bot Tubby Bot. Now it can be very well called an RC Car or Remote controlled car rather than a Bot given that it will be controlled by remote control but it is a bot because it is programmabl and with enough skill you can make it autonomous to qualify to be called a “Robot”.

Since this is my first design from scratch I wanted to keep things simple. Some of the rules of simplicity are

  • No sensor only output devices.
  • Smartphone controlled so as to eliminate an extra Remote controller.
  • Two wheel bot with caster ball and no self balancing.

The idea is to have only lights and sound and no sensors. This enabled me to think of a very simple housing design. I wanted to use the smartphone controllable interface as I can avoid the excessive hardware dependancy. My basic idea was to reuse maximum available off-share components and designs only missing things.

hwswcomm-300x273.png

For  building the bot you need to focus on hardware, software and communication. Hardware includes electronics, 3D. For this project I wanted to lessen the electronic work. After thorough search I found that ESP8266 and ESP32 based boards are the way to go. In that specifically Wemos D1 mini seems to be fitting the requirement well. Here I will explain you how I choose it.

If you want to build a two wheel bot from electronics point of view you will need the following things

  • Battery and charging circuit
  • Motor driver
  • communication module
  • Lastly microcontroller.

A robot needs to be wireless and moving and for that battery is essential added to it is that charger. This makes the charging and using handy and quick. For a two wheeled bot you need two motors. And remember the motor can spin two ways and it should be possible for both the motor to spin two ways backward and forward. Only then you can turn left , right, straight and reverse.  Ideally if you power a motor then it spins in a particular direction and if you want to spin in the reverse direction then you need to flip the polarity of the power supply. Now this cant be done if you are directly controlling a motor from your micro controller GPIO and for that you need a module called H-bridge. So the micro controller tells the H-bridge which motor should turn which side at what speed.

Communication module helps to send commands to the bot from the remote controller or computer and vice versa.This is required even for autonomous bots. In general RC  use from  125 Mhz to 2.5 Ghz frequency for communication to speak with remote controller. Apart from that there are Infra red, Bluetooth etc. I choose Wifi as the interface as it is supporting both smartphone and microcontroller.

Lastly it needs to be programmable and this is done using a micro controller. The reason for choosing Wemos D1 mini is that it is a small form factor board with 4MB flash and 10 pins  and on board wifi. It uses ESP8266 micro controller and there are plenty of shield that I can stack. Interestingly it has a battery shield which mean I dont need to care about battery management separately.

 

There is also a H-bridge shield  which makes my next step even easier as I dont need to hardwire a external H-bridge to the microcontroller. With this basics remote is almost done except that I need to test them . Apart from that I also used RGB  led, OLED display and a buzzer.

 

Hardware required:

Magnetic Reed switch:

https://www.banggood.com/10pcs-Reed-Switch-MagSwitch-Normally-Open-Magnetic-Induction-Switch-p-940055.html?rmmds=search&p=W214159476515201703B

Amazon: https://amzn.to/2lRZntH

Wemos Battery Shield

https://www.banggood.com/Wemos-Battery-Shield-V1_2_0-For-Wemos-D1-Mini-Single-Lithium-Battery-Charging-Boost-p-1264243.html?rmmds=search&p=W214159476515201703B

Amazon: https://amzn.to/2tXTrny

Wemos d1 Mini
https://www.banggood.com/WeMos-D1-mini-V2_2_0-WIFI-Internet-Development-Board-Based-ESP8266-4MB-FLASH-ESP-12S-Chip-p-1143874.html?rmmds=search&p=W214159476515201703B

Amazon:https://amzn.to/2KOiAr5

Wemos motor shield
https://www.banggood.com/Motor-Shield-For-WeMos-D1-Mini-I2C-Dual-Motor-Driver-TB6612FNGV1_0_0-p-1102387.html?rmmds=search&p=W214159476515201703B

Amazon: https://amzn.to/2tSUSU8

Lipo battery
https://www.banggood.com/3_7V-650mAh-JST-Plug-Rechargeable-Lipo-Battery-p-1232232.html?rmmds=search&p=W214159476515201703B

Amazon: https://amzn.to/2tTxaHq

Planetary gear motor
https://www.banggood.com/Mini-3V-6V-DC-Motor-Coreless-Planetary-Gear-Reducer-Micro-Motor-p-999288.html?rmmds=search&p=W214159476515201703B

Amazon: https://amzn.to/2MOZqC8

https://www.banggood.com/0_96-Inch-4Pin-IIC-I2C-Blue-OLED-Display-Module-For-Arduino-p-969147.html?p=W214159476515201703B

Amazonhttps://amzn.to/2tW5Ms9

Buzzer:

https://www.banggood.com/5V-Active-Buzzer-Alarm-Beeper-With-Cable-for-FPV-Racer-Quadcopter-Drone-DIY-p-1032123.html?&p=W214159476515201703B

Amazon: https://amzn.to/2Kw8NK1

Magnet:
https://www.banggood.com/One-20mm-Dia-x-5mm-Strong-Neodymium-Disc-Magnets-p-924574.html?rmmds=search&p=W214159476515201703B

Amazon: https://amzn.to/2KJ58bo

RGB Module:
https://www.banggood.com/RGB-3-Color-LED-Module-For-Arduino-Red-Green-Blue-p-76519.html?&p=W214159476515201703B

Amazon: https://amzn.to/2zakgK9

Metal bearing:
https://www.banggood.com/10pcs-8mm-Diameter-Ball-Metal-Transfer-Bearing-Unit-Conveyor-Roller-CY-8H-Ball-Bearing-p-1053879.html?&p=W214159476515201703B

Amazon: https://amzn.to/2MNlFIr

Design:

I initially decided to make a shape something like this and later changed it to reduce complexity and easiness to print decided to go with a cube shaped bot. This reduced lots of complexity in the bot design and with the recently learned freecad skill I designed the entire housing.

First draft:

redolddesign-300x225.jpeg

Top

Thingiverse: https://www.thingiverse.com/thing:2989469

Bottom

Thingiverse: https://www.thingiverse.com/thing:2989471

and wheels

Thingiverse: https://www.thingiverse.com/thing:2989473

 

Magnetic button:

For powering the Tubby bot I used Magnetic reed switch. You can consider it as a switch which upon meeting the magnet starts conducting. I used one which came as part of Geekcreit kit.

The rest of the information is available at  : http://codelectron.com/tubby-bot-a-wifismartphone-controlled-two-wheeled-bot-step-by-step-guide/

https://www.youtube.com/watch?v=--HpzIXZk6w