Monthly Archives: January 2018

Adventures in Science: Liquid Crystal Displays

via SparkFun: Commerce Blog

“Liquid crystal” is not a made up-term, but it probably seemed that way back in the 1880s when Austrian botanist and chemist Friedrich Reinitzer was experimenting with chemicals found in carrots and found that some had two melting points. Many years later, in the 1960s, RCA pursued liquid crystal as a display technology. As a result, we have the LCD to thank for the popularity of our common portable technology, like laptops and smartphones.

Twisted Nematic (TN) is a fascinating structure. “Nematic” refers to the state of the liquid crystal where the long axes of the crystals line up with each other. By sandwiching the nematic liquid crystal between two polarizing filters and twisting one of the filters 90 degrees, the TN structure would form, which is capable of twisting the polarization of light.

Interestingly, we can apply an electric field across the TN structure to cause it to break up (essentially untwisting). This, in turn, prevents light from passing through the second filter, as it is then off the polarization by 90 degrees. By controlling the voltage across the TN material, we can effectively control the amount of light flowing through an LCD segment.

Each subpixel on your LCD monitor works this way, with the addition of a red, green or blue color filter. Three subpixels (red, green and blue) make up one pixel, and by controlling the light through each subpixel, we can create almost any color we want. With millions of tiny pixels, we can render images, text, video, etc.

Sub-pixels in an LCD

There are three different types of LCDs: reflective, transmissive and transflective. Most LCDs you come across, such as your computer or smartphone screen, are transmissive. Reflective LCDs require ambient light to be seen and can be found on things like inexpensive calculators. Finally, transflective screens can be viewed in ambient light and have an optional backlight. They are found on some automotive instrumentation and smart watches.

If you’re curious, SparkFun has a collection of transmissive and transflective screens.

What have you used LCDs for on your projects? Is it to play games on the Raspberry Pi, show simple data from a sensor or create an interactive interface? Let us know in the comments below.

comments | comment feed

Add an Arduino-based tachometer to your CNC router

via Arduino Blog

In order to get a good cut with a CNC router, the cutting tool speed needs to be properly set. Since his CNC didn’t come with RPM feedback, Troy Barbour came up with his own solution using an Arduino Nano along with an IR emitter/sensor pair.

The spindle was set up with a single reflective surface, enabling it to sense one pulse per revolution that is sent to the Arduino at up to up to 30,000 RPM. To ensure accurate measurement, the device was programmed using an interrupt, meaning that if another process is running, it will temporarily drop what it’s doing and count the incoming pulse.

RPM is displayed on a tiny OLED screen, which shows both an RPM number as well as a dial indicator for quick reference.

Build an optical RPM indicator for your CNC router with an Arduino Nano, an IR LED/IR photodiode sensor and an OLED display for less than $30. I was inspired by eletro18’s Measure RPM – Optical Tachometer Instructable and wanted to add a tachometer to my CNC router. I simplified the sensor circuit, designed a custom 3D-printed bracket for my Sienci CNC router. Then I wrote an Arduino sketch to display both a digital and analog dial on an OLED display.

You can see it in action below, and find build instructions and code on Barbour’s write-up.

Raspberry Crusoe: how a Pi got lost at sea

via Raspberry Pi

The tale of the little HAB that could and its three-month journey from Portslade Aldridge Community Academy in the UK to the coast of Denmark.

PACA Computing on Twitter

Where did it land ???? #skypaca #skycademy @pacauk #RaspberryPi

High-altitude ballooning

Some of you may be familiar with Raspberry Pi being used as the flight computer, or tracker, of high-altitude balloon (HAB) payloads. For those who aren’t, high-altitude ballooning is a relatively simple activity (at least in principle) where a tracker is attached to a large weather balloon which is then released into the atmosphere. While the HAB ascends, the tracker takes pictures and data readings the whole time. Eventually (around 30km up) the balloon bursts, leaving the payload free to descend and be recovered. For a better explanation, I’m handing over to the students of UTC Oxfordshire:

Pi in the Sky | UTC Oxfordshire

On Tuesday 2nd May, students launched a Raspberry Pi computer 35,000 metres into the stratosphere as part of an Employer-Led project at UTC Oxfordshire, set by the Raspberry Pi Foundation. The project involved engineering, scientific and communication/publicity skills being developed to create the payload and code to interpret experiments set by the science team.


Over the past few years, we’ve seen schools and their students explore the possibilities that high-altitude ballooning offers, and back in 2015 and 2016 we ran Skycademy. The programme was simple enough: get a bunch of educators together in the same space, show them how to launch a balloon flight, and then send them back to their students to try and repeat what they’ve learned. Since the first Skycademy event, a number of participants have carried out launches, and we are extremely proud of each and every one of them.

The case of the vanishing PACA HAB

Not every launch has been a 100% success though. There are many things that can and do go wrong during HAB flights, and watching each launch from the comfort of our office can be a nerve-wracking experience. We had such an experience back in July 2017, during the launch performed by Skycademy graduate and Raspberry Pi Certified Educator Dave Hartley and his students from Portslade Aldridge Community Academy (PACA).

Dave and his team had been working on their payload for some time, and were awaiting suitable weather conditions. Early one Wednesday in July, everything aligned: they had a narrow window of good weather and so set their launch plan in motion. Soon they had assembled the payload in the school grounds and all was ready for the launch.

Dave Hartley on Twitter

Launch day! @pacauk #skycademy #skypaca #raspberrypi

Just before 11:00, they’d completed their final checks and released their payload into the atmosphere. Over the course of 64 minutes, the HAB steadily rose to an altitude of 25647m, where it captured some amazing pictures before the balloon burst and a rapid descent began.

Portslade Aldridge Community Academy Skycademy Raspberry Pi Portslade Aldridge Community Academy Skycademy Raspberry Pi

Soon after the payload began to descend, the team noticed something worrying: their predicted descent path took the payload dangerously far south — it was threatening to land in the sea. As the payload continued to lose altitude, their calculated results kept shifting, alternately predicting a landing on the ground or out to sea. Eventually it became clear that the payload would narrowly overshoot the land, and it finally landed about 2 km out to sea.

Portslade Aldridge Community Academy Skycademy Raspberry Pi High Altitude Ballooning

The path of the balloon

It’s not uncommon for a HAB payload to get lost. There are many ways this can happen, particularly in a narrow country with a prevailing easterly wind such as the UK. Payloads can get lost at sea, land somewhere inaccessible, or simply run out of power before they are located and retrieved. So normally, this would be the end of the story for the PACA students — even if the team had had a speedboat to hand, their payload was surely lost for good.

A message from Denmark

However, this is not the end of our story! A couple of months later, I arrived at work and saw this tweet from a colleague:

Raspberry Pi on Twitter

Anyone lost a Raspberry Pi HAB? Someone found this one on a beach in south western Denmark yesterday #UKHAS

Good Samaritan Henning Hansen had found a Raspberry Pi washed up on a remote beach in Denmark! While walking a stretch of coast to collect plastic debris for an environmental monitoring project, he came across something unusual near the shore at 55°04’53.0″N and 8°38’46.9″E.

This of course piqued my interest, and we began to investigate the image he had shared on Facebook.

Portslade Aldridge Community Academy Skycademy Raspberry Pi High Altitude Ballooning

Inspecting the photo closely, we noticed a small asset label — the kind of label that, over a year earlier, we’d stuck to each and every bit of Skycademy field kit. We excitedly claimed the kit on behalf of Dave and his students, and contacted Henning to arrange the recovery of the payload. He told us it must have been carried ashore with the tide some time between 21 and 27 September, and probably on 21 September, since that day had the highest tide over the period. This meant the payload must have spent over two months at sea!

From the photo we could tell that the Raspberry Pi had suffered significant corrosion, having been exposed to salt water for so long, and so we felt pessimistic about the chances that there would be any recoverable data on it. However, Henning said that he’d been able to read some files from the FAT partition of the SD card, so all hope was not lost!

After a few weeks and a number of complications around dispatch and delivery (thank you, Henning, for your infinite patience!), Helen collected the HAB from a local Post Office.

Portslade Aldridge Community Academy Skycademy Raspberry Pi High Altitude Ballooning


We set about trying to read the data from the SD card, and eventually became disheartened: despite several attempts, we were unable to read its contents.

In a last-ditch effort, we gave the SD card to Jonathan, one of our engineers, who initially laughed at the prospect of recovering any data from it. But ten minutes later, he returned with news of success!

Portslade Aldridge Community Academy Skycademy Raspberry Pi Portslade Aldridge Community Academy Skycademy Raspberry Pi Portslade Aldridge Community Academy Skycademy Raspberry Pi Portslade Aldridge Community Academy Skycademy Raspberry Pi

Since then, we’ve been able to reunite the payload with the PACA launch team, and the students sent us the perfect message to end this story:

Portslade Aldridge Community Academy Skycademy Raspberry Pi High Altitude Ballooning

The post Raspberry Crusoe: how a Pi got lost at sea appeared first on Raspberry Pi.

Multicolor signal light with beeper

via Dangerous Prototypes


Multicolor signal light with beeper for ROS by Gal Pavlin

When debugging algorithms in an autonomous vehicle a light that can show algorithm state in real time was proven to be effective for easier debugging and additional insight to what is going on in the code.
Because all existing signal light were either to bulky or too expensive we decided to build our own. It was actually quite simple with few key elements:

  • 3x RGB LED strip
  • STM32F0 microcontroller with native USB support
  • Beeper

Via Mare & Gal Electronics.

Check out the video after the break.

Troubleshooting tips: Failed debugging with GDB

via Dangerous Prototypes


Erich Styger writes:

Three years ago I published “Debugging Failure: Check List and Hints” and unfortunately this article is one of the most popular ones: obviously debugging problems are very common. Debugging with GDB works usually fine, but if things are failing, then it can be hard to find the cause for it. Recently I have been asked to check some failures, so here are two more hints about what could go wrong…

More details at MCU on Eclipse blog.


Dotter is an Arduino-powered dot matrix printer

via Arduino Blog

While largely supplanted by more modern forms of printing, dot matrix printers still have their fans. Few, however, are more dedicated than Nikodem Bartnik, who constructed his own model that pulls paper up to 55cm wide and as long as he needs under a gantry that stamps each pixel with a marker.

The device is controlled via an Arduino Uno, which takes input from a Processing sketch running on a computer to obtain the image to be printed.

It uses a pair of stepper motors to advance the paper, as well as a third to position the marker to be stamped. A servo motor pushes the marker down as needed, producing a print that, as seen at 5:15 in the video below, is accurate and stylishly pixellated.