Posts by David

You are currently viewing a selection of posts from the Pololu Blog. You can also view all the posts.

Introducing RPicSim

Posted by David on 19 September 2014
Tags: RPicSim
Introducing RPicSim

RPicSim is an open source software library written in Ruby that provides an interface to the MPLAB X PIC simulator and allows you to write simulator-based automated tests of PIC firmware. While RPicSim has been available since early this year, we just released version 1.0.0 and are excited to share why we made it and to encourage people to start using it. Continued…

New product: P-Star 25K50 Micro

Posted by David on 15 August 2014
Tags: new products
New product: P-Star 25K50 Micro

We just released the P-Star 25K50 Micro, a programmable breakout board for Microchip’s PIC18F25K50 microcontroller. Although we have been using PIC microcontrollers since our very first product, the P-Star 25K50 Micro (abbreviated P*) is our first product where the PIC microcontroller can be programmed by the user. The P-Star 25K50 Micro is the same size as our AVR-based A-Star 32U4 Micro, and we designed it with the hope that it would be small and cheap enough to go into (and stay in) almost any project.

The PIC18F25K50 has 32 KB of flash program memory, 2 KB of RAM, and built-in full-speed USB functionality. Applications can be developed using standard Microchip PIC compilers and development tools (such as MPLAB X and XC8).

The P-Star 25K50 Micro can be programmed via its proprietary USB bootloader using our open source software that is available for Windows, Linux, and Mac. The bootloader uses 8 KB of flash memory, leaving 24 KB for the user. Alternatively, an ICSP programmer can be used to erase the bootloader and access the full 32 KB of program memory. (Since the bootloader cannot be recovered, we recommend this option only for those who are comfortable programming exclusively with an external programmer.)

The P-Star 25K50 Micro features a precision 16 MHz crystal, a USB Micro-B connector, and three user-controllable LEDs. A voltage regulator and power selection circuit allow the board to be powered from either USB or an external 5.5 V to 15 V source, while a resettable PTC fuse on the USB VBUS supply and reverse protection on VIN help protect it from accidental damage.

P-Star 25K50 Micro pinout diagram.

Compared to the popular ATmega32U4 microcontroller, the PIC18F25K50 has nearly the same performance and memory capacity, but it also has some compelling features that are missing on the AVR. For example, the PIC18F25K50 uses the PIC18 architecture, which has two interrupt priority levels: interrupts can be assigned to either level, and a high-priority interrupt routine can run in the middle of a low-priority one. This powerful feature is what enables our Maestro servo controllers to generate precise servo signals while still using low-priority interrupts to assist with serial communication and other tasks. Unlike the ATmega32U4, the PIC18F25K50 can operate at full speed down to 2.7 V (though the brown-out reset on the P-Star is activated at 2.85 V by default).

P-Star 25K50 Micro, bottom view.
P-Star 25K50 Micro on a breadboard with a reset button (left) and a bootloader button (onboard).

The PIC18F25K50 also has a 5-bit digital-to-analog converter (DAC), which is a fun feature not available on many 8-bit microcontrollers.

A 3 kHz triangle wave generated by the 5-bit digital-to-analog converter (DAC) on the P-Star 25K50 Micro.

For more information, check out the P-Star 25K50 Micro page, and let us know what you think in the comments.

Version 2.0.0 of minimu9-ahrs released

Posted by David on 10 July 2014

This week I released version 2.0.0 of minimu9-ahrs, an open-source demo program that runs on the Raspberry Pi, reads data from a MinIMU-9 via I²C, and uses the readings to calculate the orientation of the IMU. The new version adds support for the MinIMU-9 v3. The program now supports all past and present versions of the MinIMU-9.

The original version of minimu9-ahrs was released back in 2012, along with ahrs-visualizer, a program for displaying the orientation in 3D. For more background, you can see my blog post about minimu9-ahrs from 2012 or read the Raspberry Pi blog post about it from June 2014. The video below shows minimu9-ahrs and ahrs-visualizer working together:

Version 2.0.0 of minimu9-ahrs also includes some other changes:

In this new version, the raw accelerometer readings that you can get using the --mode raw option have basically been multiplied by 16 from what they were before. We made this same change to our LSM303 Arduino library when we added support for the LSM303D. The reason for this change is that before the MinIMU-9 v3, all the MinIMU-9 accelerometers were 12-bit, with the lower 4 bits of the output registers being unused, so we always shifted the readings to the right by 4 bits to get rid of the unused bits. The LSM303D in the MinIMU-9 v3 has a 16-bit output, so shifting its readings to the right by 4 bits would be inappropriate. However, it is nice for the raw accelerometer readings to have the same scale regardless of which accelerometer you happen to be using, so we chose to stop shifting the output of any of the accelerometers. All the accelerometers are configured to have a full-scale range of ±8 g by minimu9-ahrs, so a reading of 4096 will always correspond to about 1 g. This change should not affect most users, but it is not backwards-compatible, so, following semantic versioning, I incremented the major version number from 1 to 2.

The Debian package that I made for minimu9-ahrs version 2.0.0 uses the armhf architecture instead of armel (which was used for previous versions), so you can easily install it on a Raspberry Pi running Raspbian. I also made a new version of ahrs-visualizer that has an armhf package. If you are not using a Debian-based distribution like Raspbian or you are not using the armhf architecture, you can still compile the programs from source.

With this new version of minimu9-ahrs and our recent big price reduction of Pololu IMUs (which made the MinIMU-9 less expensive than a Raspberry Pi), now is a great time to start experimenting with these state-of-the-art MEMS sensors.

Related past posts

New products: Discrete addressable through-hole RGB LEDs

Posted by David on 9 June 2014
Tags: new products

A chain of addressable RGB LEDs (#2535 and #2536) on a breadboard, controlled by an A-Star 32U4 Micro.

At first glance, these new LEDs look like everyday through-hole RGB LEDs, but they are hiding something very special inside: a built-in WS2811 LED driver that lets you chain them together and individually control them all with a single digital output from a microcontroller. The communication protocol of these LEDs is very similar to that of our WS2812B-based LED strips and Adafruit’s NeoPixels (such as those on the Adafruit NeoPixel Shield, which we just started carrying last week), so there is a variety of sample code available for the Arduino, AVR, and mbed microcontroller platforms to help you make your project start blinking quickly.

We offer these LEDs in two different sizes: 5 mm and 8 mm.

Two different sizes of addressable RGB LED. From left to right, their diameters are: 5 mm (#2535) and 8 mm (#2536).

David and Fang's dead reckoning robot based on the mbed LPC1768

Posted by David on 14 March 2014
Tags: lvbots
David and Fang's dead reckoning robot based on the mbed LPC1768

Several people here at Pololu made robots to compete in the LVBots dead reckoning competition last week. This post is about the robot I made along with another engineer here.

Dead reckoning is the process of continuously calculating your position using internal sensors that tell you something about what speed and direction you are going. In our dead reckoning competitions, robots demonstrate that they are capable of dead reckoning by following a long, twisting line drawn on the floor and then driving back to their starting point. The line functions as a user interface that directs the robots through a sequence of moves for which it was not preprogrammed. The robots are scored based on the time they took and how close they were to the starting point at the end. Continued…

Raspberry Zumo Robot

Posted by David on 6 January 2014
Raspberry Zumo Robot

Frédéric Jelmoni built a neat robot with a Raspberry Pi and a Zumo Chassis Kit. The Raspberry Zumo robot can be controlled over WiFi using telnet. The server on the Raspberry Pi is written in Python and uses the RPIO library to send signals to an SN754410 motor driver that drives the two 100:1 Micro Metal Gearmotors HP in the Zumo chassis. The server also controls an RGB LED and a buzzer. A stripped-down Logitech webcam attached to the front of the robot provides video that is streamed over the web using mjpg-streamer.

For more details, see the Raspberry Zumo page, which is written in French. Also, see our post from last October about a similar robot, the Pibot-B.

New products: Addressable RGB LED strips based on the WS2812B

Posted by David on 6 December 2013
Tags: new products
New products:  Addressable RGB LED strips based on the WS2812B

This week we started selling new addressable RGB LED strips. These LED strips are a great way to add some color to a project, and I would like to show a little bit about how they work. Here is a close up showing one segment of a new LED strip:

Close up of one segment of a WS2812B-based LED strip, with the red, green, and blue LEDs on at their dimmest setting.

At first glance, it is easy to see the RGB LED and a capacitor, but where are all the other components, such as the LED driver? Well, let’s look more closely at the LED:

Close up of a WS2812B, with the red, green, and blue LEDs on at their dimmest setting.

The LED actually has a driver built into it, which is the large brown rectangle in the picture. This driver receives high-speed color data, storing the first 24 bits it sees and passing the rest of the bits down the strip to the next LED. The driver is connected with tiny wires to the red, green, and blue LEDs. For the photos above, we turned each of the LEDs on at its dimmest setting so you can see their colors. This integrated circuit (IC) consisting of an RGB LED and a driver is called the WS2812B.

Since the WS2812B integrates an LED and a driver into the same package, we are able to offer higher density strips than before. We offer these WS2812B LED strips that have 60 LEDs per meter:

We also offer these WS2812B LED strips that have 30 LEDs per meter:

These LED strips are meant to replace the older LED strips we have that are based on the TM1804 driver (items #2543, #2544, and #2545). The older LED strips are now on clearance.

All of our example code has been updated to fully support the new strips. We provide example code for the Arduino, AVR, and mbed microcontroller platforms. More information about the LED strips and how to use them can be found on the LED strip product page.

Controlling an addressable RGB LED strip with an Arduino and powering it from a 5V wall power adapter.

Quaternion-based AHRS using AltIMU-10 & Arduino

Posted by David on 19 November 2013

Quaternion-based AHRS using AltIMU-10 & Arduino

Pololu forum user Camel recently posted the Quaternion-based AHRS using AltIMU-10 & Arduino. This is an Arduino program that can read data from our AltIMU-10 sensor board, compute the orientation of the board, and output it over serial. It uses quaternions internally to represent the rotation, but can output Euler anglers, a rotation matrix, or a quaternion. The MinIMU-9 v2 is just an AltIMU-10 without a pressure sensor, so the code can be made to work with a MinIMU-9 v2 by commenting out a few lines.

The AHRS program is part of the Firetail UAV System, an open source UAV autopilot system that is currently under development. You can follow the the project’s progress on its blog.

New product: Raspberry Pi

Posted by David on 15 November 2013
Tags: new products
New product: Raspberry Pi

We are now carrying the Raspberry Pi Model B, Revision 2.0!

In case you haven’t heard of the Raspberry Pi, it is a popular credit card-sized computer that can run Linux. It was designed by the Raspberry Pi Foundation in order to provide an affordable platform for experimentation and education in computer programming. The Raspberry Pi can be used for many of the things that a normal desktop PC does, including word-processing, spreadsheets, high-definition video, games, and programming. With its 0.1″-spaced GPIO header and small size, the Raspberry Pi also works as a programmable controller in a wide variety of robotics and electronics applications. We have seen a lot of our customers do neat things with the Raspberry Pi, and we have featured several of those projects on this blog.

Related past posts featuring the Raspberry Pi:

For more information on the Raspberry Pi, see the product page.

Wireless Servo Widget

Posted by David on 28 October 2013
Wireless Servo Widget

Pololu forum user Martan recently released a project called Wireless Servo Widget. The project website says:

Wireless Servo Widgets allow you to control up to 64 slaves, with each slave controlling up to six R/C type servos. In addition, each slave can return 3 analog input values to your Raspberry Pi. Slaves have a range of about 50 feet from the master. Use them for home automation, robotics, model train controls, or whatever you want!

The Wireless Servo Widget is based on our Wixel Programmable USB Wireless Module. Martan wrote apps for the Wixel that use the packet addressing feature of the CC2511F32 chip to implement a round-robin protocol. He also made a Slave Widget Breakout Board which makes it easy to plug servos into the slave Wixels. All of this and more can be found on the Wireless Servo Widget website.