Monthly Archives: August 2020

Sir, yes, SerLCD

via SparkFun: Commerce Blog

Welcome, welcome, welcome! This week we have three products to show off and they are all new versions of our popular serial LCDs. SerLCD was introduced a few years ago to provide an AVR-based liquid crystal display that didn't require a control backpack. Now, we offer two 16x2 displays and one 20x4 display, all controllable with Qwiic!

Don't forget that you can get a free SparkFun Qwiic Pro Micro BoogieBoard with any purchase of $75 or more using promo code "BOOGIEBOARD20" (some restrictions apply). Supplies are running short so get yours before we run out!

Now onto our new products!

Serial enabled LCDs have never been easier to use!

SparkFun 16x2 SerLCD - RGB Backlight (Qwiic)

SparkFun 16x2 SerLCD - RGB Backlight (Qwiic)

LCD-16396
$19.95
SparkFun 16x2 SerLCD - RGB Text (Qwiic)

SparkFun 16x2 SerLCD - RGB Text (Qwiic)

LCD-16397
$19.95

The SparkFun SerLCD is an AVR-based, serial enabled LCD that provides a simple and cost effective solution for adding a 16x2 Black on RGB or RGB Text on Black Liquid Crystal Display into your project. The PCB design on the back of the screen includes an ATmega328P that handles all of the screen control, meaning a backpack is no longer needed! This display can communicate three different ways: serial, I2C and SPI. These versions come equipped with a Qwiic connector, bringing serial LCDs into the Qwiic ecosystem. This simplifies the number of wires needed and allows your project to display all kinds of text and numbers.


SparkFun 20x4 SerLCD - RGB Backlight (Qwiic)

SparkFun 20x4 SerLCD - RGB Backlight (Qwiic)

LCD-16398
$24.95

If you need something a little bigger than a 16x2 display, you're in luck! This 20x4 Black on RGB Liquid Crystal Display can be added to a project just as easily as the screens above and possesses all of the same features as well - the only difference is its size.


That's it for this week! 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!

Never miss a new product!

comments | comment feed

The Last Enginursday

via SparkFun: Commerce Blog

Almost every Thursday for the past seven years, a SparkFun engineer has written about a project they were working on, or one that they thought up in between designs – affectionately referred to as Enginursday. These Thursday engineering posts have given us such hits as a controlling a table pong robot, learning how to use a 555 timer, making a pumpkin seed-spitting Jack-O'-Lantern, and over 300 more!

For a blog post that started to mainly fill the day before Friday Product Posts, Enginursdays have grown to be one of our favorite releases each week. However, with SparkFun's engineers busier than ever working on exciting new products (like the Qwiic ecosystem, or the OpenLog Artemis), something had to give. So today, we are going to take a look back at seven of our favorite posts (mobile users: make sure you are connected to WiFi, this trip down memory lane includes a few large images)!


60 USB Chargers in Parallel

Sometimes engineers need to take a break from crunching numbers and furrowing their brows at data sheets, and do something fun instead. In May 2017, we wanted to find out what would happen if we took 60 5V, 2A power supplies and wired them together. It can put out 120 amps at 5 volts! Will it melt a wire? What about a spoon? Can it melt a quarter? Or will the whole thing catch on fire? The only question remaining is what to do with them next.


Pumpkin Seed-Spitting Jack-O'-Lantern

Around Halloween 2017, we thought it would be fun to create a motion activated, pumpkin seed-spitting, Jack-O'-Lantern. Listen, we still think that it is a delightfully disgusting Halloween treat for adults and kids alike. Best yet, that time of year is coming around again so we might just make a second one for kicks.


EnLightningment

Burning Man has been a staple summer experience for several SparkFun employees and alumni. We've constructed multiple festival projects and installations over the years. It was only natural to create a lit up EL wire entryway dubbed "EnLightenment" to a local festival around the same time.


SparkFun Pong

For decades, Tabletop Pong has been played the same way: two teams stand on opposite ends of a table and take turns throwing ping pong balls into cups on the other side. The game is so popular, there are even arcade machines that let you play on your own to your heart's content ... or until you run out of quarters. In September 2016, we decided to SparkFun-ify the game by making it motorized AND remote controlled!


Qwiic Escape Room

Escape Rooms have been an obsession of ours, and in recent years there has been a proliferation of microcontrollers and electronics used in these puzzles, leading to many, “How did they do that?!” moments. In March 2019, there was a desire to start making puzzles of our own, and Qwiic boards made it fast and easy to put a couple together.


Digital Handpan

In November 2016, we transformed a steel handpan into a digital version! It turns out that a digital version of a musical instrument usually requires a lot of computational power for it to sound decent and real. Luckily for us, there is a little thing called Teensy available!


Three Childhood Mysteries Electrical Engineering Solved for Me

There are a lot of hows and whys when you are a child, but as you age you start learning the answers to a lot of your questions. Sometimes it takes 10 years and a college degree to answer some of them! In September 2013, we solved three childhood mysteries with electrical engineering.


If you ever wanted to go back to re-read some of the older Enginursdays, don't worry, they aren't going anywhere. You be able to easily find them searching or clicking on the "Enginursday" tag at the top of each post.

We have a so many more engineering projects and ideas coming as Rob and Avra continue to implement new ways to approach SparkFun products, interesting events and captivating concepts. You'll also see more posts pop up from SparkFun engineers, as well as members of the community (maybe one from you)! If you want to write a guest post for SparkFun, please comment below, send us an email, or give us a call. I would personally love to talk with you. We'll see you next time with our next exciting project!

comments | comment feed

OpenBot leverages smartphones as brains for low-cost robots

via Arduino Blog

High-end robotic systems are still out of price range of most individuals, and even many research labs. Smartphones, however, with an astonishing array of computing power, sensors, and networking capabilities, are commonplace and becoming more powerful every day. To leverage these abilities, Intel researchers Matthias Müller and Vladlen Koltun have come up with OpenBot, which uses an Android smartphone as the brains, and otherwise costs about $50 to construct.

The OpenBot software stack consists of a custom Android app, along with code for an Arduino Nano that connects to the phone over USB serial. The mobile device takes care of higher level processing, while the Nano handles lower level tasks, such as motor control.

So far the OpenBot design has been able to follow a human and navigate autonomously. As experimentation, plus phone technology progresses, it could potentially do even more in the future!

This work aims to address two key challenges in robotics: accessibility and scalability. Smartphones are ubiquitous and are becoming more powerful by the year. We have developed a combination of hardware and software that turns smartphones into robots. The resulting robots are inexpensive but capable. Our experiments have shown that a $50 robot body powered by a smartphone is capable of person following and real-time autonomous navigation. We hope that the presented work will open new opportunities for education and large-scale learning via thousands of low-cost robots deployed around the world.

Smartphones point to many possibilities for robotics that we have not yet exploited. For example, smartphones also provide a microphone, speaker, and screen, which are not commonly found on existing navigation robots. These may enable research and applications at the confluence of human-robot interaction and natural language processing. We also expect the basic ideas presented in this work to extend to other forms of robot embodiment, such as manipulators, aerial vehicles, and watercraft.

Drifting Downhill with the SparkFun OpenLog Artemis

via SparkFun: Commerce Blog

There are an infinite number of questions to be asked about the world around us. Why is my mail so banged up when it's delivered? Where did the banging around occur, and how large was the force? What is the ambient light when lightning bugs decide to come out and flicker? How do wind and/or speed determine when a moving vehicle will tip on a banked corner? How much does doing 360s on a drift trike slow you down on your ride, and what is the optimal speed at which to enter a 360?

We decided to tackle that last question, and using the new SparkFun OpenLog Artemis (“OLA”), gather data quickly about how the change in acceleration affects Cassy’s drift triking. The OLA was the ideal module to use for this project because it was so simple to configure and ultimately read data from.

All we did was load in a blank FAT32 micro SD card, hook it up to a power source, ensure the IMU was enabled, and send it speeding down a hill with Cassy. The data is written to a CSV file on the SD card as well as formatted correctly with column headers, so you won’t have to do anything to read the data… not even write one line of code!

SparkFun OpenLog Artemis

SparkFun OpenLog Artemis

DEV-16832
$49.95

If you do want to dive into the analytics of the data, the fact that it is already organized in a CSV makes it easy to play around with in any code editor/language. We specifically used Jupyter Notebook and Python and its associative libraries to visualize how speed changes when doing 360s on a trike.

The SparkFun OpenLog Artemis is the ultimate plug and play partner; it enables you to be an everyday scientist and ask questions about the world around you, and allows you to have fast feedback through its datalogging and sensing capabilities.

What questions will you start answering with it in your pocket? Let us know, and be sure to check out the project video below, as well as Rob's product video that goes over all the specs. Happy drifting and hacking!

comments | comment feed

MIDI-controlled slide whistle made with an Arduino Due

via Arduino Blog

Slide whistles and recorders can be great for learning music, and perhaps a bit of fun, but what about teaching a robot to play such a wind instrument? The Mixed Signal’s MIDI-controlled system could be used for just that.

The project is comprised of a 3D-printed fipple and piston that go into a PVC tube, while air input is via a centrifugal blower fan. A plunger with a rack-and-pinion gear are used to move the piston back and forth, changing the note being played.

A keyboard provides the user interface here, though any number of digital audio workstation devices should be able to duplicate this human task if needed. It’s hooked up to an Arduino Due with a CNC shield, which controls the single stepper motor.

You can find more details on the fipple flute on Hackster and Hackaday, and see a demo of it in action below.

Developing Web Applications on a Raspberry Pi with Flask

via SparkFun: Commerce Blog

So, you've got yourself a Raspberry Pi, and now you want to connect it to the internet to display all the data you’ve collected. Exciting stuff! But how in the heck do you actually do that?

There are a few popular methods to create web servers and web applications using your small single-board computer, and today we're going to cover one of the most commonly used - Flask!

First, let's cover what a web framework is. A web application framework is a collection of libraries and modules that enable web application developers to write applications without worrying about low-level details such as protocol and thread management.

Each framework has a different way in which it builds routes, models, views, database interactions, and the overall application configuration. All of this comes down to a compact set of API endpoints that each back end must implement, along with the allowed HTTP methods:

  • GET: retrieves data
  • POST: sends HTML from data to server
  • HEAD: same as GET method, but just returns the HTTP headers, and no response body
  • PUT: replaces the resource at the current URL with the resource contained within the request
  • DELETE: deletes the specified resource

Flask is one of the most popular Python web application frameworks, because it's easy to get started with and is incredibly readable.

It's built on Jinja2, a Python template engine that renders dynamic web pages. This is what ultimately allows you to pass Python variables into Flask's HTML templates. It's also built on Werkzeug, which implements a Web Server Gateway Interface (WSGI) server to run Python code to create a web application.

Starting your first application in Flask is just a few lines of code. Make sure to check that you have Python 3 downloaded on your Pi. We will specifically use pip to install Flask, like this: sudo pip3 install flask

Here's the web app:

from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    return 'Hello SparkFun World!'

if __name__ == '__main__':
    app.run() `

However, just because Flask is a microframework doesn't mean the whole app exists inside an Python file. You'll ultimately have many other files, including HTML and CSS to design your webpage how you'd like. One of the best parts of Flask is that it allows you to create templates so your HTML stays consistent throughout your entire website.

First, make a directory within your app (mkdir app/templates) to create your template. Mine will be called index.html, and will display the air quality at different coordinates (thanks to my pHAT and Qwiic Environmental Sensors!).

<html>
    <head>
        <title>{{ title }}</title>
    </head>
    <body>
        <h1> GPS Coordinates: {{ coordinates }} </h1>
        <h1> Air Quality Index: {{ AQI }} </h1>
    </body>
</html>

The {{ and }} symbols show Python variables on a webpage. They are just placeholders for variables.

Now, to use our template we have to render it, and Flask has a module that can do that: from flask import render_template. We'll also change a bit of the code in our initial web app to allow for this new index file to be read.

app.route('/')
@app.route('/index')
def index():
    coordinates_Boulder = '40.0150° N, 105.2705° W'
    AQI_Boulder = '126'
    return render_template('index.html', title='Air Quality in Colorado', coordinates = coordinates_Boulder, AQI = AQI_Boulder)

Instead of having a static website, it'd be nice to continuously monitor the air quality, right?

import RPi.GPIO as GPIO
from flask import Flask, render_template
app = Flask(__name__)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
sen = 16
senStats = GPIO.LOW

# Set button and PIR sensor pins as an input
GPIO.setup(sen, GPIO.IN)

@app.route("/")
def index():
    # Read Sensors Status
    senStats = GPIO.input(sen)
    templateData = {
        'title' : 'Air Quality Index',
        'Air Quality Sensor'  : senStats
    }
return render_template('index.html', **templateData)
if __name__ == "__main__":
app.run(host='0.0.0.0', port=80, debug=True)

Flask allows us to read in data through Python and display it on our webpage.

The opportunities are endless with this. You can connect with SQLAlchemy to enable a database abstraction layer, customize your webpage with CSS, or ultimately push it to the cloud over Google Cloud, Heroku or AWS. Let us know what kind of web dev you want to see more of, whether it's design and user experience, cloud technologies, or database integration!

comments | comment feed