Plasteac – Enhancements

You must remember my cute robotic dancing teapot. It works great, but it has a little drawback: you need to open it to physically connect and disconnect the battery. Therefore, let’s fix that issue by integrating a switch directly in the teapot lid!

I designed three new plastic parts for the second version of the lid. The new lid features a hole instead of the handle, and the actual handle is to be glued to an axis going through the lid, with an elliptic lever at the bottom. The lever shall push a micro switch attached on the inside of the lid, just like you would press a button.

The three new parts: the lid with a hole, the handle, and the button switch
The three new parts: the lid with a hole, the handle, and the button switch

You can download the new SCAD source files (licensed under GPLv3) and the corresponding STL files on my GitHub repository. Apart from a micro switch, I’ll also use prototype board, pins, and a Dupont wire.

Continue reading Plasteac – Enhancements

Playing music on Arduino

Provided you connect a piezo speaker to your Arduino board, the tone Arduino function allows to play tones given their frequencies. Let’s use it to play entire melodies!

The melody encoding format I’ll use is compact and pretty straightforward, but I admit it isn’t the easiest one to read. The melody is represented as a null-terminated string of chars, in which each note is described by 3 consecutive characters:

  1. The note duration in sixteenth notes as an hexadecimal digit between 0 and F (0 has a special meaning and is interpreted as a whole note)
  2. The note name in English notation as an uppercase letter, or lowercase if sharp (R has a special meaning and indicates a rest)
  3. The octave number as a decimal digit, between 0 and 8 (for a rest, the value is ignored)

So for instance, a quarter-note C from the 5th octave is 4C5, and a eighth-note D sharp from the 4th octave is 2d4.

With this notation, the Tetris theme is:

In this example, a piezo passive sounder is connected on pin 3 of the Arduino board. The code to play a melody stored in the format defined previously can be written as follows:

Continue reading Playing music on Arduino

Plasteac: a dancing teapot

The Bob robot, itself remixed from the Arduped robot, inspired an impressive number of clones with its really good design.

The most famous ones might be Zowi, and more recently Otto. They are both simple, cheap, open-source and 3D-printed little robots which have refined Bob two-legged design.

Yet, I am not a fan of their strange square heads. What I would like is a teapot. A dancing teapot.

I chose to design 3D-printed parts from scratch, not only because I prefer to use OpenSCAD over FreeCAD, but also because the design of the top part will be entierly different anyway. Also, for once, it will be powered by a 9-volt alkaline battery rather than a lipo battery.

3D models forming the robotic teapot
3D models forming the robotic teapot

You can download the SCAD source files (licensed under GPLv3) and the corresponding STL files here or on my GitHub repository. I printed them with white PLA, not the fanciest color but the perfect one for a teapot.

The components are ready to assemble.
The components are ready to assemble.

Continue reading Plasteac: a dancing teapot

A telepresence robot – Enhancements

In this article, I’m going to describe architecture enhancements for the control system of the WebRTC-controlled telepresence robot I built a few months ago, presented in a previous article.

Since I did not manage to have a satisfying WebRTC support directly in a native Android app, I previously settled for a hack where the smartphone of the Telebot uses two different connections to the signaling channel: one to receive user control in the Android app, and one to handle the WebRTC session in the browser.

This was bad for two reasons:

  • The robot can enter an incoherent state if one connection is closed and not the other.
  • User control commands do not benefit from WebRTC, instead they travel through the server, adding latency and jitter.

The idea for the new architecture is to have the Android app run a small HTTP server in background that can accept motor control commands and send them to the Bluetooth device. We will send users commands on an RTCDataChannel and forward them to this small HTTP server with JavaScript in the browser.

General schematic of the enhanced architecture
General schematic of the enhanced architecture

Continue reading A telepresence robot – Enhancements

A telepresence robot – Programming

In this article we are going to program the Telebot we have built in the previous article.

We will use WebRTC, which is the new standard for real-time communication in Web browsers, and take advantage of the necessary signaling channel to also transmit commands to move the robot.

General schematic of the whole control system
General schematic of the whole control system

Programming the robot actually consists of three different steps:

  • Writing Arduino-flavored C++ code for the Arduino-like controller to properly move and balance the robot
  • Building a specific Android application to handle a WebRTC session on the smartphone and relay commands to the controller via Bluetooth
  • Setting up a node.js server to serve an HTML5 control page over HTTPS allowing visioconference and remote control
The Telebot ready to be programmed
The Telebot ready to be programmed

Therefore, the project will be a mix of Arduino, Android Java, and Javascript (client-side and server-side). The source code is free software, licensed under BSD 2-clause license and GPLv3 (Arduino code). The complete source for the project is available on my repository on GitHub.

Continue reading A telepresence robot – Programming

A telepresence robot – Building

Telepresence robots are pretty cool, so let’s build my own Telebot!

The telepresence robot allows visioconferencing while moving around
The telepresence robot allows visioconferencing while moving around

The robot will be built as a base with 4 wheels, on top of which a vertical pole allows to stick a smartphone. The smartphone, connected to the base via Bluetooth, will permit visioconference via WebRTC and remote control at the same time, allowing to move around. Even if the center of gravity is quite high, a gyroscope will prevent the robot from falling over. The base will be powered by lithium-polymer batteries and rechargeable via a USB connector.

The finished robot going around

This article covers building the robot, while the next article focuses on programming it.

Continue reading A telepresence robot – Building