Monthly Archives: July 2018

New product: high-density QTR reflectance sensor arrays

via Pololu Blog

I am excited to announce the first of a new line of reflectance sensor arrays that feature a high-density 4-mm pitch and dimmable IR emitter brightness control. In addition to versions with our familiar IR emitter/phototransistor pair modules without lenses, which we will keep calling “QTR,” we have versions with a higher-performance sensor with lenses on the IR emitter and phototransistor, which we are calling “QTRX.” These higher-performance sensors allow similar performance at a much lower IR LED current, which can really start adding up at higher channel counts. (High-brightness, “QTRXL” versions of these boards are coming soon, too.)

These new sensor arrays also feature LED brightness control that is independent of the supply voltage (which can be 2.9 V to 5.5 V) and separate controls for the odd-numbered LEDs and the even-numbered LEDs, which gives you extra options for detecting light reflected at various angles. As with our older QTR sensors, we are offering these in “A” versions with analog voltage outputs and “RC” versions that can be read with a digital I/O line on a microcontroller by first setting the line high and then releasing it and timing how long it takes for the voltage to get pulled to the logic low threshold:

Schematic diagrams of individual QTR HD sensor channels for A version (left) and RC version (right).

This announcement therefore covers four total new products:

As with all our new products this year, we are offering a special introductory promotion, and this one is for half off up to three of each sensor type, limited to the first 100 customers using coupon code QTRHD07INTRO .

Happy Birthday, Harry Potter: wizard-worthy Pi projects

via Raspberry Pi

Today marks Harry Potter’s 38th birthday. And as we’re so, so very British here at Raspberry Pi, we have no choice but to celebrate the birth of The Boy Who Lived with some wonderfully magical projects from members of the community.

Harry Potter birthday Raspberry Pi

Build your own Daily Prophet

After a trip to The Wizarding World of Harry Potter, Piet Rullens Jr wanted to build something special to remember the wonderful time he and his wife had at the amusement park.

Daily Prophet poster with moving object

Daily Prophet with moving object

Piet designed and printed his own front page of The Daily Prophet, and then cut out a photo and replaced it with our Official Touch Display. The Raspberry Pi hidden behind it runs a short Python script that responds to input from a motion sensor by letting the screen play video footage from their wizarding day whenever someone walks by.

Read more about Piet’s project on our blog here, and in The MagPi here.

Wizard duelling

Since Allen Pan is known for his tech projects based on pop culture favourites, it’s no surprise that he combined a Raspberry Pi and Harry Potter lore to build duelling gear. But where any of us expecting real spells with very real consequences such as this?

Real Life Harry Potter Wizard Duel with ELECTRICITY | Sufficiently Advanced

Harry Potter body shocking wands with speech recognition…It’s indistinguishable from magic! With the release of Fantastic Beasts and Where to Find Them, we took magic wands from Harry Potter to create a shocking new game. Follow Sufficiently Advanced! Check out redRomina: Watch our TENS unit challenge!

When a dueller correctly pronounces one of a collection of wizard spells, their opponent gets an electric shock from a Transcutaneous Electrical Nerve Stimulation (TENS) machine.

Learn more about how the Raspberry Pi controls this rather terrifying build here, and remember: don’t try this at home — wizard duels are reserved for the Hogwarts Great Hall only!

Find family members with the Weasley clock

Curious as to where your family members are at any one time? So was Pat Peters: by replacing magic with GPS technology, Pat recreated the iconic clock from the home of the Weasley family.

Harry Potter birthday Raspberry Pi

But how does it work? Over to Pat:

This location clock works through a Raspberry Pi, which subscribes to an MQTT broker that our phones publish events to. Our phones (running the OwnTracks GPS app) send a message to the broker whenever we cross into or out of one of our waypoints that we have set up in OwnTracks; this then triggers the Raspberry Pi to run a servo that moves the clock hand to show our location.

Find more information, including links to the full Instructables tutorial,  on our blog.

Play Wizard’s Chess!

Motors and gears and magnets, oh my! Bethanie Fentiman knows how to bring magic to Muggles with her Wizard’s Chess set.

Harry Potter birthday Raspberry Pi

We bet ten shiny Sickles that no one has ever finished reading/watching Harry Potter and the Philosopher’s Stone and not wanted to play Wizard’s Chess. Pieces moving by magic, Knights attacking Pawns — it’s entertaining mayhem for the whole family. And while Bethanie hasn’t managed to get her pieces to attack one another (yet), she’s got moving them as if by magic down to a fine art!

Learn more about Bethanie’s Wizard’s Chess set here, where you’ll also find links to the Kent Raspberry Jam community where Bethanie volunteers.

Find your house with the Sorting Hat

Whether you believe yourself to be a Gryffindor, Slytherin, Hufflepuff, or Ravenclaw, the only way to truly know is via the Hogwarts Sorting Hat.

Harry Potter birthday Raspberry Pi

Our free resource lets you code your own Sorting Hat to establish once and for all which Hogwarts house you really belong to.

I’m a Gryffindor, by the way. [Editor’s note: Alex is the most Gryffindor person I’ve ever met.]

Create a wand-controlled lamp

Visitors to The Wizarding World of Harry Potter may have found themselves in possession of souvenir interactive wands that allow them to control various displays throughout the park. Upon returning from a trip, Sean O’Brien and his daughters began planning how they could continue to use the wands at home.

They soon began work on Raspberry Potter, an automation project that uses an infrared camera and a Raspberry Pi to allow their wands to control gadgets and props around their home.

Find the full tutorial for the build here! And if you don’t have a wand to hand, here are Allen Pan and William Osman making their own out of…hotdogs?!

Hacking Wands at Harry Potter World

How to make your very own mostly-functional interactive wand. Please don’t ban me from Universal Studios. Links on my blog: Allen’s Channel: Support us on Patreon: Website: Facebook: InstaHam: CameraManJohn:

You’re a project theme, Harry

We’re sure these aren’t the only Harry Potter–themed Raspberry Pi makes in the wild. If we’ve missed any, or if you have your own ideas for a project, let us know! We will never grow tired of Harry Potter projects…

Harry Potter birthday Raspberry Pi

The post Happy Birthday, Harry Potter: wizard-worthy Pi projects appeared first on Raspberry Pi.

DIY Desktop Light Sculpture

via SparkFun: Commerce Blog

light sculpture overview

My latest project, the Desktop Light Sculpture, is a digitally fabricated object featuring a 3D-printed base and laser-etched acrylic inserts. Inside the base you can find a neopixel matrix, a Qduino Mini, and a few other basic electronic components for usability.

The idea for this project is dependent on edge-lighting the acrylic. What this means is that when light is applied to the edge of a piece of acrylic, it will be picked up by any etched parts on the surface of the plastic as well as along its edges. This creates a beautiful visual effect!

The major element of this project is definitely the digital fabrication. I really love that there are two parts to design that have very different design constraints. The first, the 3D-printed base, needs to be designed to fit the electronic parts, hold the acrylic, and separate the light from each row of LEDs (as to not affect a neighboring piece of acrylic). The parameters offer a good design engineering challenge, but offer less in the way of creativity.

The second part, our acrylic inserts, must fit into the slot in the base, but otherwise offer complete creative freedom. They can be any shape or size and feature any etched design. With endless colors, patterns, and animations to program your LEDs, the design possibilities of this project are endless!

light sculpture blue

light sculpture pink

light sculpture rainbow

light sculpture 3/4 view

If you would like to make this project at home, you can grab everything you need from my Light Sculpture Wishlist.

Both the .stl for the 3D-printed base and the Illustrator file for the acrylic insert shape can be found on thingiverse. The images below illustrate how the parts fit into the base.

light sculpture matrix placement

light sculpture neopixel rows

light sculpture components

light sculpture power cord

You will notice that in addition to the LEDs and microcontroller, the project features a button, a switch and a potentiometer. The button is used to cycle through different LED colors, patterns and animations. The switch will turn the project on or off, and the potentiometer controls the brightness of your LEDs. The diagram below illustrates the circuit used in this project.

light sculpture circuit

Having a hard time seeing the circuit? Click on the image for a closer look.

Below is the program I used for this project. It utilizes the Adafruit Neopixel Library.

//Desktop Light Sculpture by Melissa Felderman for SparkFun Electrnoics July/31/2018

#include <Adafruit_NeoPixel.h> //include afafruit library 
#define PIN 6 //LED matrix pin
#define brightPot A0 //potentiometer to controll brightness
#define pwrSwitch 4 //power switch
#define momBut 5 //button to control LED mode
int numPix = 64; //total LED count
int brightPotVal; //Variable to hold pot value
int pixelBrightness; //variabe to hold brightness value
int switchState; //variable to hold switch value
int butState; //variable to hold button value
int mode = 0; //starting mode for switch state
int prevButState = LOW;
boolean butBool = false;
int topMode = 4; //max number of LED modes in switch state

unsigned long lastDebounceTime = 0;
unsigned long debounceDelay = 200;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPix, PIN, NEO_GRB + NEO_KHZ800); //declare neopixel matrix

//create an array for each row of LEDs
int rowOne[] = {0, 1, 2, 3, 4, 5, 6, 7};
int rowTwo[] = {8, 9, 10, 11, 12, 13, 14, 15};
int rowThree[] = {16, 17, 18, 19, 20, 21, 22, 23};
int rowFour[] = {24, 25, 26, 27, 28, 29, 30, 31};
int rowFive[] = {32, 33, 34, 35, 36, 37, 38, 39};
int rowSix[] = {40, 41, 42, 43, 44, 45, 46, 47};
int rowSeven[] = {48, 49, 50, 51, 52, 53, 54, 55};
int rowEight[] = {56, 57, 58, 59, 60, 61, 62, 63};

void setup() {

  pinMode(momBut, INPUT);
  pinMode(pwrSwitch, INPUT);


void loop() {
  brightPotVal = analogRead(brightPot);
  pixelBrightness = map(brightPotVal, 0, 1023, 0, 200);

  switchState = digitalRead(pwrSwitch);
  butState = digitalRead(momBut);


  //function to debounce button
  if ((millis() - lastDebounceTime) > debounceDelay) {
    if ((butState == HIGH) && (butBool == false)) {
      butBool = true;
      lastDebounceTime = millis();
    } butBool = false;
  } if (mode > topMode) {
    mode = 0;


  //switch state function to cycle through modes on LEDs, you can add as many or as few as you would like
  if (switchState == HIGH) {

    switch ( mode ) {
      case 0:
        for (int i = 0; i < numPix; i++) {
          strip.setPixelColor(i, 255, 255, 255);
      case 1:
      case 2:
      case 3:
      case 4:

  } else if (switchState == LOW) {
    for (int i = 0; i < numPix; i++) {
      strip.setPixelColor(i, 0, 0, 0);

//functions for LED colors

void everyOther() {
  for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowOne[i], 255, 255, 255);
    strip.setPixelColor(rowThree[i], 255, 255, 255);
    strip.setPixelColor(rowFive[i], 255, 255, 255);
    strip.setPixelColor(rowSeven[i], 255, 255, 255);

    strip.setPixelColor(rowTwo[i], 0, 0, 0);
    strip.setPixelColor(rowFour[i], 0, 0, 0);
    strip.setPixelColor(rowSix[i], 0, 0, 0);
    strip.setPixelColor(rowEight[i], 0, 0, 0);

void pinkGradient() {
  for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowOne[i], 185, 0, 255);
    strip.setPixelColor(rowTwo[i], 195, 0, 230);
    strip.setPixelColor(rowThree[i], 205, 0, 200);
    strip.setPixelColor(rowFour[i], 215, 0, 160);
    strip.setPixelColor(rowFive[i], 225, 0, 120);
    strip.setPixelColor(rowSix[i], 235, 0, 80);
    strip.setPixelColor(rowSeven[i], 245, 0, 40);
    strip.setPixelColor(rowEight[i], 255, 0, 10);

void buleGreenGradient() {
  for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowOne[i], 0, 75, 255);
    strip.setPixelColor(rowTwo[i], 0, 100, 225);
    strip.setPixelColor(rowThree[i], 0, 125, 200);
    strip.setPixelColor(rowFour[i], 00, 150, 175);
    strip.setPixelColor(rowFive[i], 0, 175, 150);
    strip.setPixelColor(rowSix[i], 0, 200, 125);
    strip.setPixelColor(rowSeven[i], 0, 225, 100);
    strip.setPixelColor(rowEight[i], 0, 255, 75);

void yellowGradient() {
  for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowOne[i], 255, 255, 25);
    strip.setPixelColor(rowTwo[i], 255, 220, 25);
    strip.setPixelColor(rowThree[i], 255, 190, 25);
    strip.setPixelColor(rowFour[i], 255, 160, 25);
    strip.setPixelColor(rowFive[i], 255, 130, 25);
    strip.setPixelColor(rowSix[i], 255, 100, 25);
    strip.setPixelColor(rowSeven[i], 255, 70, 25);
    strip.setPixelColor(rowEight[i], 255, 40, 25);
void rainbow() {
  for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowOne[i], 255, 0, 0);
  } for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowTwo[i], 255, 100, 0);
  } for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowThree[i], 255, 255, 0);
  } for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowFour[i], 0, 255, 0);
  } for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowFive[i], 0, 255, 200);
  } for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowSix[i], 0, 0, 255);
  } for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowSeven[i], 255, 0, 255);
  } for (int i = 0; i < 8; i++) {
    strip.setPixelColor(rowEight[i], 255, 0, 130);

I hope you enjoyed this project! It was a lot of fun to make and I’m excited to continue building out the program for more LED colors, as well as making different designs on the laser-etched acrylic.

If you love this project and want to give it a go but don’t have access to digital fabrication tools, try checking out your local library or maker space. If all else fails there are always online digital fabrication services from which you can order your 3D print and laser-etched acrylic. As always, please share your thoughts, ideas, and suggestions about this project in the comments below!

Shop For This Project Download the Design Files

comments | comment feed

Plotting Live Sensor Data with Python

via SparkFun: Commerce Blog

The Raspberry Pi (along with many other single board computers) offers the ability to directly connect to low-level hardware through its GPIO header. With this, we can communicate with sensors, take measurements and even use languages like Python to dynamically create graphs for us!

Sampling and plotting temperature data on a Raspberry Pi

The ability to programmatically create graphs can be extremely useful if you want to set up some kind of monitoring system or dashboard to, say, keep an eye on your room’s temperature. This could also be useful in classrooms to give students immediate feedback for sensor data, as well as create professional plots for reports.

Matplotlib is a plotting package for Python that works very similarly to the plotting functions found in MATLAB. If you’re looking to find out more about matplotlib, check out our newest Python tutorial:


Graph Sensor Data with Python and Matplotlib

July 23, 2018

Use matplotlib to create a real-time plot of temperature data collected from a TMP102 sensor connected to a Raspberry Pi.

If you were going to make an interactive dashboard that shows live graphs, what kind of data would you want to show? I may or may not be looking for ideas for my next tutorial…

comments | comment feed

Friday Product Post: Make Programming a Piece of Pi

via SparkFun: Commerce Blog

Welcome to another Friday Product Post! This week we have something really special to show off: the SparkFun Pi AVR Programmer HAT. We’ve been working on perfecting this board for almost two years and we are finally happy with how it has turned out! Along with the Pi AVR Programmer, we also have three new load cells, two microSD cards of differing capacities, a 10-pack of APA102C addressable LEDs, and a few new milling products from Carbide 3D!

Just as a reminder: You have until the 29th of July to get a free SparkFun Raspberry Pi Qwiic Kit if you already have $60 worth of product in your cart! After the 29th, the Four Weeks of Free event will be over, so make sure to get these deals while you can, because after that (or after the reserved units are gone) they will be gone! Find out how it works at our Four Weeks of Free page.

Let’s jump in and take a closer look at all the new products!

Perfectly-programmed Pi Power!

SparkFun Pi AVR Programmer HAT


The SparkFun Pi AVR Programmer HAT makes it easy to program AVRs directly from the SPI hardware pins on any Raspberry Pi. It was originally designed as an in-house solution for SparkFun production, but now is offered as a robust programming tool for anyone! This programmer is by far one of the fastest, most reliable and hack-able (fully open sourced) AVR programming solutions available. Whether you’re a beginner or experienced electronics enthusiast, the Pi AVR Programmer HAT should be easy to get up and running.

Mini Load Cell - 100g, Straight Bar (TAL221)

Mini Load Cell - 500g, Straight Bar (TAL221)


These miniature straight bar load cells (sometimes called strain gauges) can translate up to 100g or 500g of pressure (force) into an electrical signal. Each load cell is able to measure the electrical resistance that changes in response to, and proportional to, the strain (e.g. pressure or force) applied to the bar. With this gauge, you will be able to tell just how heavy an object is, whether an object’s weight changes over time, or if you simply need to sense the presence of an object by measuring strain or load applied to a surface.

Load Cell - 5kg, Straight Bar (TAL220B)


Now, if you are looking for a load cell with a higher tolerance, we suggest picking up the 5k version instead! If this still doesn’t fit your needs, make sure to checkout all of our load cell options.

microSD Card with Adapter - 32GB (Class 10)

microSD Card with Adapter - 64GB (Class 10)


These are class 10 microSD memory cards, perfect for housing operating systems for single board computers and a multitude of other information. We offer them now in 32GB and 64GB versions, but if you need something a little smaller, we still offer a 16GB version. Since this is a class 10 microSD it is capable of transferring data at speeds up to 80MB/s, allowing it to have a noticeable increase in performance while running an on-board OS.

SMD LED - RGB APA102C-5050 (Pack of 10)


This version of the APA102C is the regular, 5050-sized (5mmx5mm) SMD LED. With an integrated control circuit embedded, the APA102C-5050 is incredibly bright and colorful. If you look really closely, you can see the tiny gold chip hidden in there, along with minuscule gold wires connecting the chip to the LED. This is the same APA102C LED found in our Lumenati line and is perfect for applications needing a lot of color without breaking the bank.

PCB Engraver - #501 (2 Pack)

PCB Engraver - #502 (2 Pack)


These are two packs of #501 and #502 PCB engravers from Carbide 3D for your Shapeoko or Nomad CNC machine to supply you with even more fabrication and milling options. Each PCB engraver possesses a 0.1" or 0.005" ball tip with a 0.005" or 0.0025" radius (respectively), and are made of solid carbide to ensure long lasting use.

Ball Cutter - 0.125" Diameter, #101 (3 Pack)

Flat Cutter - 0.125" Diameter, #102 (3 Pack)

Ball Cutter - 0.0625" Diameter, #111 (3 Pack)

Flat Cutter - 0.0625" Diameter, #112 (3 Pack)


Expand your CNC accessory options with these new cutters from Carbide 3D! We offer these three-packs of cutters in four different options: 0.125in Diameter Ball, 0.125in Diameter Flat, 0.0625in Diameter Ball, and 0.0625in Diameter Flat. Make sure to pick a pack up today!

That’s all for this week everyone! Hopefully you are filled with fun project ideas after seeing this week’s product array. As always, we can’t wait to see what you make! Shoot us a tweet @sparkfun, or let us know on Instagram or Facebook. We’d love to see what projects you’ve made!

We’ll be back next week with even more fantastic new products!

comments | comment feed

All About Ham Radio

via SparkFun: Commerce Blog

Everyone has heard of ham radio, but do you actually know what it is? Recently, the idea of amateur radio caught my attention, and I decided to look into it a bit and see what it’s all about. The short answer is that from the creation of the first radio wave, people have been playing with and modifying radio waves to send information. Whether it’s an FM music station, AM talk radio, police and fire radios or your WiFi connection, radio waves are all around you.

Old Fashioned radio

Q: What is the purpose of amateur radio?

A: Other than talking to and meeting new people and learning new technologies? While I rarely do this I’m going to quote federal regulations. FCC Part 97 is the federal regulation that defines amateur radio. Basically, it includes making friends around the world, learning, and helping others.

a) Recognition and enhancement of the value of the amateur service to the public as a voluntary noncommercial communication service, particularly with respect to providing emergency communications.
b) Continuation and extension of the amateur's proven ability to contribute to the advancement of the radio art.
c) Encouragement and improvement of the amateur service through rules which provide for advancing skills in both the communication and technical phases of the art.
d) Expansion of the existing reservoir within the amateur radio service of trained operators, technicians, and electronics experts.
e) Continuation and extension of the amateur's unique ability to enhance international goodwill.

Q: How does amateur radio help others?

A: Whenever disasters hit, communication becomes a big issue. With power down and cell towers not working (or overwhelmed), amateur radio operators will step in to help coordinate disaster relief. Ares and RACES are two organizations that work together to provide vital communication during these times. If you are looking for a way to help during disasters (think hurricanes, not zombies), consider getting your license and working with one or both of these organizations.

Q: What does the FCC do?

A: If everyone was allowed to transmit on any frequency they wanted at any time and at any power, we would quickly run into problems. The FCC has broken the radio spectrum into bands and allocated different frequency bands for different usages. While the FCC determines what frequencies can be used for what purpose, the amateur radio community, for the most part, self polices protocol and etiquette within those bands. Here is a quick visual summary of the different bands and which licenses are required to use each band.

PNG of Radio Bands

Amateur Radio Bands

Q: Why do I need to get licensed, and what is the process?

A: The license procedure is fairly straight forward, and mostly makes sure you know what you are doing before you are allowed to transmit on the air (you do not need a license to listen). Your license is also what gives you your call sign so you can identify yourself over the air.

There are currently three different licenses available. The Technician license is the most basic license and also the most popular. This gets you on the air on some of the most popular frequencies, mostly in the UHF and VHF range. The General license allows you access to most of the HF frequencies as well, and the Amateur Extra license allows you to transmit on any amateur frequency. Each license requires you to pass a test (as well as having passed all the previous tests). The entire pool of test questions is publicly available, so there shouldn’t be any surprises when taking your test. Various organizations administer the test on a regular basis all over the country. You usually have a $10-$15 fee for the test (you can take all three levels at once for that price). They then submit your results to the FCC, and you get your license in a couple of weeks.

Q: What about Morse Code? I really don’t want to learn Morse Code.

A: Morse Code is no longer required for any of the licenses, so you are in luck. Many radio operators still enjoy using Morse, so you may still come across it, but it is not necessary. While I don’t know Morse Code (yet) I am working to hide it in random places, like blog posts.

Straight Key for Morse Code

Q: What does SparkFun do with amateur radio?

A: We actually have quite a few hams around here. There are about 800,000 amateur radio operators in the U.S. (about 0.2 percent of the population), but here at SparkFun we have at least eight hams, with another few who are looking to get licensed. We also carry a few different ham radio products, such as the Hack RF, the bladeRF x40 and the HX1 APRS Transmitter, and many of our other RF products operate in amateur frequencies (not to mention that amateur radio has always been about tinkering and building things – something we are pretty good at).

HackRF One


What other radio stuff would you like to see? Tell us in the comment section… (.._. .)

comments | comment feed