Author Archives: Rob Reynolds

Where am I, Exactly? A Guide to SparkFun’s GPS Modules

via SparkFun: Commerce Blog

At the end of 2018, the US Air Force launched the first of 32 GPS III satellites, which will replace the current constellation of satellites, ultimately offering three times greater accuracy and an eight-fold improvement in anti-jamming capabilities. You may also recall back on April 6th when the GPS Week Rollover on Coordinated Universal Time (UTC) occurred. Since the week numbers are encoded into the data stream by a 10-bit field, they were only good for about 19.7 years, or 1024 weeks. However, part of the new system upgrade will include switching the week data to a 13-bit field, meaning we won’t see another rollover for about 157 years.

With all of these improvements happening throughout the field of global positioning, we would be remiss if we didn’t up our GPS game here at SparkFun as well. Over the past decade, our GPS modules have gotten faster, more accurate and easier on the wallet. And if you’re interested in increased accuracy, and are not yet familiar with Real Time Kinematics, you’re definitely going to want to take a look at this video.

To that end, here’s a short overview and comparison of our current crop of GPS modules.

Happy Hacking!

comments | comment feed

Introducing the Pizza Roll Console!

via SparkFun: Commerce Blog

If you were keeping an eye on E3 last week - that’s the Electronic Entertainment Expo, one of the premiere events for the video gaming industry - then you know Miller Lite introduced the Cantroller™, a beer can, full of beer, that is also a Bluetooth gaming controller. Of course, you couldn’t buy one of these. But you could win one of the two hundred that Miller Lite was giving away, simply by beating comedian Eric Andre in a game of Street Fighter. And naturally, you would both be playing using the Cantroller. It was a great way for Miller Lite to get noticed at this year’s E3. They even released a heavy-on-visuals/light-on-copy commercial before the event, which you should definitely watch.

alt text

"It's a beer can. It's a controller. It's a Cantroller™." Image ©2019 Miller Brewing Co., Milwaukee, WI

This is the type of project I can wholeheartedly support. It’s ridiculous, kitchy and fully functional, and there was really no reason for it to exist other than because a bunch of people were sitting around in a meeting, and one said, probably in a Beavis-sounding voice, "Hey, you know what would be cool? If we made, like, a beer can, but it was also a game controller. Heh heh."

We’re no strangers to wireless controllers here at SparkFun - we’ve had the Sparkfun Wireless Joystick Kit for quite a while now. Nor are we strangers to hacking game controllers, so seeing Miller Lite’s controller immediately brought two things to the front of my mind: first, why didn’t I think of this, and second, what could I do that would be similar or complementary to this project?

alt text

From Phillip Torrone's Maker Faire 2007 Flickr

Creating a solution where there is no problem

Instead of looking for what’s needed, I decided to look for what was ridiculous. If you were lucky enough to win one of the Cantrollers, it’s a pretty good bet that you have several gaming consoles. I looked for obvious pairings – game controllers pair with gaming consoles, and cold beer pairs with tasty snacks. From this was born…

The Pizza Roll Console™!

I figured the gaming console would be fairly easy. I used a Raspberry Pi 3 B+, along with the Raspberry Pi 7” LCD Touchscreen, a Hamburger Mini Speaker, and one of our now-retired 5Ah Lithium Ion Battery Packs. I loaded up RetroPie, and Emulation Station, the video game emulator. The RaspberryPi 3 B+ seemed the perfect choice, since it has built-in Bluetooth, and would therefore be compatible with the Miller Lite Cantroller. You can learn how to set up your own RetroPie system here.

For reasons I cannot explain, my brain just kept yelling “Pizza rolls! Pizza rolls!” I found that the big box of Totino’s Pizza Rolls looked to be about the perfect size. I knew I would have to make some kind of insert for the Totino’s box so that it had a little structural stability. I also wanted to give it two sections: the bottom would house all of the electronics, while the top section would hold pizza rolls.

With access to a laser cutter here at SparkFun, I used MakerCase to create a finger-jointed box that I could cut out of quarter-inch and eighth-inch acrylic. I made a few adjustments to allow for the screen opening, a hole for the wired controller, some venting to keep the system cool and to let a little sound out, and the separator to keep the pizza rolls out of the electronics. I carefully opened the Totino’s box from the bottom, so I could open the factory sealed top in the video. I test fit the acrylic box, and it was just a little too large - my tolerances were too tight - a reduction in the outside dimensions by two percent, and it was a perfect fit.

Box for components and snacks

The acrylic box, with an opening for the Raspberry Pi screen, side opening for the wired controller, a separator, and some side venting.

It couldn’t be that easy

Having created the insert to house the electronics (and some pizza rolls), I put in the speaker, battery, Raspberry Pi and touchscreen. They all fit beautifully. Then I attempted to slide it all into the pizza roll box. That’s when I learned that the glass of the touchscreen was about 3mm too wide for the box.

Box With Components

Well look at that, the components fit, but the screen glass IS wider than the containment box!

I struggled, forced and pleaded, but it looked like there was no way it would all fit in without tearing the box edges. So I took my hobby knife and carefully opened the box on its seam. I was then able to slide the entire assembly in, then hot glue the box back together as tightly as it would fit. I also made a hole in the side of the box where the Raspberry Pi’s USB ports sit, so I could insert the wired controller once the assembly was sealed inside the box. Of course, this wouldn’t be necessary with a wireless controller.

alt text

Party in the front, party in the back. What's not to like?

Thinking of building your own? Here are some thoughts

Since this was basically just a fast and fun build, designed for a quick fake commercial, there were definitely some shortcuts taken. The biggest, of course, is that the entire system needs to be powered up, then hermetically sealed inside the pizza roll box. To power it down, you either have to tear the box open again, or just play until the battery drains completely.

Ah yes, the battery. This setup could be quite a drain on a single cell LiPo battery. Knowing I would not be using a wireless controller, and not knowing how long the shoot would take, I swapped out the Raspberry Pi 3 B+ for an older Pi 2 that I had sitting around. Since this board lacks Wifi and Bluetooth, I knew it would draw less current, and therefore last longer. With the now-retired 5Ah battery pack, it was still running strong after four and a half hours.

Ideally, a finished product would have, hidden on the bottom of the box, a way to turn the system on/off, a way to turn the speaker on/off (or just use a speaker that could be powered from the Raspberry Pi), and a USB port to charge the battery. The immediate issue that comes to mind there, however, is that single cell LiPo chargers that also allow for output have a current limit of about 1A - not enough to run a system like this. But hey, that’s future me’s problem, and something I’ll worry about if the good people at Miller Lite find it in their hearts to send me a Cantroller™ to go with my Pizza Roll Console™!

comments | comment feed

The End of an Era

via SparkFun: Commerce Blog

If yo're reading this, I’m going to assume you are familiar with Maker Media. You’ve had a subscription to Make Magazine, you’ve been to a Maker Faire or you’ve built a project from one of their many guides. The bottom line is, if you know SparkFun, then it’s a fairly safe bet that you also know Maker Media.

alt text

You may have seen this installation at any of the last three Bay Area Makers Faires.

As I’m sure you’ve heard by now, late Friday night Maker Media announced it had halted operations and laid off its entire staff. Company founder and CEO Dale Dougherty, who has been open about the struggles to keep the company in the black, confirmed the closure to TechCrunch.

While this may not come as a complete surprise, it is still a sharp blow to the maker community – and it truly is a community. I have many friends, colleagues, even occasional acquaintances whom I’ve met through this community. The medium didn’t matter – a welder, a stitcher, a glass blower, and all those makers who it’s difficult to even categorize – they all came together as a community, and not just at Maker Faires and Mini Maker Faires. We've kept in touch on forums and chat rooms, maker spaces and sometimes, despite our typically introverted nature, we would even meet up socially to grab a coffee or beer and share ideas and encouragement.

Make Magazine collection

Some of my Make: Magazine collection. Remember how shocked we were with the new size of volume 37?

I remember the first time I found Make Magazine. It was almost summer, 2005, and as I waited for my car to get its oil changed, I wandered into Barnes & Noble and there it was. The cover boasted of a DIY R2-D2, and in the table of contents, it promised to teach me how to hack my old mouse into a light-seeking robot, and how to use a lens from my SLR camera to create a webcam telescope. I was hooked! I purchased the next two issues that year from a local news stand, and at the beginning of 2006 I started my subscription. As issue after issue continued to roll in over the years, I had great plans to build about 80 percent of the projects I saw, as I read each issue cover to cover. I probably started about 15 percent, and finished about two percent, but I loved every minute of it. Every success and failure, every frustration and new bit of knowledge re-ignited my passion for making, hacking and engineering.

SparkFun RC Plane

Inspired by the RC plane "The Towel" in volume 30, I made this SparkFun-themed variation. (Yes, it actually flies!)

I remember my first Maker Faire. I remember all of the Maker Faires I attended. It was at my third Faire that I bought my first 3D printer, because even though it was still more than I could afford, the discount being offered was so great I couldn’t afford NOT to buy it! I saw amazing projects and met incredible people and was inspired a thousand times over in a thousand different ways! I felt like these were my people, this was where I belonged, and everyone there, whether presenters, exhibitors, or attendees, brought something interesting to the table.

alt text

Attendance had started to level off in recent years, and actually began decreasing at the flagship Faires.

As the above graphic from Maker Media shows, attendance at Maker Faires (and interest in the maker movement, one can assume) has continued to grow. However, attendance at the Bay Area and New York flagship Faires had in recent years leveled off and actually declined, and although there continues to be an increase in interest around the world, interest does not always equate to profitability.

With the plethora of free online content available to makers, and the increasing costs of publishing a printed periodical, subscriptions fell. Additionally, the cost of producing an event the size and scope of the flagship Maker Faires became unrecoupable, with major sponsors like Intel, Microsoft and Disney exiting not only the Maker Faire, but the entire maker market.

What’s next?

Dougherty still believes that even though the company may have failed as a business, it is certainly not failing as a mission. In his interview with TechCrunch, Dougherty said, “We’re trying to keep the servers running. I hope to be able to get control of the assets of the company and restart it. We’re not necessarily going to do everything we did in the past but I’m committed to keeping the print magazine going and the Maker Faire licensing program.” He went on to say, “It works for people but it doesn’t necessarily work as a business today, at least under my oversight.”

While we may very well have seen the last Bay Area Maker Faire, at least in the form with which we’ve grown familiar, it’s important to remember that there have been over 200 owned and licensed Maker Faire events (featured and Mini Maker Faires) per year in over 40 countries. Even if we have, in fact, seen the last of the Bay Area and World Maker Faire New York events, I think it’s safe to say that in one form or another, there will continue to be gatherings of makers. We will still meet up, share ideas, learn from each other and help push each other to new heights, and if Dale Dougherty has his way, they will remain under the Maker Faire flag. Maker Media and Make Magazine have done amazing things for the maker community, and they will forever have my gratitude.

comments | comment feed

Is That Justice Calling?

via SparkFun: Commerce Blog

Last week, when I should have been in the studio filming another new product video, I was instead sitting in a large room with a few hundred other civic-minded individuals, fulfilling my annual jury duty obligation. I was pulled for a jury pool, brought into the courtroom and questioned for what seemed like an exceptionally long time by both the prosecuting and defense attorneys. Finally, in the end I was released, and didn't have to sit on the jury this time around...

...just not in time to crank out this new product video. However, I wasn't about to pass up a chance to demo something as exciting as a battery charger! For all of the information on it, take a look at the product page, as well as the Hookup Guide.

So without further ado, here it is, the new Sparkfun LiPo Charger Plus!

Sorry, Your Honor, but this is the only charge in which I am interested

comments | comment feed

How’s the Weather Up There?

via SparkFun: Commerce Blog

Springtime in the Rockies can bring with it some very interesting weather. So this week, I decided to grab our SparkFun micro:climate kit for micro:bit, put it all together and see exactly what was happening outside our windows here at SparkFun HQ. I've programmed it to record and broadcast temperature, humidity, wind speed, wind direction and rainfall, although that last one takes a bit of patience. And while my desk is right on the edge of the micro:bit's Bluetooth radio range with the interference that the building creates, I can walk over to the breakroom and watch all the information scroll by perfectly on my second micro:bit. And by using the SparkFun OpenLog (included in the kit) to record all of the data to a file every sixty seconds, I can always go back and see what happened out there while I was locked inside our windowless studio.

If you haven't yet worked with the micro:bit, or if you want to start digging into block coding (with Microsoft MakeCode), MicroPython or even JavaScript, this kit will help you gain a mountain of working knowledge, with a very gentle learning curve.

comments | comment feed

Lord of the Ring Lights

via SparkFun: Commerce Blog

I’ve spent some time on these Tuesday blog posts talking about, among other things, color mixing, and analog and digital inputs in Python, using our LumiDrive LED Driver in combination with our RGB LED Rings. Well, I thought it was time to combine them all into one semi-useful project.

I’ve used the LumiDrive, along with one of our 3” LuMini LED Rings, to make a macro ring light.

This is a light ring that attached to the lens of your camera and evenly illuminates your subject with the light coming from the camera’s point of view. It makes it easier to avoid errant shadows when shooting close-ups. Most of them are a ring of LEDs with a diffuser lens, while some will offer an additional blue lens and orange lens, to give the resulting image a cooler or warmer look, respectively.

You can purchase an inexpensive one for thirty or forty bucks, and the results will be pretty much what you would expect from that price range. On the other hand, if you’re serious about your close-up photography, you could pick up something like a Kaiser KR 90 Ring Light for just under four hundred dollars – a little more than I would spend, especially when I know I would enjoy the challenge of creating my own. Now if you know me, you know that I believe that any project worth doing is worth overdoing. So with all of the tools at my disposal, why wouldn’t I make a macro ring light that offered 16.7 million colors?

Red ring

Macro ring lights give even illumination from the camera’s point of view when shooting close-ups.

The idea

The last time I talked about color mixing with LEDs, I dealt primarily with RGB. This time around I’m looking at HSV. There are a couple of reasons for this. The first is simply because I wanted to do a bit more exploration into the HSV color model. The second is a bit more practical. The pins broken out on the LumiDrive consist of a pair of analog and a pair of digital. Had there been three analog pins, I might have just set one to each of the red, green and blue values. However, I figured with what we have available, I could use the analog inputs for both hue and saturation, and use the digital inputs to increase and decrease the value by small increments.

HSV Color Space

The HSV Color Space depicted as a solid cylinder, showing the travel of Hue, Saturation and Value. (Image courtesy of Wikimedia Commons.)

In the HSV color space, the hue travels around the space in 360 degrees. Saturation goes from the outside of the space, which is full saturation, to the center, which is no color saturation at all. This means that, regardless of the hue, if the saturation is all the way down, the color will show as white (assuming that the value is all the way up). The value, then, can be roughly equated with brightness.

The brains

The build is based around the SparkFun LumiDrive LED Driver, paired with the LuMini 3” LED Ring. It contains 60 APA102s, and can be easily controlled with the LumiDrive just by writing a little bit of Python code. I prototyped it all on a breadboard, just to make sure I could actually make it do what I wanted it to.

You may have noticed in my previous post that I soldered female headers into the LumiDrive to make life easier. However, once I moved from prototype to final product, I soldered my potentiometers and momentary buttons directly to the board. Also, to create a more finished look, I used a 3.5mm TRRS jack coming out of the LED poke-home connectors. Then, from the LuMini, I used a TRRS audio connector. I figured that this would make transporting the two parts easier, and put less strain on the connections at the LumiDrive end. To power it all, I’m using a 1Ah Lithium Ion Battery.

Now to make my life easier, I did cut the red (+) wire from the battery and installed a small switch to power the project on and off. I’m sure you’re aware that lithium ion batteries can be twitchy, and by twitchy, I of course mean fire-y and explode-y. So if you’re not comfortable with this, you can certainly adjust the top of the housing to easily allow you to unplug the battery from the LumiDrive when not in use.

The body

The two halves of the body took a bit of experimenting and trial and error. For the ring itself, after a few different ideas including variations on a 3D-printed ring clamp, I decided to use a Lens Adapter Ring for the Cokin CBP400A P-Series Filter Holder. I thought it would be ideal, but I was off by about 2mm.

Ring Adapter

By using a ring adapter like this one, I can easily swap out whatever size I need for whichever different lens I might be using.

I wound up having to notch the outside of the ring adapter, as the mounting holes on the 3-inch LuMini fell right on the edge of the ring, but in the end, it gave stability to the entire thing. I designed and printed the ring body, realized that I had forgotten a place to run the wiring, added a notch and a hole, and reprinted. The second print worked almost perfectly, which may be a new record for me!

To add a little stress relief to the cable, and again create the illusion of a thing that someone might have actually purchased, I added a grommet. I also designed a diffuser for the front of the ring. I first printed it with white ABS, but even at 1mm, it was still too thick for the light to make a difference. I’ll try again with a clear ABS.

Exploded 3D model

The designed parts, modelled in Fusion 360.

For the electronics and battery housing, I made it as compact as I could. I also designed it to have a cold shoe and retaining ring, so that it could lock down onto any DSLR camera. The retaining ring goes down onto the cold shoe adapter first, then the adapter gets screwed to the main housing body.

I always enjoy the challenge of figuring out how to design for 3D printers - what needs to be supported, what can’t be supported, how to create and assemble two separate parts so that they can both be properly supported when being printed – all of that stuff. I added holes for the potentiometers and buttons, along with the on/off switch, and I designed the front so that an opening remained for charging the LiPo battery, as well as reprogramming should the need or desire arise, without having to disassemble the housing. I have to say, I’m quite satisfied with the design.

Putting it all together

I have to admit to having a lot of fun playing with a number of variations, not necessarily because I thought they were all possible implementations for this project, but because I like the challenge of math. Seriously, I knew I wouldn’t need a single potentiometer, whose range is read as 65535 steps, to inversely control both red and blue LEDs so that as one rose from 0 to 255, the other descended from 255 to 0, using only integers throughout the range. Setting green at 10 and controlling red and blue in opposition, this is what I came up with:

inverseColors = (math.trunc((HUEpot.value * 255) / 65535), 10, abs(math.trunc((HUEpot.value * 255) / 65535)-254))

Truncating returns integers, not floats, and using the absolute value returns only a positive integer. But I digress.

The dotstar and fancyLED libraries that Adafruit has created were paramount here, as was our LumiDrive code that Elias put together. While I have used the fastLED library on previous Arduino builds, and there are still a number of things that can be done with addressable LEDs in the Arduino environment that aren’t easily accessible using Python, these libraries and circuitPython were extremely helpful in making this happen. Here is what my final code looks like.

import adafruit_dotstar # The LED library
import adafruit_fancyled.adafruit_fancyled as fancy
import math
import time
import board
import digitalio
from analogio import AnalogIn

# Setting up the board's blue stat LED, mostly for testing
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT

# Here we'll define the inputs/values for HSV
SATpot = AnalogIn(board.A3)
HUEpot = AnalogIn(board.A4)
VALval = 0.4 # Set the initial value for Value, since it's button-driven

# Setting up the digital IO pins as input buttons
button8 = digitalio.DigitalInOut(board.D8)
button8.direction = digitalio.Direction.INPUT
button8.pull = digitalio.Pull.UP

button9 = digitalio.DigitalInOut(board.D9)
button9.direction = digitalio.Direction.INPUT
button9.pull = digitalio.Pull.UP

# These two variables should be adjusted to reflect the number of LEDs you have
# and how bright you want them.
num_pixels = 40 #The 3" ring has 60, the 2" ring has 40, the 1" ring has 20
brightness = 0.5 #Set between 0.0 and 1.0, but suggest never running at full brightness
startSequence = 0 # Last minute addition to create startup sequence

# Some standard colors.
BLACK = (0, 0, 0)
RED = (255, 0, 0)
YELLOW = (255, 150, 0)
ORANGE = (255, 40, 0)
GREEN = (0, 255, 0)
TEAL = (0, 255, 120)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)
MAGENTA = (255, 0, 20)
WHITE = (255, 255, 255)

# This creates the instance of the DoTStar library.
pixels = adafruit_dotstar.DotStar(board.SCK, board.MOSI,
    num_pixels, brightness= brightness, auto_write=False)

# The travel function takes a color and the time between updating the color. It
# will start at LED one on the strand and fill it with the give color until it
# reaches the maximum number of pixels that are defined as "num_pixels".
def travel(color, wait):
    num_pixels = len(pixels)
    for pos in range(num_pixels):
        pixels[pos] = color

def slice_rainbow(wait): # Just a little startup color animation

    num_pixels = len(pixels)

    pixels[::6] = [RED] * math.ceil(num_pixels / 6)
    pixels[1::6] = [ORANGE] * math.ceil((num_pixels - 1) / 6)
    pixels[2::6] = [YELLOW] * math.ceil((num_pixels -2) / 6)
    pixels[3::6] = [GREEN] * math.ceil((num_pixels-3) / 6)
    pixels[4::6] = [BLUE] * math.ceil((num_pixels-4) / 6)
    pixels[5::6] = [PURPLE] * math.ceil((num_pixels-5) / 6)

# Here's where the action happens
while True:
    if startSequence == 0: # Startup with a quick color animation
    startSequence = 1 # Stops opening sequence from continuing to run

    if not button8.value: # Increases the Value in increments of 0.05
        VALval = round(VALval + 0.05, 2)
        if VALval > 0.8:
            VALval = 0.8 # Limit Value (brightness) to 0.8 to avoid meltdown
        time.sleep(0.05) # Debounce
    elif not button9.value:
        VALval = round(VALval - 0.05, 2)
        if VALval < 0:
            VALval = 0
        time.sleep(0.05) # Debounce

    print ("Value value = ", VALval)
    TRYME = fancy.CHSV(HUEpot.value / 65535, SATpot.value / 65535, VALval)
    packed = TRYME.pack() # Converts HSV into HEX

    pixels.fill(packed) # Sets color to given HEX value # Illuminates LEDs

    time.sleep(0.01) # Debounce

The result

3/4 shot

I created a graphic so the user knows about where they are with hue and saturation, and which way the value buttons adjust.

Project on Camera

The diffuser didn’t quite make it in time to go to print, but the results are still quite even. Notice it also works on tiny Star Wars characters.

I have to say, I’m very happy with the end result. Now admittedly, since I am adjusting the value incrementally, I am not able to create the full 16.7 million colors originally advertized. However, it does everything I wanted it to, and does it all quite easily.

It’s very user friendly, although I do see some possible issues and changes to improve or customize it as needed. Perhaps you find a color that is absolutely perfect for your needs. That’s great if you never change from it, but what if you want to recall it later? What if you find half a dozen colors that are perfect for half a dozen different types of shots that you frequently repeat?

Maybe you do a little reprogramming so that the value always remains constant, while you can still adjust the hue and saturation, and you re-purpose the buttons so that one saves and enumerates your favorite colors, and the other recalls them. Or perhaps you want to add more visual interest to your shots by illuminating only one side. Maybe each button controls one half of your LEDs, so you can light left side only, right side only or full illumination. I’d love to hear any ideas, variations or improvements you may have on this, or the builds and ideas that are swirling around in your heads. Let’s face it, we learn this stuff so that we can make cool projects, right?

Gandalf Warhol

Completely alter the feel of your images through the lens by making simple adjustments, without a photo editor. How Warholian!

I’ve put the .STL files, along with the code and the graphic, up on GitHub. If you’re interested, you can find them all here, and the full wish list of parts here and below.

comments | comment feed