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 .

#FreePCB via Twitter to 2 random RTs

via Dangerous Prototypes


Every Tuesday we give away two coupons for the free PCB drawer via Twitter. This post was announced on Twitter, and in 24 hours we’ll send coupon codes to two random retweeters. Don’t forget there’s free PCBs three times a every week:

  • Hate Twitter and Facebook? Free PCB Sunday is the classic PCB giveaway. Catch it every Sunday, right here on the blog
  • Tweet-a-PCB Tuesday. Follow us and get boards in 144 characters or less
  • Facebook PCB Friday. Free PCBs will be your friend for the weekend

Some stuff:

  • Yes, we’ll mail it anywhere in the world!
  • Check out how we mail PCBs worldwide video.
  • We’ll contact you via Twitter with a coupon code for the PCB drawer.
  • Limit one PCB per address per month please.
  • Like everything else on this site, PCBs are offered without warranty.

We try to stagger free PCB posts so every time zone has a chance to participate, but the best way to see it first is to subscribe to the RSS feed, follow us on Twitter, or like us on Facebook.

Pi-powered Atari 5200 multi-ROM cartridge (MultiCart)

via Dangerous Prototypes


Dr. Scott M. Baker has a nice write-up about building a multi-ROM cartridge for his Atari 5200 using Raspberry Pi:

The Atari 5200 is a vintage gaming system from the early 1980s. At the time I owned a 2600, but I always wanted a 5200. Well, in 2018 I finally decided to find one on eBay and buy it. I learned that the first thing you want to do after attaining a new gaming console is to get your hands on every available game cartridge for it, so I made this multi-ROM cartridge.
A multi-ROM cartridge, or “MultiCart” is a cartridge that contains more than one ROM image. There are multiple ways to go about this from selector switches to pick the cartridge you want, to built-in in game menu systems. I decided to go the route of using a Raspberry Pi for the user interface, making a WEB UI available to pick which cartridge is used.
The goal is not simply to play retro games on modern hardware — there’s any number of emulation solutions for that. The goal is to play retro games on retro hardware, but use a modern system to load the game image into the console.

See the full post at and the GitHub repository here.

Check out the video after the break.

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

Light painting rig is a masterpiece of artistic hardware hacking

via Arduino Blog

Light painting is an art form where dark areas are selectively lit to form interesting effects. While normally a manual operation, Josh Sheldon has come up with a rig to automate and enhance the process. The results are nothing short of spectacular, producing not static images, but astonishing animated light displays.

His device resembles a 3D printer made out of aluminum extrusion. X,Y, and Z axes are controlled by a series of stepper motors, but it uses a point of controlled light instead of melted plastic to form shapes. 

Light animations are set up in Blender, and a hardware and software toolchain including Processing, an Arduino Mega, and a Dragonframe module are implemented for control.

Check out the whole story in the video below, or see code/build documentation are available on GitHub.