Author Archives: SparkFun Electronics

3D-Printed SIK Organizer

via SparkFun: Commerce Blog

Last week we introduced the brand-new SparkFun Inventor’s Kit (SIK) v4.0 and, with it, a new HDPE carrying case. The new carrying case is lighter and stronger than the old one, which is awesome, but it doesn’t have little compartments for organizing your parts. I know that a lot of people found the old SIK case useful for keeping extra components organized on the go; in fact, there a lot of folks here at SparkFun HQ hoarding the old cases for just that reason. The old case had its problems too, though. It was heavier, sometimes the plastic would get brittle and crack, and the hinges for the cover didn’t always play nice.

If you could just add dividers to the new SIK case, which also has a carrying handle, that would be the best of both worlds…so that’s what I decided to do!

screenshot of a 3D model in Autodesk Fusion 360. The model is of a tray  with removable dividers

I fired up Fusion 360, grabbed a set of calipers and modeled a tray insert that would fit inside the new case. The tray has removable dividers so you can choose between more compartments or larger compartments. The largest section is big enough to store the Arduino and Breadboard Holder so you don’t need to take apart your current circuit to put it away. I exported the model into Cura and sliced it for printing on our TAZ 5 3D Printer and…

photo of a failed 3D print of the model with a large crack in the side from de-lamination and warped dividers

Oops…it seems that print could have gone better. Large, flat prints can be hard to get right because thermal stress builds up in the big, continuous surfaces. The thermal stress warps the base of the print, and then everything goes downhill from there. This is especially common in open-air printers because some parts of the model are allowed to cool faster than others. I decided that it was time to build an enclosure for the TAZ, and since I’m a professional fabricator, I used only the best materials…

photo of a cardboard 3D printer enclosure held together with duct tape

…that I could dig out of the recycle bin. I know it looks silly, but you would be amazed how much of a performance boost even a top-shelf 3D printer can get out of a cardboard box. I taped up the edges with Gorilla Tape and cut a few access flaps so I could still reach the control panel and the SD card slot. I even taped a scrap piece of clear acrylic to the front so I could still check on the print without letting the heat out. The enclosure keeps heat from the heated build plate in and around the model. This uniform temperature keeps thinner parts of the model from cooling too fast and introducing mechanical strain that could warp larger structures and split layers. With the new enclosure in place, I was finally able to print the SIK case insert!

photo of the new SIK Case with removable dividers

That’s much better! You’ll notice that I’m using Snappable Protoboard as dividers, but I also made printable dividers if you want to go that route. I find printing thin, flat pieces like that a little difficult and time consuming. Your best bet is probably to buy some white polystyrene sheet from your local hobby shop and cut dividers out of that! As for the tray, it’s not a bad print as long as your 3D printer has an enclosure or is somewhere that it won’t be bombarded with rogue air currents.

You can print your own using the models available on the GitHub Repo. I’ve published the Fusion 360 files as well as STL meshes, STEP and IGES files. If you make improvements to the design, or alternate versions, file a pull request, and I’ll add them to the official repository!

Happy Hacking!

comments | comment feed

According to Pete: Headphone Amp Project/High-Current Output Stages

via SparkFun: Commerce Blog

Welcome to the latest edition of ATP! This time I design and build a headphone amp specifically designed to operate at the end of a chain of guitar effects boxes, and be able to take stereo input from stereo effects like delay, chorus, etc. But oh, the best laid plans of mice and Petes…

This project tells the tale of many design iterations, bad case cutting and the importance of cool stickers, as well as the value of measurements over blind hypothesis and assumptions. And what starts out as a really simple circuit that doesn’t really work right ends up being, still, a fairly simple circuit but works a whole lot better.

You can’t get all of the components in the project from us, but here’s the list if you want to follow along:

It’s worth a mention that the ProtoPedal pre-cut case was out of stock when I started this project, otherwise I would have gone with that. But since it was out, I basically free-handed the whole shebang. For better or worse, it’s all about the journey.

comments | comment feed

Paying Homage to the Laser Cutter – Three Great Projects

via SparkFun: Commerce Blog

As digital fabrication becomes more popular, and more common, makers are moving beyond the 3D printer to many other tools – including the laser cutter. At SparkFun, the laser cutter is a very busy machine; we wanted to pay homage to it by recognizing a couple of great projects.

Complex Sculptures Built from Layers of Laser-Cut Paper

Eric Standley leverages his understanding of math, technology and art to build complex pieces from layers of laser-cut paper. In this video (embedded with his permission), he shares a bit about his motivation, process and inspiration.

New work from Eric Standley will be showcased on December 7, 2017, at the PULSE Contemporary Art Fair (Miami Beach), represented by Victori + Mo Contemporary.

Layered Maps Built from Laser-Cut Wood

This Game of Thrones fan used a laser cutter to build a layered wooden map – it offers quite a bit of detail while still supporting an interesting aesthetic. During this long spell sans GoT, this may be a good project to undertake.

Camera Case Built from Cardboard

On the more practical (yet still artful) side, this video shows a camera case that uses laser-cut cardboard for the padding inside. This approach could have many applications.

Finding a Laser Cutter

Not everyone has a laser cutter. The good news is that access to digital fabrication tools is becoming more widespread. If you can locate a FabLab or Makerspace nearby, they may have a laser cutter you can use. We recently discovered The Maker Map – this open-source project attempts to map out where you can find maker resources all over the world. Let us know what you think; it seems to have many of the resources local to us (in Colorado), but we did need to do some filtering.

alt text

Share some of the unique laser-cut projects you have seen or created yourself in the comments below!

comments | comment feed

Friday Product Post: SIK VERSION 4.0!

via SparkFun: Commerce Blog

Hello and welcome, one and all! This is a momentous week for us here at SparkFun Electronics, one that only happens every couple of years, as we release a new version of the SparkFun Inventor’s Kit! That’s right, everyone, the SIK v4.0 is here! In previous versions of the SIK, each circuit focused on introducing a new piece of technology. With the SIK v4.0, components are introduced in the context of the circuit you are building, and each circuit builds upon the last, leading up to a project that incorporates all of the components and concepts introduced throughout the guide. With new parts and a completely new strategy, even if you’ve used the SIK before, you’re in for a brand-new experience!

Not only are we releasing the new SIK today, but we also have an Arduino Uno version, a Bridge Pack to update your existing kit, and a slew of new products that make up these new kits.

On top of the new versions of the SIK, we also have produced a brand-new Online Experiment Guide and an informational page to deepen your learning and answer any questions you might have. These pages can be found here:

SIK Info Page SIK Experiment Guide

Now that we’ve covered the changes and knowledge bases, let’s take a closer look at all of these new products!

The SIKness!

SparkFun Inventor's Kit - v4.0

KIT-14265
$99.95

The SparkFun Inventor’s Kit (SIK) is a great way to get started with programming and hardware interaction with the Arduino programming language. The SIK includes everything you need to complete five overarching projects consisting of 16 interconnected circuits that teach everything from blinking an LED to reading sensors. The culminating project is your very own autonomous robot! No previous programming or electronics experience is required to use this kit. New parts, new box, new projects!

The kit does not require any soldering and is recommended for beginners ages 10 and up.


SparkFun Inventor's Kit for Arduino Uno - v4.0

KIT-14418
$109.95

We have a version of the SIK for our international friends as well! The SparkFun Inventor’s Kit for Arduino Uno replaces the SparkFun RedBoard with the Arduino Uno (SMD version) and comes without the SIK guidebook and carrying case. With these parts being swapped and removed, we were able to reduce the overall size and weight of the kit, making shipping cheaper and easier for anyone ordering internationally. Anyone is free to purchase this kit or the original RedBoard version (listed above), but we love to provide you with options!


SparkFun Inventor's Kit Bridge Pack - v4.0

KIT-14536
$19.95

Do you own one of the third versions of our popular SparkFun Inventor’s Kit and aren’t ready to buy version 4.0? You are in luck! The SparkFun Inventor’s Kit Bridge Pack was built to provide you with an easy way to move into the next SIK edition without buying a whole new kit. Each Bridge Pack includes all of the new parts found in the SIK v4.0 that aren’t in any of the version 3 kits, as well as the most up-to-date guidebook so you can get started right away!


Carrying Case - Black HDPE

PRT-14474
$9.95

Sometimes all you need is a simple but durable carrying case for small parts. This carrying case is molded out of protective, black High-Density Polyethylene (HDPE), providing a good mix of abrasion resistance, impact toughness, resistance to chemicals, and strength for whatever you need to put inside!

Unlike previous cases for the SIK, this version does not feature storage compartments. If you like to keep your components ultra-organized, we’ve provided a 3D-printable file that you can use to create separators for your case. We have also provided the interior dimensions on the product page so you can design your own separators to meet your specific needs.


SparkFun Motor Driver - Dual TB6612FNG (1A)

ROB-14451
$4.95
SparkFun Motor Driver - Dual TB6612FNG (with Headers)

ROB-14450
$5.45

The SparkFun TB6612FNG Motor Driver can control up to two DC motors at a constant current of 1.2A (3.2A peak). Two input signals (IN1 and IN2) can be used to control the motor in one of four function modes: CW, CCW, short-brake or stop. The two motor outputs (A and B) can be separately controlled, and the speed of each motor is controlled via a PWM input signal with a frequency up to 100kHz. We also offer a version with headers already attached!

These versions of our Motor Driver are largely similar to the previous iterations, but we have fixed a few silk errors.


Multicolor Buttons - 4-pack

PRT-14460
$1.50

This is a simple 4-pack of multicolor buttons, great for all sorts of projects! Unlike previous iterations of multicolor buttons, this pack’s tactile switches are actually recessed into the housing so they don’t accidentally fall off during use. Each pack comes with one red button, one blue button, one yellow button and one green button.


Resistor 330 Ohm 1/4 Watt PTH - 20 pack (Thick Leads)

PRT-14490
$0.95

Last up today are five new versions of your basic resistors that have been largely requested by you! These new resistors come in packs of 20 and feature much thicker leads that will be sure to remain in place when inserted into breadboard ports. No wiggling and no hassle! These resistors come in 330 ohm, as shown above, 100 ohm, 1K ohm, 10K ohm and 1M ohm versions. The thicker-lead versions of the 330 and 10K ohm resistors are included in the SIK v4.0.


alt text

Finally we’re taking part in Single’s Day for the first time ever with a few sweet discounts including 11% off most sensors. You can check out all the details here!


That’s it, everyone! We really hope you enjoy the newest version of the SparkFun Inventor’s Kit. We are confident that this SIK will help even more individuals become interested in coding and prototyping with electronics! As always, we can’t wait to see what you make with these parts! Shoot us a tweet @sparkfun, or let us know on Instagram or Facebook. We’d love to see what projects you’ve made!

Thanks for stopping by. We’ll see you next week with even more new products!

comments | comment feed

Enginursday: Using Flask to Send Data to a Raspberry Pi via WiFi

via SparkFun: Commerce Blog

Flask is a simple Python web app framework that can be used to run server-side Python scripts in response to web requests. In this blog post we will show you how to combine that with the ESP8266 Thing to control your Raspberry Pi 3 via WiFi.

Glamour shot of thing and RPi

A basic Flask app can be written in as few as seven lines of code:

language:python
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

Example source

The magic, as it were, happens around the @app.route("/") statement. This statement defines a function to be run when an HTTP GET request hits the Flask app at that path (in this case, at the “no-path” path, or the domain-level path without any additional direction). Hopefully you can see even from this example how powerful this is (for good or evil): it allows you to execute arbitrary Python code on a Raspberry Pi (or any computer, really) just by sending a simple HTTP GET request.

Furthermore, the route can contain wild cards that become variables in the function below. Consider this example route:

@app.route('/gpio/<string:id>/<string:level>')
def setPinLevel(id, level):
    GPIO.output(int(id), int(level))
    return "OK"

Now, we accept as strings named id and level the next two layers of path after gpio. This allows us to toggle any GPIO pin on the Raspberry Pi.

Issuing an HTTP GET request is very simple. It’s one of the primary examples that any WiFi-based board is probably going to provide. The ESP8266 Thing is no exception to that. The Arduino support package includes a simple HTTP client sketch, which, with slight modification, can be made to issue an appropriate GET request to the Raspberry Pi.

For more information on how to do this, check out my tutorial on using Flask. It will walk you through everything you need to know to make a working WiFi connection from an ESP8266 Thing and a Raspberry Pi 3.

comments | comment feed

Automated Conference Room Signage

via SparkFun: Commerce Blog

Among the various growing pains that SparkFun has experienced over the years, perhaps the most persistent has been the proliferation of meeting rooms leading to a variety of mid-meeting interruptions and snafus. Don’t get me wrong; it can be nice to break up a long meeting with the occasional, “Oh sh-t, this isn’t my meeting, is it?” or “Are you all gonna be in here much longer?” But there comes a point when real work must get done. Google’s so-called “G Suite” has solved many of our problems in this department. Each conference room is a “resource” in the Google Calendar, which can be reserved and scheduled so we’re not double-booking our meetings anymore. However, we have quite a few meeting rooms in the building, and it can be easy to forget (or assume) where your meeting is scheduled until you find you’ve just been introduced to a vendor who is not in the meeting you thought you were in.

Generally speaking, meeting organizers are very good at using Google Calendar to schedule their events. The breakdown occurs in meatspace when attendants are faced with two adjacent meeting rooms and no memory of which starship-themed name was on the calendar invite. Sure, they could check their phones, but when you’re late for a meeting and your chances are 50/50, you’re barging in! This is a minor inconvenience when it happens once…but after it happens a few times, people start grumbling. I personally don’t mind a little derailment every now and again during meetings. What I do mind, however, is grumbling. So I set off to find a solution…to the grumbling, mostly.

A Signage Solution



Product photo showing the Raspberry Pi connected to a 7" touchscreen display

My best idea (short of forcing everyone to add every meeting room to their calendars) was to create some sort of automated signage for every conference room. Now, there are plenty of pre-existing solutions for conference room and convention center signage, but most of them seem to depend on running a sign server somewhere to control them all. While that’s not a big deal at all, it’s also not necessary because we already have a server that’s holding all of our event information for us, and we don’t have to administer it! Ideally, each sign could query Google Calendar independently so that adding more signs to the system would be as easy as just adding a new resource to the calendar — no server need ever be aware of the sign’s existence.

So obviously I’m going to need some kind of small, network-capable compu—rrrrrraspberry pi. I mean, let’s cut to the chase — it’s gonna be a Raspberry Pi; everything is a Raspberry Pi now. In this case, though, I’m not just bandwagoning. The Raspberry Pi is a particularly appealing platform for this project because of the well-supported 7" touchscreen display that’s available for it. The Pi and the screen together make a really tidy stack that will do everything I need from a small digital sign.

Designing an Application



the electron-js logo, comprised of a stylized atomic model depicting electrons circling a nucleus

Electron Logo

From the outset, I knew I was going to write the application in Electron. If you’re not familiar with Electron, it’s a cross-platform development framework that allows you to basically write web apps with access to back-end modules through NodeJS, or, if it’s easier to think the other way: It allows you to write GUIs for NodeJS applications using HTML and CSS. It basically connects Node to a dedicated browser window running the Chrome V8 JavaScript engine. Electron is very similar to NWJS, which I wrote about in an earlier blog post. In fact, I should thank user David C. Dean for mentioning Electron in the comments section. That eventually led to me using it in developing the GeoFence application.

In the time since David introduced me to Electron, someone had solved the problem of missing ARM Linux binaries. In fact, someone else had already wanted to use Electron for their digital signage, and they wanted it badly enough that they rolled a Linux distro around it: BenjaOS. Benja is an Arch Linux distribution targeting single-board computers that’s pre-configured to launch an Electron app on boot. This is a job it does very well, once you’ve figured out the quirks in their flavor of Electron application.

screenshot depicting the contents of the app folder. There are only 10 files displayed.

I won’t go over the process of developing the application logic and GUI, but I will take you through the final code because it’s really not that verbose! In the app directory, there are quite a few files, but that’s really just for modularity, and there’s not a lot of code between them. When Benja boots, it runs an index.js file, which in turn launches our browser window and loads up the index.html file. The html file, of course, contains the markup that describes the layout of the GUI. It also pulls in the stylesheet, a few libraries and finally the config.js and auth-cal.js files.

Most of the work takes place in the auth-cal.js script. The largest chunk of the script has to do with authenticating ourselves to Google. In order to access the resources for SparkFun’s Google Calendar, the application needs to authenticate as a user who belongs to the SparkFun group. I filed a bug with IT to set up an account specifically for the signs, and they were happy to oblige! I used this account to generate Calendar API credentials through the Google API Console. The auth-cal script uses these credentials to request API access, which gets me part way to where I want to be. Then it uses the API access to ask for user authentication, which gets me access to the SparkFun calendars. The first time this script runs on a new computer, it requires me to log in on behalf of the signage account for authentication, but it stores the access token after that.

screenshot of the Google API console, illustrating the ease of use

Once the authentication is done, the auth-cal script handles the sign logic. It makes Calendar API requests to constantly update the agenda and display it on screen. It also takes advantage of the (beautiful) momentjs library to keep time and calculate the time between events. Finally, it pokes the DOM to flip back and forth between two different UIs: One with the whole day’s agenda and one that gives you the current event (or time until the next event).

The stylesheet is written to present the GUI in portrait orientation, since the main function of the UI is to present long lists. Instead of trying to rotate the framebuffer in Arch Linux, I decided to use the “-webkit-transform” function to rotate the entire page object in the browser. This worked out fine once I compensated for the weird position offset that it produced.

If you want to dig into the code for yourself, you can check it out at the GitHub repo.

…And Benja was his Name-o…

The Benja-OS logo, a sort of rugged stylized letter A intersecting a riff on the Electron logo

The BenjaOS Logo

Installing BenjaOS and getting my application to run was a little confusing because the documentation is pretty sparse. Luckily, the example application is fairly well-commented, so it was easy enough to learn by example. First, the installation is as simple as downloading the appropriate disk image from Benja.io and writing it to an SD card. Throw the SD card into your Pi, and you’re ready to boot up! The default application shows the device’s IP address, which makes it easy to SSH into the device (user/pass: benja/benja) as well transfer files over SCP. Notepad++ also has a pretty handy plug-in (NppFTP) for working on projects over a network connection. If you’re not into SSH, you can always pop that SD card back into your computer, and the app folder will be represented as its own drive (“BENJA APP”), which you can edit locally.

The thing that I burned a lot of time figuring out is that you don’t want to just drop your standard Electron app into that folder. Benja has a special package.json and index.js file that differ in their approach from the package.json and main.js file you might find in other Electron apps. You’ll want to keep those instead of trying to use your main.js file. The rest of your project should work as usual, however if you have any node dependencies, you may need to install them with npm. Simply SSH into the RPi and run npm install -g to install your package globally. If your application isn’t working but you can’t tell why, you can launch a developer console in the browser window by pressing ctrl+shift+I, just as you would expect…well, eventually. It may take a few stabs at the keyboard before it listens to you.

It Works!



screenshot of the application showing the meeting room name at top followed by the agenda (partially redacted) and the current date and time at the bottomscreenshot of the application showing the meeting room name at top followed by the message "This conference room is free for the rest of the day" and the current date and time at the bottom

These two views flip back and forth every 15 seconds.

In the end, I’m pretty happy with how this project worked out, but I guess time will tell how well it solves our meeting-time troubles. I’ll keep you updated because I’m still waiting on enclosures and wire covers to install these signs by their respective rooms.

I know some folks are intimidated or bored by application programming, especially in web language, but it’s time makers embrace these languages and skills because IoT appears to be coming, whether we like it or not. Add to that the fact that every few weeks seems to bring fresh new Linux SBC, and it’s likely that we’re all going to be doing a lot more programming in the “web back-end” realm, either via Node or Python or…well, you get the idea. So what do you think? Give web a chance?

Happy Hacking!

comments | comment feed