Tubby Bot a Wifi/Smartphone controlled two wheeled bot

Hey there, here is a quick demo of my Tubby bot.

I wanted to design a novel, two wheeled bot which is easy to build and provides a simple user interface. Even though I have built bots earlier, they were all in a way scrambled parts of other devices and projects. And because of this, it was not possible to remake or recreate them again by myself. I wanted to present ideas which are “make-able”. Apart from this, I also wanted this bot to be Arduino IDE programmable. Now, if I look at the market there are some two wheeled bots, but they are not having a visually appealing design. Therefore my aim was to build a Pet Desk Bot which was appealing, as well as make-able.

I named this bot “Tubby Bot”. For the reason that it is remote controlled, it could be easily called an RC car or a remote controlled car. Furthermore, as it is programmable and can be made autonomous, it can be called a “Robot”.

This is my first design from scratch, so 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 light and sound without any sensors. This enabled me to think of a very simple housing design. I wanted to use the smartphone controllable interface, so that I can avoid the excessive hardware dependency. My basic idea was to reuse maximum available off-shore components and to 3D design the parts which are not available.

Framework needed to build a bot

 

For  building the bot, you need to focus on hardware, software and communication. Hardware includes electronics and 3D. For this project, I wanted to lessen the electronic work. After a thorough search, I found that the ESP8266 and ESP32 based boards are the way to go. In that specifically, Wemos D1 mini seemed to meet the requirement perfectly.

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

  • Battery and charging circuit
  • Motor driver
  • Communication module
  • Lastly micro-controller.

A robot needs to be wireless and moving.For this a battery is essential and additionally a charger is also required. This makes charging and using pretty handy and quick. For a two wheeled bot, you need two motors. Both the motors should be able to spin in two ways, i.e forward and backward. Only then you can turn left, right, straight and reverse.  Ideally if you power a motor, 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 can’t be done if you are directly controlling a motor from your micro-controller GPIO and for that you need a module called the H-bridge. So the micro-controller tells the H-bridge which motor should turn,which side and 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 cars  (remote controlled cars) uses a range of frequency from  125 Mhz to 2.5 Ghz for communication to speak with the remote controller. Apart from that, there are Infra red, Bluetooth etc. I chose Wifi as the interface, because it supports both smartphone and micro-controller.

Finally, it needs to be programmable and this is done by 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 has an on-board Wifi. It uses ESP8266 micro-controller and there are plenty of shields that I can stack. Interestingly it also has a battery shield, which means that I do not need to care about the battery management separately.

 

There is also an H-bridge shield, which makes my next step even easier as I do not need to hard wire an external H-bridge to the micro-controller. With this, the basics remote control 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:

Now moving to the electronics part, below are the components needed to make the tubby bot.

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

 

Wemos D1 mini

 

Battery Shield

Motor shield

 

Magnetic Reed Switch:

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 the Geekcreit kit.

Magnetic Reed Switch connection

3D Design:

Initially I had decided to make a shape something like the photograph below.

First Draft

But later I reduced the complexity of the design and changed it to a cube. With recently learnt FreeCAD skills, I designed the entire housing of the cube shaped bot.

You can find the 3D design of the top part of the tubby bot here  https://www.thingiverse.com/thing:2989469

Top

You can find the 3D design of the bottom part of the tubby bot  here  https://www.thingiverse.com/thing:2989471

Bottom

The 3D design of the wheels of the tubby bot are here  https://www.thingiverse.com/thing:2989473

Inner View of the wheels
Outer View of the wheels

Schematics:

The RGB leds are connected to the pins GPIO 12, 13 and 15. The buzzer is connected to GPIO 14. Later the RGB leds and the buzzer will be controlled from Blynk app.

Schematic of OLED, RGB and Buzzer connection

Motor shield schematic:

The two motors are connected to the pins A1, A2 and B1, B2 respectively. Using the I2C protocol the commands are send to drive the motors from the micro-controller to the motor shield. The motor shield I2C pins are shared with the OLED display.

Motor shield schematic

Setting up Arduino and Blynk:

For remote control I used the Blynk App. I downloaded it from the Google play store and registered an account there. Then I created a project for which Blynk generates a unique code and sends it as an email. This unique code should be used for authentication when you are programming the ESP8266 controller. I am not going into the details of how to setup Arduino and Blynk libraries, as they are already available out there with active support.

Motor shield bug:

The Wemos D1 mini motor shield’s default firmware was faulty at the time, so it required to be reprogrammed. I followed this link and made the motor shield working .

Arduino code:

Above all before compiling the code, do not forget to fill in your Wifi SSID, Password and Blynk Auth code. You can download the source files from here https://github.com/codelectron/TubbyBot

In case you have come till here have a look at the video showing detailed building of the Tubby Bot.

Please write in your opinions and feel free to give your ideas or feedback.

Leave a Reply

Your email address will not be published. Required fields are marked *