Posts Tagged ‘learning’

h1

I love engineering pads

January 4, 2016

After having spilled coffee on one pad and actually finished the two others that generally live on my desk, I went to the pile of office supply paper and dug out an engineering notepad. I found this:

Making Embedded Systems Info Sheet

This is clearly a sketch for an information sheet from the podcast two years ago. So much has changed about the show (even its title) that this is a pretty funny little view into the beginnings of the show.

Of course, I wasn’t digging for an engineering pad purely for nostalgia. I wanted to sketch something out. And since I kept re-doing it until it almost looks good, I figure I should share it.

I wanted to know how the itty-bitty quadcopter’s motors worked. This is for the Cheerson CX-10, a quadcopter that is just a bit bigger than a quarter.

 

h1

Tinkering for dummies

January 24, 2015

I received an email:

I’ve listened to a few podcasts and now am officially a fan. I’m curious about “tinkering” for dummies

I realize that I like to tinker but always run into the reality that my technical skills don’t match up with my creativity.

I am wondering if you would suggest a pathway of least resistance for someone who is interested in tinkering. 

Time is always a constraint but I am serious about learning how to code and also learning about embedded systems but not sure if learning python for example is the best way to start.

This seems like a great question, one I’m sure other people have.

However, I’m a terrible person to answer it because I come at the problem of tinkering from exactly the opposite direction. Since programming is my job, tinkering can be difficult because it feels like work instead of play.

Still, I want to encourage the writer so I’ll try to answer. I invite you to suggest other things in comments.

I think the the very short answer is buy a kit. A kit means you’ll get something that probably works and some instructions. Then you can tweak it to be more along the lines of what you want.

And, in general, I think the path of least resistance is Arduino. Their community and system is set up to teach you things (and to hide the tricky details). It started out as a way for educators and artists to approach technology so they don’t expect you to know a lot of coding. There are many Arduinos (the UNO is my fav) so the next question is what do you want to tinker?

Learning by doing is great but difficult to maintain if you don’t have a direction. Self motivation is much easier if you have a goal, ideally an achievable, amusing, and share-able goal.

Say you want to make a watch or small desk display, start with the MicroView (and programmer). If you want to go all out (or you really have no idea where to start), get the Sparkfun Inventor’s Kit. With the MicroView, you get more tutorials with hardware in the inventor’s kit. Without the MicroView, you still get a wonderful grouping of sensors and lots of tutorials (and an Arduino board).

On the other hand, robots are awesome and seeing something move is deeply satisfying. The Parallax BOEBot (“Board of Education” Bot) is educational (and fun). It was designed for high schoolers so you’ll likely feel brilliant and idiotic in turns (c’mon, you remember being a sophomore, right?). You can get it from Parallax more cheaply but you have to build more of it yourself. (Also, you may need an Arudino UNO for those kits to add smarts to your robot.)

As you start to tinker, decide what you want to do with your limited time. Building from the ground up is an advanced exercise, often leading to frustration. Toddling, baby steps are more fun.

But what if you want light up shoes (or bike helmet)? Lights are an awesome way to get hooked on tinkering,* there are so many beautiful blinking patterns. For that, you probably want to look into the Flora system (oh! they also have a budget pack). It is designed to be wearable which is pretty neat.

Do you have annoyances in your house? Something that would be better if you could assure yourself from work or phone? Maybe knowing that the garage was down, the stove off, or the door locked? For this, I’d suggest Electric Imp (and you’ll need the breakout board as well). It connects to WiFi well and is straightforward to program. It isn’t quite Arduino easy but there are lots of tutorials.**

Finally, do you want to make a big system? Like a balloon that can take pictures and use a GPS and then connect to your home network? While I like BeagleBone Black for engineering use, I’d suggest starting with a Raspberry Pi. These are both little computers, cheap enough that you can blow one up without feeling too guilty. The Pi is designed to be a learning environment and there are many excellent tutorials. The Beagle has an excellent community as well so it may be a toss up between them. And if you’ve already started to learn Python, well, these are the boards for you. They’ll let you use Python, explore Linux, and get some hardware experience without ever worrying you’ll run out of RAM or processing power. If you get a touchscreen (like this one for BBB), these small computer feel like, well, small computers: infinitely flexible.

Which brings me to my next point, once you have a direction, look for  a tutorial for something similar. Even if you aren’t building something exactly the same. For example, if you like the look of MicroView and want to try making a watch, even though Wordy is a ring, my tutorial on building it may give you ideas.  Look at the “Learn” sections on Adafruit and Sparkfun for ideas if you don’t have a project in mind. These companies (as you may have noticed from the above links) sell tinkering hardware. They write tutorials to keep you engaged (so then you buy more hardware). You may also find inspiration from Hackaday and Make. You can document your project on Hackaday.io, I’ve been pleased at the niceness of the community there.

Tinkering from scratch without a guide is a like baking cookies without a recipe. If you are experienced, it is completely possible to start with a blank slate. I know from experience and reading cookbooks that cookies should usually have between 1 part butter, 2 parts sugar, and 3 parts flour to 2-3-4 (b-s-f). I can make almost any cookie I can think up. But as you start out, some guidance to success is hugely important. Otherwise you end up with Strawberry-Mint cookies*** and everyone is very disappointed that the lovely promise turned into, um, that.

My final word on getting started tinkering: don’t feel guilty when you stop for a weekend or two. This is for you, it is your hobby. It might be educational but it isn’t required for life. The less guilt you feel, the more likely you are to come back to it when you get interested again.

*  My first tinkering project involved lightup high heels. The second involved halloween pumpkins lights (blue to purple flickering “candles”).

**  Heehee, I wrote that tutorial so total bias there.

*** Yes, that happened, ok? It was an accident with the mint and vanilla bottles looking similar. Quit laughing. Aw, to heck with it.

 

h1

Debugging

December 17, 2014

A podcast listener requested a show about debugging. I’m still working out just what he meant by that but between that and working on a Trinket, I find I have a few things to ponder aloud for you.

First, the Trinket is a small board with an ATTiny85 on it. It is a very low power, deeply embedded sort of processor. With all of 8k of code space and 512 bytes of RAM (and 512 bytes of EEPROM), this is a dinky little thing. Plus, with the on-board bootloader, there is only about 5000 bytes of code space. I feel like a kid again.

So why in the world would anyone use the Arduino interface with this? Well, it is what I have, it is what Adafruit had in their tutorial, and I’m too unmotivated to set up a GCC cross compiler (yet).

Usually when I use the Arduino compiler, it is with a proper Arduino board (or the MicroView which is a “proper Arduino board” for this discussion). Debugging is done via printf because there is a serial connection via USB after the bootloader has finished programming the board.

Under “Debugging Tools” on my resume, I have “DVM, oscilloscope, logic analyzer, JTAG, ICE, printf” so I’m fine with printf as a way to determine what is going on with my code. On the other hand, if I can have an on-chip stepping debugger, I much prefer that. But that isn’t an option with the Arduino compiler so I limp along. Nothing I do on an Arduino is all that complicated.

All that said, the ATTiny doesn’t have the serial debug interface. There is no on-chip debugger and no printf. That means debug is usually through GPIO lines and prayer.

There are tools that could help me. I think. But I’m trying to do it the way everyone else is. Or the way I think they are. I’m writing little pieces of code and running them. I’m blinking the little onboard LED once for good, three times for an error. It look a stupidly long time for me to figure out why my byte variable wasn’t getting to 256. It isn’t impossible to work like this but it is a lot harder.

So, yeah, maybe it is time to talk about debugging. We could start with Arduino (and mbed) and debug through printf. Then go into the tools available for that space. Then the SWD interface for the ARMs (i.e. Cortex-M0). What are ITMs and ETMs anyway? We could talk about timing errors due to debugging (both serial and on-chip). We could talk about the extras that are available on some IDEs (mmm… profiling and backtraces!). We could talk about GDB, how it is super powerful but opaque and a pain to the beginner. We could even talk a bit about data logging and error handling (other listeners have requested shows about these).  I wonder if we’d even get into unit tests since some systems I’ve developed for run on-target-hardware via debugger.

I feel a lot more secure and confident when I can see what my chip is doing. I don’t mind using printf but I’m better at getting things done with better tools. Most tools are cheap compared to my time.

So yeah, debugging…

h1

Hackaday: Wordy

December 9, 2014

I wanted to make build instructions for Wordy but since it uses both SparkFun and Adafruit parts, I couldn’t decide where. Though I did say I was going to put my next project up on Hackaday. I did that. There is a link to the code there as well as build instructions. Anyone here want to check it out for me? Maybe suggest what I forgot?

Wordy Ring

One thing already on my list is a project log of different ring making methods I tried. I’m going to do another pass with Sculpey, taking pics as I go. I also need a final picture of it all together, I plan to take that when I wear it out tonight.

h1

Giant rings are IN, right?

December 3, 2014

I finished up the working modes of my ring, so rev1 of the software is done. Here’s what it does:

On TAP: shows a vocabulary word. On tap or double tap, shows definition.

On DOUBLE TAP: starts Pong game, paddle position set by tilt of accelerometer.

On UPSIDE DOWN SHAKE: says to consider a question, waits for upside down shake (or punch) to give a response.

On PUNCH: puts up a punch word and a couple rectangles for emphasis.

As long as the wires are secure, this all works pretty well. I still need to format some of the Magic 8 ball style responses. And I could go through the vocabulary words to make shorter (better) definitions. I can probably pick up about 50 words too (yay!). I may continue to get rid of nonsensical floating point stuff so I can put more definitions in. Oh, and I should check the power usage, I didn’t minimize the accelerometer’s draw.

However, those tweaks can all wait as I need to make it wearable again. The button version was wearable but the ring blanks from that are a little too small for the accelerometer+battery stack up.

microView with accelerometer and battery

From another angle

MicroView, accelerometer and battery

 

On the back of the MicroView is a dab of funtac (that stretchy sticky stuff you might have used to hang posters in your dorm room), a modified Adafruit 5V tolerant MMA8451 board (ahem, they didn’t need all that space for logos and mounting holes). Tiny wires are soldered to the board, then hot glued. On the other side, they are soldered to the MicroView.

On top of the accelerometer is a SparkFun 40mAh LiPo battery with its connector snipped. It is held on to the accelerometer with funtac (sometimes I build things entirely from funtac). I needed the battery on the outside so I can remove it for charging. The

This all stacks up higher than I wanted and doesn’t leave much space for attaching the ring to the device. With the button+battery version of the ring, I pressed the MicroView pins into the ring blank and press fit it all together. That doesn’t work so well now, especially as the poorly pressed fit doesn’t hold the power on.

Add connectors

 

I snipped some jumper wire so I could build a connector on the inside of the ring blank. This was just a trial run. It worked out ok but I think I want to do something a little different for the real ones, maybe destroy 8 wires to get 16 connectors. Having attachments only on the pins of interest has some downsides (especially if I don’t line them up properly). More connector ends also lets me add some needed rigidity. Even these few fix the press fit problem. The female connectors are all too bulky though I may look around some more.

Ring on

 

It doesn’t look too bad. Though I think the new black version are going to be better (still waiting for those to dry).

photo 4

Well, let’s see it on!

OnThe 5s timeout on the screen makes it impossible to get an in-focus shot by myself.  Ahh well, you get the idea. This angle is probably the nicest. From the side where you can see the stackup, not so nice. (Realistically, it wouldn’t be hard to cover this.)

head on

But I can’t leave it on that shot, one more, a little prettier.

Sideview