Articles tagged with Arduino:

  • A USB-controlled Furby

    The original Furby from Tiger Electronics was a huge phenomenon at the end of the 1990s. In this article, we are going to replace a Furby's electronics to transform it into a USB-controlled puppet.

    The blue-eyed brown-bellied cute horror

    The blue-eyed brown-bellied cute horror

    The little beaked Mogwais looked quite alive and faked learning processes pretty well. As electronic talking toys were still a novelty back then, its capacities were grossly over-estimated, especially among children. For instance, the microphone is limited to sensing the noise level to talk back when you talk to it, it is actually unable to differentiate noises, let alone interpret speech.

    In reality, the technology was already old. As the patent indicates, Furbys were built around a 8-bit SunPlus SPC81A microcontroller, basically a crippled 6502 processor with 128 bytes of RAM (yes, bytes). The original MOS Technology 6502 processor was introduced in 1975 and became pretty popular because it was extremely cheap. For instance, the Atari 2600 and Apple II were both built around modified 6502 processors. It was a strong influence in the design of RISC architectures, in particular ARM processors. The voice synthesis is handled by a Texas Instruments …

  • Converting a unipolar stepper to bipolar

    Here is the situation: I have a 28BYJ-48 motor, a cheap unipolar stepper motor. However, I would like to drive it as a bipolar stepper motor.

    A 28BYJ-48 stepper motor

    A 28BYJ-48 stepper motor

    Unipolar stepper motors have 5 wires, whereas bipolar ones have only 4 wires. The 5th wire is a common wire joining the coils, creating 4 half-coils that can be enabled independently.

    Schema of a unipolar stepper motor

    Schema of unipolar and bipolar stepper motors

    Both types of stepper motors are not driven the same way. Unipolar steppers are simpler to drive since you don't need to reverse the current: the driver only applies the tension to the common wire and sequencially grounds the other wires to power the half-coils. The drawback of course is that they are less powerful because only half of each coil is powered at a given time, so you get half the torque for the same coil length.

    Luckily, you can use a unipolar stepper as a bipolar one with twice the torque, provided you have a circuit able to drive it. The modification is indeed rather simple: you need to remove the common wire and cut the link between the coils …

  • Eyepot - Programming

    Let's program the robot I built in the previous article!

    The Eyepot works by using in conjunction a Raspberry Pi Zero W and an Arduino Pro Mini connected by a serial link. Therefore, we'll write the Arduino code first, then a Python program for the Raspberry Pi. Then, we'll setup remote control from a web browser.

    You can find the entire source code for the project licensed under GPLv3 on my repository on GitHub.

    The finished Eyepot moving

    The finished Eyepot moving

    Arduino program

    The Arduino Pro Mini is responsible for driving the eight servos of the legs. Commands to specify target angles are sent from the Raspberry Pi through a serial link.

    The custom serial protocol is text-based and quite simple. It can easily be typed manually when debugging, but it is still compact enough to allow short transmission times even at low bitrates. Each line contains a one-character command, an optional space, and an optional parameter as a base-10 integer. Implemeted commands are as follows:

    • 0 to 7: store target angle for corresponding servo (0 to 7)
    • R: reset stored target angle to default for each servo
    • C: commit stored target angles …

  • Eyepot: a creepy teapot

    What has four legs but only one eye? A teapot of course!

    My new robot is based on a Raspberry Pi Zero W with a camera. It is connected via a serial link to an Arduino Pro Mini board, which drives servos. Since each one of the four legs will have two articulations, each with one servo, we need eight servos in total.

    Here is a list of the material we will use:

    Let's start by designing and printing the parts. I use OpenSCAD, and print with white PLA, as usual.

    View of the 3D models set

    View of the 3D models set

    You can download the SCAD source files (licensed under GPLv3) and …

  • 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 Arduino board of my robotic teapot with a piezo sounder

    The Arduino board of my robotic teapot with a piezo sounder

    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 …

  • 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 ready to assemble

    The components are ready to assemble

    You might have recognized the shape of the famous Utah teapot! However, this is a subdivided and smoother model since the original is …

  • 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.

    Arduino programming

    First, motor control is achieved through an extremely simple text protocol over the Bluetooth serial, with one single-letter command …

  • A telepresence robot - Building

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

    Schema of a telepresence robot

    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.

    Telebot moving around

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

    We will use the following components: