Author Archives: Lori Crotser

Get your Kiddos Programming with Minecraft, Python and the Raspberry Pi

via SparkFun: Commerce Blog

Ever heard of Minecraft? It is ALL the rage with the youth of today. My boys discovered the game while playing with a Raspberry Pi about three years ago and they were hooked. Who would've thought with all the advances in graphics displays, it would be the 8-bit-ish block building game that would capture my children's imagination so completely?

Knowing our love of the game, the talented and lovely Angela Sheehan gave me a book titled Learn to Program with Minecraft. I gave it to my boys, fully expecting to see it sitting dusty on a shelf. I was SO wrong.

They read it in the bathroom. They read it LONG after their "lights out" bedtime. A month or so ago, they woke me up at 5 a.m. hurling Python commands at each other. I hadn't paid much attention until the 5 a.m. wakeup call, but this gave me pause: my nine-year-old children are coding. Even better, they taught themselves and they're having a blast doing it. Wanna get your kiddos into programming? This is the way to do it.

image of minecraft book and screen and keyboard next to it

My current setup includes the TouchScreen, SmartPi Touch Case, and the Wireless Keyboard. Look how fancy!

The Raspberry Pi is almost plug-and-play. If you have an old monitor, keyboard and mouse lying around, you can get the Noobs card and it will walk you through the steps of getting your Pi's operating system set up. Minecraft comes with Raspbian, which is the operating system you'll install. We have some great tutorials on getting set up with the Raspberry Pi - check out the How to Use Remote Desktop on the Raspberry Pi with VNC tutorial and/or the Headless Raspberry Pi Setup.

The "Learn to Program with Minecraft" book also has step-by-step instructions for getting your Windows/Mac/Raspberry Pi set up. The first couple chapters of this book get you up to speed and coding almost right away. One of the first things you do in this game is create a house, especially if you're playing in Survival Mode (the Pi version is Creative Mode) - because once night falls in Minecraft, the creepers come out and they can GET you. Chapter one gets you set up to play, and chapter two teaches you syntax, variables, and helps you create a quick structure with a script. Check it out...

image of basic house

Click the image for a closer view

It doesn't look like much, but it is the basis for a whole world of opportunity. Go a little further with that basic script and you've got a CASTLE. With moats! And turrets! Check out Matt Hawkins' post here that provides a script to build yourself a castle.

Image of Castle

Click the image for a closer view

Here's a bit of the Python code that built this castle. It looks intense, but most of this type of thing is covered in the book. Also - LOTS of comments. So great.

A bit of the python code to build a castle

I love the reference material, as well as the way coding is explained - straightforward, colorful and fun. Aside from a few "how do you say this" and "what does this mean" questions, the kids were able to follow along no problem.

Block ID cheat appendix

while-else statements and a game

This is just the tip of the iceberg. As my kiddos like to tell me, what you can build in Minecraft is really only limited by your imagination and the amount of time your parents allow you to play. I like that they are being creative AND learning to code at the same time. Win-win.

Do you have a Pi? How do you get your littles coding? Let us know!

comments | comment feed

3D Printed Harry Potter Talking Head

via SparkFun: Commerce Blog

Have you looked at our new product carousel lately? We have so much going on, it would be easy to miss all the LulzBot loveliness that we just added. We here at SparkFun lurrrrrv our 3D printers AND we get to test out all the new fangled filaments and printers before we ship them off to you.

It was recently made clear to me that I needed a new car. My kids initially asked me if I could get the double-decker purple Knight Bus like the one in Harry Potter and the Prisoner of Azkaban. But... no. Then they asked if we could at least get the talking shrunken head that drives around with Ernie and Stan in the Knight Bus.

And so, project time! If you've seen my posts in the past, you know that my house is ALL the Harry Potter things. My children are obsessed and thanks to SparkFun, I get to beta test the new LulzBot filaments and printers, AND I get to be "best Mom evarrrrrrr" when I do projects like this.

So I set off to test some of the new LulzBot filaments we carry.

image of LulzBot filaments and 3D heads

The first and third are new filaments that we now carry (nGen and Chromastrand). The second and fourth I just happened to already have in my arsenal. For this project, I ended up using the farthest one on the right - the print turned out the best and the internal supports were the easiest to remove. We tried to paint him up to match the little dude in the movie, but as it turns out, rotting flesh is a really hard color scheme to match. Nonetheless, VOILA!

Dre Head Photo 1

How to make him talk when we drive? I Qwiic-lined the SamD51 Thing Plus, the Qwiic MMA8452Q Triple Axis Accelerometer and the SparkFun Qwiic MP3 Trigger, and popped on our 0.5 Watt Speaker. It's run off an 850mAh LiPo that's been split with a SPST button so that I have an on/off switch.

Dre Head with Boards

The 3D model is from Thingiverse - I printed it on our LulzBot Taz 6 with ABS filament in high detail with minimal supports. It took me a while to clear those supports out to my satisfaction, but when I was done, I had a nice empty shrunken head to shove electronics into. I also drilled a few holes to mount the accelerometer, since that part needed to be calibrated. The rest is arts and crafts.

Accelerometer mounted inside the head

I used the MMA8452Q Hookup Guide examples to get started. Calibration took a little sorting out - I found that with the way I mounted the accelerometer in the head, I really only had to deal with two axes instead of three, which was nice. When the accelerometer detected coordinates within a specific range, we'd kick over to the MP3 trigger code and call playFile(fileNumber). All the MP3s are based on the movie - except when we stop too fast he yells, "I hope you step on a Lego!" So fun.

Always with the magic at our house. What magic have you created? Have you used SparkFun parts in projects with your kiddos? Let us know in the comments!

comments | comment feed

Sparking the Fun

via SparkFun: Commerce Blog

A year or so ago, we had a couple of guys from LEGO visit SparkFun. I'll admit, I fangirled a bit. Okay, maybe a lot. I have always loved LEGOs; I've always loved pulling things apart and rebuilding them to see how they work. LEGOs have that "new" factor - the fun of the build, the satisfaction when it's done - and the "Ooo - how can we hack this" is the cherry on top. Plus, the latest kits are SO COOL. My birthday is coming up, if anyone wants to buy me either that Hogwarts Castle or Great Hall kit... just sayin'.

I recently posted my hack of Wall-E - adding a serial controlled motor driver and our gamer:bit with a couple of micro:bits to drive him around. I struggled to find adapters that would fit between my hobby motors and my LEGO axles. I even tried 3D printing them but couldn't get the precision I wanted. Eventually, I had to go third-party to find the adapters I needed, and I complained bitterly to management about this.

What did SparkFun do? They went out and sourced a bunch of adapter samples and handed me a bunch of other cool stuff to play with. For real - check this out:

Photo of Kits

So now I am sitting at my desk, in the process of stress-testing LEGO adapters with a really goofy grin on my face. I'm also building a monster truck to test out some robotics wheels we've got coming up in a few weeks (they drive sideways)!

photo of adapters

I bring this up to point out that a) SparkFun is awesome (you all knew that), and b) we have some really neat things coming up in our catalog. If you've missed some of our recent changes, check out our Artemis SparkX line, which includes an RF module, voice recognition, BLE and a bunch of other functionality packed into a 10x15mm board.

We've incorporated the Artemis board into a number of familiar Arduino footprints (have a look at the BlackBoard, Nano or ATP), but it's also available on its own so you can incorporate it into your own project. We're also constantly expanding our Qwiic line, which are essentially plug-and-play sensors and boards that make project automation a breeze. We've got a bunch of other neat things in the works (hopefully even more LEGO and robotics fun) - and if I can swing it, you should see those LEGO axle adapters on our new product carousel.

I know I'm not the only LEGO nerd out there - tell us about your projects, your hacks and what you could use for your projects!

comments | comment feed

Open Discussion: Puttin’ on the Fritz

via SparkFun: Commerce Blog

Show of hands - anyone use Fritzing? I do, and I have a feeling I'm about to open a can of worms. The discussion must be had, however, so let's dive in, shall we? If you aren't familiar with Fritzing, swing on by Fritzing.org and have a poke-see around. There's plenty of functionality - you can layout, prototype, teach and manufacture custom PCBs as well.

Like most applications, Fritzing has definitive pros and cons. At SparkFun, we use Fritzing diagrams in our SIK kits, tutorials, hookup guides and workshops - it's a great tool to show quickly and cleanly how we have hooked something up. Let's look at an example from the SparkFun Inventor's Kit:


Circuit 2B: Digital Trumpet Fritzing Diagram from Circuit 2B: Digital Trumpet

Easier, right? Basically, we use Fritzing as a "gateway drug" to get beginners and hobbyists involved in electronics. That said, it can be extremely non-intuitive to work with. For us, creation of new parts requires a fair amount of manual massage, and it's not easy to deliver our parts to the public at large.

While Fritzing is open source, not much has happened with application development in recent years. In the last couple months there has been discussion about reviving development on the Fritzing application, but I haven't been able to ascertain a clear direction for said development. If you have a bit, the video is worth a watch. Patrick Franken does a good job of acknowledging the benefits/scope of limitations, as well as discussing the current and future development (or lack thereof). On the upshot, it IS open source, so we can all contribute. If you want to have a look at or add to the development discussion, head on over to the Fritzing GitHub.

Since our use-case here at SparkFun is fairly specific, our view of Fritzing is naturally going to be somewhat myopic. We are always striving for better ways to get people involved and excited about electronics, and my goal in opening up this discussion is to find out what is most helpful to the community at large.

So now the real questions begin. How do you use Fritzing? Are there alternatives you find helpful when teaching others how to hook up their projects? What do you find most helpful about Fritzing, vs. what you would like to see changed in how we present hookup designs?

Constructive comments here are great (no flame wars please) and if you'd like to be further involved in the discussion, feel free to head on over to our newly revamped forums.

comments | comment feed

Expecto Patronum!

via SparkFun: Commerce Blog

Anyone with littles knows that nightmares are a thing. And when littles don’t sleep, parents don’t sleep. I like my sleep. Therefore, in keeping with the Harry Potter theme we have going, I made nightlights that will protect and hopefully allow everyone to sleep through the night. Muggles, read no further. Everyone else…

Expecto Patronum!

Songbird Patronus

If you don’t know what a patronus is, go read Harry Potter. Seriously. But to make a long story short, a patronus is a protective guardian (usually an animal) that is conjured to repel depression, sadness and soul-sucking misery. And hopefully nightmares. When I asked my littles what they thought their patronuses were, I got a songbird and an eagle. I can work with that!

My first step was to raster an image onto acrylic that would light up and look like a patronus. My initial attempts failed miserably. We have an Epilog 75W laser and Adobe Illustrator and after multiple iterations, I found that raster quality really begins with image quality. After some fun Gimp editing, I retried my rastering with Floyd Steinberg dithering, 600 dpi, 100 percent speed and 40 percent power.

Voila:

Rastered Songbird Patronus and the Patronus Mist

Our rastered songbird patronus and the patronus mist

The next step was to play with LEDs. I had a 5V ProMini laying around, with an FTDI breakout and a strand of high-density LEDs sitting in a drawer. Let’s use up those supplies, eh?

I wanted the “mist” background to fade in and out, so I set up groups of pins in different structs and assigned those pins to various colors using HSV with the FastLED library. Then it was just a matter of setting up the groups to fade in and out at different rates, times and within specific brightness parameters. I soldered a junction to the LED strip and set the next set of LEDs for the patronus itself, so the bird would have a higher brightness range.

Static image of bird and patronus mist lit up in blues

The box was designed using MakerCase, and I added slots for the acrylic panels as well as cutouts for the power cable and the On/Off switch. Since I wanted the LEDs to sit right underneath the acrylic panels, I also designed an interior box for them to sit on (the adhesive tape on the back of the LED strips is awesome).

Assembled:

Assembled Hardware

All in all, a fun, quick little project. I have yet to try this out in its natural habitat - stay tuned to find out if this actually helps the kiddos sleep through the night. When I have more time, I’d like to pull the Mini and use an ESP32Thing instead. I’d like to integrate this with my previous post and make the Harry Potter room run entirely off “magic.”

Have you done any fun kiddo projects? Show us in the comments (bonus points for anything Harry Potter-themed)!

comments | comment feed

Making Magic with EasyVR

via SparkFun: Commerce Blog

Magic has taken over my house. We have been reading the Harry Potter series, watching the movies, and my children have been repeatedly banished to their bedrooms for dueling with inappropriate curses.

Enter the holiday season and Enginursday. I wanted a quick project I could build for my kiddos and make it seem like the magic is actually happening. Since we needed new bedside lamps for reading, I decided we needed them to turn on and off with wands.

While I foresee potential issues with giving them wands, my children definitely need a better way to battle (instead of using rulers, pencils, knives, or heirloom candlesticks) and really, I just want a reason to yell “You’ll shoot your eye out!”. Ahhh, holiday spirit.

Back to business. We have a lovely little shield in our catalog called the Easy VR3 which is a voice recognition module that has a fair number of built-in commands as well as the ability to program your own. It does require some assembly, but once you get through all the soldering, you can pop that sucker on an Arduino Uno and start coding.

The EasyVR3 has quite a bit of functionality, so the documentation is… comprehensive. I actually read through the manual, hunted down a few YouTube videos, and then re-read the manual. To make a rather long story short, I used EasyVR Commander to program in the sounds and commands I wanted, used a handy dandy button in EasyVR Commander to create an Arduino sketch (SO EASY), modified the Arduino sketch to do what I wanted when certain commands were uttered, and then uploaded the code to my Uno. Voila prototype:

single LED turning on, turning off

Okay, so one LED isn’t all that exciting. I need to attach this to a bedside lamp and make it work with the magic commands! In our catalog, we also have the IoT Power Relay, which is a great way to control 120V outlets from microcontrollers without zapping yourself into oblivion.

So all assembled:

Assembled IoT Relay with VR Shield and lit up wand

And it works!

Now for the wands… I seriously considered just using driftwood or sticks for the wands, but to quote my kids' favorite TV show, “Anything worth doing is worth over-doing” (I’m looking at you Steve Spangler). So I 3D printed the wands.

I found a sturdy design on Thingiverse and printed one up, but then decided they needed to be super extra. I modified the design on TinkerCad (yay free CAD) to have more space internally and added an LED, an accelerometer, and a small LiPo battery.

3D printed wand with super bright LED at tip

Every time the boys pick up their wands (from their also 3D printed wand stands) the light at the tip of the wand comes on and with a “Magic! Lumos!” their reading lamps come on as well. Yay magic!

I fully expect there will be multiple iterations of “magic” happening in our house but I’m pretty happy with the prototype. There have been great strides in voice recognition software since the Easy VR Shield and I’d love to dig into the Alexa or Google Home APIs. I’d also love to play with edge lighting (as Feldi does here) and have the design be a patronus. The kiddos have even more ideas - so many fun options!

Are there any other Harry Potter fans out there? Have you created projects with SparkFun parts? We’d love to hear about them in the comments!

comments | comment feed