A Halloween Arduino project

A simple Halloween themed project to add some animation and sounds to a cardboard skeleton cut-out. A PIR sensor at the top right corner (somewhat hidden under a clump of fake spider web) detects movement and triggers a hobby servo that rotates the torso of the skeleton. The eyes are a pair of red LEDs and the sound effects come from a WTV020SD-16P sound module. The “brain” of the operation is an Arduino Nano. ...

November 1, 2015 · 1 min · 118 words · Stan

Arduino script for MPU-6050 auto-calibration

I while back I did some work on a self-balancing robot using and Arduino Uno and the InvenSense MPU-6050 6DOF sensor. Using the sensor is easy, thanks to Jeff Rowberg’s I2Cdev library and sample code. If you look around line 200 of the MPU6050_DMP6 example arduino sketch that comes with the library you will see the following: // supply your own gyro offsets here, scaled for min sensitivity mpu.setXGyroOffset(220); mpu.setYGyroOffset(76); mpu.setZGyroOffset(-85); mpu.setZAccelOffset(1788); // 1688 factory default for my test chip I did some further reading on the I2CDev forum and found several threads on calibrating the MPU-6050 sensor and determining the optimal offsets. These, apparently, are specific to your device, as well to the exact orientation of the module, once it is installed. I found a significant improvement using the script by Luis Rodenas attached to this forum thread. Below is the Arduino sketch version 1.1 (the most current at the time of this post). For best results, mount your module and run the script, while you have it stable in the position you will use it. For example, on a self balancing robot, have the robot upright in the optimal balanced position and keep it steady while the script completes and you see output with the suggested offsets. You then need to copy these offsets and overwrite the defaults in the sample code (around line 200, as mentioned above). ...

September 27, 2015 · 8 min · 1571 words · Stan

Access your Raspberry Pi Terminal and Graphical Desktop remotely using SSH and VNC

This post will cover the steps necessary to set-up remote access to the Raspberry Pi terminal and graphical desktop environment from a Windows, or Linux PC. I do not have a Mac, but the steps should be very simillar. In some posts this is referred to as running your Raspberry Pi “headless”. I want to put my Raspberry Pi 2 on a small mobile robot platform, so I can’t have it drag a mouse, keyboard and monitor around. The steps below will work for Raspberry Pi models B, B+ and 2. ...

April 8, 2015 · 13 min · 2710 words · Stan

Experimenting with Sound Localization and Arduino

Today I’m going to walk you through my experience trying to localize the source of a sound using Arduino. My goal with this was to add a feature to my robot that would make it more interactive and look more “alive”. Beta 1 What you normally see people doing, as an easy approach, is to measure the volume level from two microphones in which the amplified output is connected to the Arduino analog inputs. Whichever input is higher determines the source direction of the sound. ...

April 4, 2015 · 13 min · 2661 words · Wagner

Raspberry Pi 2 Initial set-up and configuration with NOOBS / Raspbian

Unlike the Arduino, the Raspberry Pi is not a micro-controller, but rather a small, bare-bones computer that needs an operating system in order to run. The most popular OS for the Raspberry Pi currently is a version of Linux, called Raspbian, specifically optimized for its hardware. I plan to use Raspbian exclusively on my new Raspberry Pi 2 and this posts assumes you will be too. Things you will need to set-up your Raspberry Pi 2: A computer with internet access to download the required software for the Raspberry Pi. An 8 gig (for some extra space, a 4 gig one should work too) Micro SD card. You also need a way to write to the card either by using the SD card slot in your laptop, or a USB SD/Micro SD Card Reader/Writer. A HDMI display (computer monitor, or TV) and an HDMI cable. A DVI display will work as well, if you have a HDMI to DVI cable/adapter. A USB keyboard and a USB mouse. Wireless ones will work most of the time, but if you run into problems, try the “old school” wired versions. After the initial set-up, you can configure remote access to your Raspberry Pi, from another computer and drop the peripherals and the extra monitor. 5 Volt micro USB power supply that can provide at least 1.2 A, with a 2.5 A recommended if you plan to use all 4 USB ports of the Pi. Here is more info on the Raspberry Pi power requirements. Internet connection via an Ethernet cable, or a WiFi adapter to update the software. One of my two WiFi adapters did not work with the Pi, so I recommend to use the Ethernet cable for the initial set-up. I will cover the WiFi configuration in a follow-up post. Formatting the SD Card The Micro SD card for the Raspberry Pi 2 needs to be formatted using the FAT32 format. To do that you can use the SD Formatter program by SD Associates, available for Windows and for Mac. For Linux, the Raspbian.org start-up guide recommends GParted, a free application for managing disk partitions using a graphical interface. On my old Ubunto laptop, I had to install the package with “apt-get” and run it as administrator. ...

March 23, 2015 · 8 min · 1493 words · Stan

Raspberry Pi 2 for Robotics

I just got a Raspberry Pi 2 in my hands and hope with its help to add some cool features to my new robot projects, beyond the capabilities of the trusted Arduino. The specific goal, besides just tinkering around with something new, is to get basic computer vision working, using OpenCV and a webcam, or the Raspberry Pi Camera board. Here is a great project by Samuel Matos for inspiration: ...

March 22, 2015 · 2 min · 256 words · Stan

Bipolar stepper motor control with Arduino and an H-Bridge

It is a well known fact that Stepper motors are awesome! The only downside is that they can be a bit trickier to get going than servos and plain old DC motors. If you are interested in the inner mechanics and theory of stepper motors, check this excellent post on PCB heaven. If you happen to have one of the cheap little 28BYJ-48 steppers with 5 wires and a little driver board with them, check this tutorial instead. Here, I will focus on how to get a bipolar stepper motor (typically 4 wires) working with Arduino and a H-Bridge IC like the L293D , or the drop in improved replacement – SN754410NE . ...

December 2, 2014 · 9 min · 1799 words · Stan

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

Replacing a damaged Arduino Uno voltage regulator

While testing a new circuit on a breadboard, my good old Arduino Uno suddenly released its “magic smoke” with a loud pop and stopped working. On a closer inspection, I saw that a small crater had appeared on the 5 volt voltage regulator. The next step was to figure out just how bad things were. I powered up the board via the 5v pin from a regulated power supply and…the Arduino came back to life! It looked like the voltage regulator was the only damaged component. ...

October 31, 2014 · 2 min · 418 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