Chances are you’ve heard of the most-backed game in Kickstarter history. If not, stop here, and go check out Exploding Kittens for a minute and then come back. After months of anticipation my copy of the game showed up last week.
Spoiler Alert: I’m about to reveal what the surprise is inside the Exploding Kittens box. If you don’t want that ruined stop here and come back after you’ve personally experienced it.Read More
The holiday season is fast approaching and you’re facing the daunting task of shopping for that Internet of Things Someone in your life. Well don’t fret because we are actually really easy to shop for. If it blinks, plugs into a computer, or just screams nerd we’ll probably love it. But just in case you need a few extra ideas here are some stocking stuffers that are always appreciated.Read More
So last week I found a pic on Imgur posted by quantumCity showing a Raspberry Pi case made from a manila folder. Needless to say I found it to be a pretty neat way to throw together a case from something lying around the house that didn’t consist of using Legos. He posted the CAD file and a pdf version so all you have to do is print it, transfer it, cut it, and fold it. It worked like a charm on the first try.Read More
The Internet of Things is all the rage lately. It seems to be all that tech sites want to talk about and therefore what a ton of startups want to work on. I’ve been watching this space closely for the last 5 years and I can’t help but compare hardware, in it’s current iteration, to being just like kitchen gadgets on the Home Shopping Network (link intentionally left off). What do I mean by that? Well, let’s talk about apples for a minute.
In the last week I’ve seen several articles pop up comparing the new Intel Edison to the Raspberry Pi to the Arduino to the [enter some other development platform here]. The problem with every single one of these is that they are missing the boat when it comes to choosing a development platform for your next project.
Specs Don’t Matter…(Mostly)
The easy thing to do when you want to create a new piece of tech content is just compare the specs of the different platforms. This table was part of a recent ReadWrite article.
At a glance you can compare the CPU speed, memory and GPIO count. What it doesn’t show, or even help with, is how to pick one for your next DIY project.
What Really Matters
So what really matters when picking a platform for your next project? Normally it has nothing to do with performance specs because almost any platform will be have plenty of performance to read your sensor and display the results or push it to the web. For me the most important questions aren’t how much flash memory a platform has or what the input voltage is. It’s a balancing act between a few key metrics.
Battery or Plugged In?
What do I mean by that? Well, first and foremost you need to ask yourself “Is my project going to be battery powered or can it always be plugged in?” Right away this is going to limit my choices. While I love the Raspberry Pi and know that it can be battery powered I’m probably not going to choose it because it it such a power hog when compared to something like an Arduino Uno or Sparkcore.
Compute Intensive? How Intense?
After thining about the power constraints, the next thing I ask is what kind of compute power do I need. What I think most newcomers miss is that a massive share of beginner projects don’t need an ARM processor running at 700MHz. But when you compare that to the 16MHz of the Arduino Uno you may think “Well, that’s not going to be powerful enough.” Remember the Apollo missions that flew rockets into outerspace (whether you believe we landed on the moon or not…we did…it’s certain that we did launch things into orbit)? The guidance computers on those spacecraft had approximately 64K, that’s K not M or G, of memory and ran at an astonishingly fast, at the time, 2.048MHz. You can accomplish a LOT with very little in embedded systems.
Sometimes you may have conflicting requirements like a device that needs to be battery powered but outputs 1080p video to a built in monitor. Just remember that there are other factors that, in my opinion, are more important than base specs. After all, if your project only needs 3 I/O pins it doesn’t really matter if your platform has 10, 30, or 50.
I think we’re all still trying to figure out what Yo’s place is in the internet family but as of right now it’s basically a viral app. As soon as I found out there was an API for it I just knew I had to attach some hardware to it. Here’s a demo of what I put together.
The whole thing took me about 4 hours once I resolved my API issue (I originally gave them the wrong URL for the callback and had to email them to fix it). I want to share the process in case other people want to integrate Yo with hardware.
My presentation from the Openwest Conference has posted to YouTube.
Really appreciated the opportunity I had to present and loved meeting some new people. Looking forward to attending next year.
I created a python module that makes interacting with specific hardware easy. You can find it here:
µCasts Raspberry Pi Library
I’ve found myself writing quite a bit of code lately to interface with different pieces of hardware on the Raspberry Pi. I finally realized that for every new project I was copying the same code from the previous project to do things like turn on an LED or read the state of a switch. I decided that it was time to take all of that work and put it into a library that I could easily reuse with each project.
The python and node modules I’ve used to create projects in the past are very simple and generally easy to use. What they don’t provide, and aren’t meant to provide, is a higher level of abstraction around certain pieces of hardware. For example, let’s look at the TMP102 Sensor.
TMP102 image provided by Sparkfun as CC BY-NC-SA 3.0Read More
As part of my Skillshare class Unleash The Raspberry Pi Through Physical Computing I created a cheat sheet that I reference when working on hardware projects involving the Pi.
You may find it useful when working on your own projects so feel free to download and share. Let me know if you think I’m missing something important. I’m working on an HTML version and will update this post when it’s ready.
I’m not sure why I waited so long to do this now that the Olympics are coming to an end. The thought came to me today, “I wonder how long it would take me to hack together a script to track and display medal counts.” Well, I had to find out and below is the result. Disclaimer: I was not going for neat, well-organized code here. I was going for speed so please be gentle.
I cheated a little bit in that I already had the Pi configured and some hardware ready to go from my Skillshare Class (which is now free if you want to check it out) so I figured I’d just use what I already had. The project from the Skillshare class includes an LED, temperature sensor, and other things but all I really needed for this project was the seven segment display from Sparkfun. I was ready to immediately start coding in Python.
The Data Feed
My first step was to find a suitable data source for the medal count. It really came down to two sources and how easily it would be to parse the data. The first was NBC and the second was the official Sochi Olympics site. I liked the official site a little better because the html for the medals had specific css classes that would make extracting the data very straighforward. The problem I ran into though was when I ran my initial version of the script I got a Forbidden response.
I assume this has something to do with the Agent header and them trying to prevent people like me from mooching off their site. Well played sochi.ru, well played. Fortunately for us the good folks at NBC do not have the same concern so that’s where I ended up getting the data. Here is what part of the page looks like and has a url of http://www.nbcolympics.com/medals.
So how do we fetch just the medal counts that we want to display? Well, in Chrome all we have to do is right-click on the text “United States of America” and do Inspect Element to expose the page HTML which looks like this.
This was my first time parsing HTML in Python so there are probably much better ways to do this. If so please tell me about it in the comments so I can learn something new. I chose to use some simple XPATH to locate the anchor element with the country name and then navigate to the neighboring elements with the medal counts in them. The result was this.
page = urllib.urlopen("http://www.nbcolympics.com/medals").read()
Getting the actual integer value of the medal counts was then trivial. Remember, parsing out of the HTML will give you the values in strings.
gold_count = int(goldNode.text_content().strip())
Displaying the Data
With the data in hand it was just a matter of getting it onto the 7 segment display. In my Skillshare class I show how to configure and use SPI on the Pi to display stuff on a simple seven segment display so I already had all of the code for that. I just needed to format the display string appropriately. As my real estate was limited I decided to just use simple strings like “to:23” for the total count, “go:14” for gold, etc. I display each count 3 times and then query NBC again for an updated count. The interval could be much greater I suppose as medals don’t change every 10 seconds.
def display_medal_counts(bus, gold, silver, bronze):
Throwing this together took me a little over an hour, much of which was spent learning how to parse HTML in Python. Here’s a Vine to show it working. Not sure why the ‘G’ doesn’t use the middle hyphen segment.
It’s a great example of how the Raspberry Pi is great for rapid prototyping of an idea. The full code can be found in this gist.
What Olympic-themed hardware projects can you think of?
A while back a good friend of mine gave me a Blue Yeti microphone from work that he said they were going to throw away because the mini USB port had ripped out of it. I told him I’d take it and see if I could fix it. It seemed like the only thing wrong with it was that the connector had literally been ripped out of the case. How they were able to accomplish that I don’t know. So I did what any self-respecting DIYer would do: I called Blue and asked if they could give me the part number for the USB connector.
“I’m sorry, I can’t give you that information. It’s proprietary”
Really? A standard mini USB connector is proprietary? Give me a break Blue. So I did what any self-respecting Twitter user would do.
Having vented my rage on Twitter I logged on to Mouser to find a suitable replacement. I found one that I thought would work but never got around to ordering it. Fast forward almost a year and I decide I want to try to fix it but don’t want to find the part again and wait for it to ship so I figured I might be able to just hack up a USB cable and solder it directly to the PCB where the connector ripped out. Here’s how it looked when I took it apart.
Again, how they managed to do this is beyond me. But it came off fairly clean so all I needed to do was remove the legs from the connector and solder in leads from a USB cable I cut. But which wires go to which holes? Well, if you take a closer look at the back side of the PCB you can get a pretty decent idea of which connections are which. We know that USB uses 4 connections: Supply, Ground, D+, and D-.
From this image we can guess that the thicker traces are the power lines and the thinner ones are the USB data lines. One of the connection holes isn’t connected to anything. So figuring out which power line is ground was easy. Just set the meter to continuity mode, connect one probe to a known ground point (like an internal metal mount) and then see which of the thick traces gives you the continuity beep. That coupled with this diagram I found for a similar USB connector allowed me to identify D+ and D-.
The solder work on this job was a little challenging for me. I quickly gave up on trying to solder the USB cable directly to the connector holes as the tiny wires were hard to handle. Instead I soldered some 22AWG leads from the connector holes that could exit the mic case through the mini USB opening and then I soldered the USB cable wires to those leads. Here are some shots of that.
I made sure all of the USB wires were isolated from each other using shrink wrap and then finished the whole job up with a big piece of shrink wrap over everything to leave a nice clean look. When I plugged it in it worked first time.
With just a little knowledge and some soldering skills there are lots of things that can be reclaimed from the junk pile.
In closing I’d like to thank corporate america for having so much money that they just trash $100 mics because connectors break off. More importantly though I’d like to send a big “Suck It” to Blue for hating on the DIY fix-it community. It’s just a mini USB connector. I didn’t need company secrets to fix it.
P.S. Blue, if you had simply given me the part number I would have sung your praises on social networks and to anybody in the tech space that would listen. I also would have gone to you first as soon as I needed a new mic. Instead I’ll never recommend your microphones to anybody and will personally never pay you a cent for one.
[UPDATE]: After a lot of thought I’ve decided to release the class for free. You can still use the link below but the cost is now $0. I would greatly appreciate any feedback on the course because I want it to be as useful as possible.
My class Unleash The Raspberry Pi Through Physical Computing is now available on Skillshare. The class covers the 3 main hardware capabilities exposed by the GPIO header on the Pi:
- Digital I/O
In addition to covering each of these topics I also show you how to get your Raspberry Pi connected to Twitter. It’s the first class on Skillshare to cover the Raspberry Pi and contains just over 3 hours of video instruction. It’s packed with tips and tricks for creating your own hardware projects and students that enroll get access to a cheat sheet I’ve put together for creating hardware projects with the Raspberry Pi. If you’d like to enroll use the link at the top of this post to get 50% off and get the class for only $12.50 USD.
If you’ve ever tried writing code on your Raspberry Pi from just the plain terminal window then you’ve probably used Nano or Vim. If you’re like me you wished you could have used your favorite IDE or text editor on another machine. When I develop for the Raspberry Pi my normal use case is to SSH in and write code via Nano. While this works just fine I’d prefer to have the bigger real estate afforded by my desktop monitors.
What is preheat
preheat is my solution to this problem. It allows me to pull scripts down from my Dropbox account at execution time. When I finally decided I didn’t want to code directly on the Pi anymore the very first thing that came to my mind was to install Dropbox on the Pi and just have it sync with a folder on my dev machine. It only took a few searches to realize that a Dropbox client for the Pi doesn’t exist. So I found a few other solutions like rsync, ownCloud and others but everything I found was either too much work or just plain overkill for what I needed. So preheat was born.
It’s a simple Python script that will query your Dropbox account for the file you want to run and pull it down. So normally I’d use the following to run a script I’m working on:
sudo python myscript.py
With preheat I would run it like this:
sudo python preheat myscript.py
I don’t need to have myscript.py on the Raspberry Pi. It’s on my desktop machine in a dropbox folder being updated every time I change it. When I run it via preheat it will scan my Dropbox account, find it, and pull it down for me.
If you’d like to see how it works check out the source code on Github
Last week I came across a tweet from Eduard Koller.
Want to be notified when the Government is back up? Here’s a little script for you: http://bit.ly/16eAoDT
He wrote a simple python script to check the status of the government shutdown. I couldn’t resist the urge to apply a little hardware to the situation. Read More
“Read the Datasheet Again!”
That’s what somebody told me on a forum once for not seeing a piece of information in a 90 page datasheet. If there is one thing I’ve learned after many years of doing hobbyist electronics it’s that the various forums are NOT friendly places for beginners. I’m subscribed to receive notices from multiple forums and everyday I see beginners taking heat for “not reading the datasheet” or “not searching the forum.” It always amazes me how condescending people can be and how quickly they forget that at some point we were all beginners.
Friend or Foe, You Choose
I wish people would understand one simple fact. It takes just as long to be a jerk as it does to make a new friend online. Instead of answering somebody’s questions with a condescending tone why not take the same amount of time to encourage and support. Is is so hard to remember that everybody is on a different level as far as experience and knowledge go? A lot of beginners have no idea that the answer is on page 73, paragraph 6 of the datasheet and publicly shaming them does nothing but boost your own shallow ego. I’m not sure why smart technical people who stereotypically faced a lot of bullying growing up turn to preying on people just looking for a little help.
So why the blog post? Well, it really comes down to a simple thought. Can we please just play nice? Can we show some love to the beginners? Next time you see a “stupid noob” question in a forum, step up and help out. Welcome them to the community and please, whatever you do, don’t treat him/her like an illiterate waste of your time because that “idiot” is an actual person on the other side of the interwebs just looking for some help.