Stepper motor wiring tutorial

Occasionally you may come across an old stepper motor salvaged from a printer, or an ancient floppy drive. If you are lucky, there will be a part number on the motor and after some digging around, you will come up with a datasheet. Often though, you will have a motor with no markings whatsoever and four, or six colourful wires sticking out. First, you need to figure out how the wires are paired to form coils within the motor. Trial and error may work, but there is a better way! All it takes is a multimeter. ...

November 23, 2014 · 6 min · 1219 words · Stan

Arduino Joystick Module Example

In one of my rather frequent eBay visits, I came across a nifty little joystick module, much similar to the analog thumb-stick on the PlayStation 2 controllers. The module is very easy to use with an Arduino uno and only costs a few dollars. Several different versions are available from eBay, Adafruit, Sparkfun and other vendors, but they essentially work the same. Overview The module has 5 pins: Vcc, Ground, X, Y, Key. Note that the labels on yours may be slightly different, depending on where you got the module from. The thumbstick is analog and should provide more accurate readings than simple ‘directional’ joysticks tat use some forms of buttons, or mechanical switches. Additionally, you can press the joystick down (rather hard on mine) to activate a ‘press to select’ push-button. ...

October 7, 2014 · 5 min · 1005 words · Stan

Crazy Watch – Exploring electronics fundamentals

“It is good to have an end to journey toward; but it is the journey that matters, in the end.” ― Ernest Hemingway A few days ago my son came back from school with something that he had build in a Tech-Ed class. You had to carry a copper ring across a maze made of wire without “waking up the monster”. If you touch the wire, closing the circuit, the eyes (LEDs) would light up. ...

July 2, 2014 · 7 min · 1319 words · Wagner

HC-06 Bluetooth module datasheet and configuration with Arduino

In a previous post I shared my notes on how to connect an Arduino to an Android phone using the the popular and cheap HC-06 Bluetooth module. In that example I used the Bluetooth module with its default settings. That works fine, but some applications may require changing the communication speed (Baud rate), the pairing code, the module name etc. For example, I am trying to set-up a way to program my Arduino Uno and Arduino Pro Mini wirelessly, over Bluetooth. This requires changing the baud rate of the module from the default 9600 to 115200, or 57600, to match the default sketch upload speed for these Arduino boards. ...

May 26, 2014 · 15 min · 3135 words · Stan

Play simple melodies with an Arduino and a piezo buzzer

Piezo buzzer background Piezo buzzers are simple devices that are commonly used to produce beeps and sounds in many electronic gadgets, like alarm clocks, toys, pc boards, etc. They consume very little current and have high impedance, which means that you can safely connect them directly to a micro-controller pin. Buzzers have a piezoelectric ceramic plate that generates electricity when a mechanical force is applied to it and vibrates (extend and shrink) when exposed to an electric field. The first property is often used to detect knocks and musical tones, while the second property is what we are going to use to play a simple tune from an Arduino micro-controller. ...

May 11, 2014 · 4 min · 646 words · Stan

Arduino Uno and the InvenSense MPU6050 6DOF IMU

A while back I bought the InvenSense MPU-6050 sensor in a “GY-521” breakout board from eBay. For a long time it sat quietly in my box of “possibly cool things to check in the future”. Recently, I decided to finally get to building a self-balancing robot and dug it out. As with almost anything from eBay, it came with no documentation. The MPU-6050 breakout boards are quite popular in the Arduino community and information was easy to find. Even too easy: it took me a while to sift through many partial, or “almost” working implementations before I found a relatively easy to use, clean and reliable set of instructions and Arduino sample code. So here it is documented for future reference! MPU-6050 Overview According to the InvenSense MPU-6050 datasheet, this chip contains a 3-axis gyroscope and a 3-axis accelerometer. This makes it a “6 degrees of freedom inertial measurement unit” or 6DOF IMU, for short. Other features include a built in 16-bit analog to digital conversion on each channel and a proprietary Digital Motion Processor™ (DMP) unit. ...

March 28, 2014 · 27 min · 5748 words · Stan

28BYJ-48 Stepper Motor with ULN2003 driver and Arduino Uno

First, lets see the little steppers in action! Our main character, StepperBot, is “instructed” to move in a square path on my coffee table, making 90 degree turns at the corners. Turning exactly at the right time and by the right angle is critical avoid falling off and crashing on the floor in an embarrassing pile of messy wires. ...

March 2, 2014 · 26 min · 5330 words · Stan

Using Bluetooth and an Android phone for debugging Arduino sketches

I bought a Bluetooth module a few months ago and never really tried to use it because in my mind it would be another module that would require hours digging the internet to find libraries, and some code sample to get me started. Only after reading Stan’s post about Bluetooth modules I realized how easy is to get them working and how useful they can be to troubleshoot projects that require movement (like robots). Bluetooth basically makes your serial port wireless and open a whole new set of possibilities with two way communication between your Arduino and a Bluetooth enabled device. See more on the video below… Arduino – Robot troubleshooting with Bluetooth module

February 9, 2014 · 1 min · 114 words · Wagner

Differential drive with continuous rotation servos and Arduino

Purpose: Create a simple and easy to control drive system for a small robot with minimal number of parts and connections. ...

January 14, 2014 · 7 min · 1347 words · Stan

Programming ATtiny84 / ATTiny44 with Arduino Uno

My order of ATTiny84 chips from Mouser arrived yesterday, so it is time to load the Arduino Blink example sketch onto it. I made a small line follower using the ATTiny85 a while back, and quite liked the idea of having a smaller, cheaper IC that can run simpler Arduino sketches. The ATTiny84 comes with extra 6 I/O pins (see datasheet), so it should be an even better replacement of an Arduino for smaller projects. Here is a beautifully rendered mapping of the ATTiny84 / ATTiny44 pins courtesy of Alberto (PighiXXX): ...

January 4, 2014 · 8 min · 1586 words · Stan