h1

Trip report: Shaping the Future of MEMS and Sensors

September 10, 2013

I went to STM's one day conference on MEMS and sensors. When C asked what I was expecting, I said I didn't know. I remember going to an Atmel mini-conf and got some neat technical information about their MCUs and a dev kit or two… but that was many years ago. Since this was less technical, less hands on, I figured I'd hear more about theory and future plans. I was still hoping for a dev kit. (I always hope for a dev kit. Even when I go to the grocery store.)

It was good that I didn't have a particular goal because it was nothing like what my unformed expectations were.

Taking a step backward, Karen Lightman and I got to talking at DesignWest this year. We've chatted a few times (once on my podcast) and she invited me to the MEMS Industry Group Executive Congress. I suppose I thought this event would be somewhat similar, a little less business focus but still a very “where is MEMS headed?” approach.

One thing I should mention is that this mini-conference was free to attend. And they fed us several times. It is at the Santa Clara Marriott which is a nice location (though I'm going to have a nightmare that involves the garish pattern of the rug). Cherche la femme. Except with money.

And yet, unlike the Atmel processor event, this has not been an overt advertisement. I'm having trouble describing what the conference has been like, hence the roundaboutness. Let me continue with what the day has not been:

  • It has not been very technical. A few sessions got into technical details but most were high level information, more like an introduction why wireless sensors are neat or how the MEMS industry has changed over time, particularly in the morning.
  • It has not been particularly future looking. (It is called “Shaping the Future”.) While there are some microfluidics actuators that I was unaware of, I haven't learned much about sensors that exist now (or that will exist in 3 months, 6 months, or 2 years.

Continuing my randomwalk to getting to the point, I misread the email and went to the Santa Clara Convention center this morning. I saw many tech people streaming in the building: backpacks, jeans, a few suit jackets, all men, mostly with bad posture. I wondered very briefly if I was in the right spot but it seemed like my normal sort of crowd so I followed them in.

 

I was wrong. The people here are more like VP of Engineering level or managers. There are application engineers and some development engineers (and consultants, ahem). There are more suites than jeans at this conference and very few backpacks (oops, though my blue backpack really is a lovely specimen of backpackdom). Shoes are mainly leather with very few sneakers, lots of nice heels. Oh, and lots of women. I don't know how they got such a good ratio but they did. Maybe MEMS has more women?

 

Anyway, these are the grownups. So why are they here?

 

The speakers seem to be trying to convince me that wireless sensors, sensor fusion, and wearable technology are important (and coming soon). Ummm… Some of that is already here, I know, I've shipped those products. For the rest, we've got all the pieces, we just need to figure out how to put it together, make it cheap and easy to use, and then ship it. I suppose I'm too tactical given that I already accept these proposed strategies.

I suppose if I wasn't already in this industry, maybe this would be new information to me. But I like MEMS sensors and I've been working with them for two different clients. And I do tend to try to be industry current and this is, I suppose, relatively current.

Still, the level of material is different from my normal conferences, not technical enough to satisfy me as an engineer and not future-looking enough to make me excited as an architect looking at far-off products. Maybe if I was more used to be only in the role of manager, this might satisfy a need to know what's new and likely to be on the schedule in the next year.

For the most part, the people I met were more interesting than the talks. But there were some good talks so let me start there.

My favorite talk was from Jon Kindred from Starkley. He spoke on hearing aids, the current technology and the future plans. He was not only a good speaker, I was jaw-droppingly interested in the technology contained in the tiny, tiny super power efficient, more smarts than my 1992 computer, in-ear-canal hearing aid. I meant to leave to go see another session but I stuck around after (even ambushed him later). So, that was good. I do so like looking at other peoples' technical underwear. And I'd love to work on that technology and application. And have him on my podcast.

I think my second favorite was from Alissa Fitzgerald. She designs custom MEMS sensors, particularly for medical applications. She talked about the risks of putting things in human bodies. I mean, the risks to the chips, a different perspective. I met Alissa doing the DesignWest sensors in health panel so seeing her talk was one of my main reasons to attend. Not disappoointed.

Finally, I enjoyed Michael Emerson's talk about Preventice, an Android phone connected EKG monitor. It made me think of the podcast with Dr. Edward White about medical technology. I wish I could get them to talk to each other (and let me listen).

As for the people, let me start with people I already knew. Mike Perkins was my boss' boss at HP (omg, that was so long ago) and then again at LeapFrog (that was still more than a decade ago). I wish he'd had his own session, I'd like to hear more about his opinions on the industry and his role at Neato Robot.

I also met Eric Wilson, my boss at the six-week, seldom-spoken-of stint at Steve Wozniak's Wheels of Zeus. I sat next to him at lunch, 75% confident it was him. He didn't recognize me. He seemed awkward about it though I felt it was funny.

Other people I met, I wonder if I'll meet them again at the MEMS Executive Council. Some of them, I think. Though that will be very business related, not technology related. I suspect that will be a very strange conference for me, outside my normal realm. I'm pleased to be going as an expert in shipping embedded products, I'm comfortable in that role though it isn't one I tend to introduce myself as.

I handed out my card, both book cards and Logical Elegance business cards. I'd love to work on hearing aids or something neat like that. But I didn't hear about a lot of super whizzy product using little-heard-of sensors. Maybe during the ending networking session.

 

 

h1

MOSFETs, games, and a demonstration of shiny object syndrome

September 9, 2013

Conversation this morning:

Me: You named one of your gadgets MOSFET... 
Him: Yes...
Me: Why? Is it something to do with Star Wars? Boba Fett?
Him: (Uncomfortable silence.) No. They are used in music amplifiers.

I keep coming back to MOSFETs. I keep seeing them in different contexts where they end up being the “oh you just put a MOSFET in there and it will work the way you want” component.

Maybe it is time I learned what this magical component does.

As a pretest, though, I’ll splat out everything I can think of.

  • When I wanted to connect a IO to a motor, the IO pin didn’t have enough current. So the EE (Phil) put in a MOSFET so I could toggle the IO line to get the motor to turn on and off without pulling current through the processor.
  • When I asked Phil about my resistor divider sucking too much power, he said I should put in  a MOSFET so the divider was only on when I needed to measure the battery. I didn’t carefully read the ensuing EEspeak because I don’t have an extra IO pin.
  • A FET is a form of MOSFET. Probably one with less moss… Actually, it is probably that a MOSFET is a form of FET. Probably with more moss. Really though, there is probably no moss, it tends to be damp and that’s bad for electronics.
  • It seems to be a switch that is controlled electronically.
  • They come in n and p varieties. I don’t know the difference.
  • (And this just in!) They are used in musical amplifiers.

So, let’s be clear: I’ve used MOSFETs before. But as I try to design my own hardware, I keep getting smacked upside the head with them, like getting hit with a fish tail as the fish escapes the boat and swims away. That’s always been ok with me: I never really wanted the fish. But now I want to understand MOSFETs. And not just for a few minutes until some shiny other thought comes along.

Let’s go back to what Phil said in my resistor divider email exchange.

To prevent that leakage current you could just put a FET to turn off that voltage divider when you’re not checking the battery voltage. You could use a high-side P-Channel FET, (between VBat and R1) but turning it off solidly would require a voltage equal to (or higher than) the battery, or you could use a low-side N-Channel FET, but then you’d still have the leakage current through the ADC.  Although that 50KOhm is probably only while it is sampling, not when it is not in use.  So that is what I would try for a minimal-part, minimal cost solution, if you have a spare digital I/O to turn that FET on and off…

Ok. Well, I guess I retained enough of that though I suspect Phil copied the paragraph from the last five times I asked him something that required a MOSFET. I suppose what I need to do is use MOSFET in a circuit I design myself.

First, a little more information, courtesy of Wikipedia. Wow, that article is long. Let’s just come back to it, ok?

And since my attention span is tiny this morning, let me tell you about this game I’ve been playing. It is Circuit Coder for the ipad. It gives me little challenges, like build a NAND gate using only NOR gates, then I build what it wants, trying to think through the problem. Here is my half-adder.
Circuit Coder Half Adder solution

I had a decent amount of logic in college, in the CS courses, so this NAND and NOR gates are buried deep in my brain but have a solid foundation. I like the puzzle aspect. I’m a little stuck on SR latches but I have a plan to go read about them and I suspect they’ll fall pretty quickly.

Since some of the puzzles are tricky, there is a walkthrough. I was afraid to look at it for fear of taking away the puzzle aspect. However, the walkthrough is only for the first 3.5 minutes of the game so I am more likely to cheat using a computer engineering text book. And a game that can get me to look up how components work and demonstrate logic gates so effectively… this is more what I want from learning. Sneaky learning. Though, I wish the game had a little more help and could be a little more competitive (what is the minimum component solution for each?). But completing puzzles is very satisfactory.

I was hoping one of the components I need to make is a MOSFET. But looking around now, I don’t see that in Circuit Coder. (Though I do see a review that rates this game highly and suggests Codea as a good learn-to-code game. Whew, expensive though! And then my appolearning “trial” expired and I am considering whether to buy their (too expensive) app so I could learn about other instructional apps.)

And this is why my quest for MOSFET intuition has, to date, been for naught. I keep looking at the Wikipedia article and then finding something else to do. It is too theoretical and not tactical enough: what should I use a MOSFET for and why?

Getting away from the shiny distractions available in Wiki, I switched to looking at Charles Platt’s Encyclopedia of Components in Safari. (If you write an O’Reilly book, you get a free lifetime subscription to Safari online. Happy perk!)

There was nothing about MOSFETs in the table of contents. That seemed so unlikely for a book titled thusly. I searched for MOSFET, found some entries under Chapter 29. field effect transistor.

I bet “field effect transistor” has been used to sound very sci-fi. If I had a band (made up entirely of light theramin), it would be called “field effect transistor”.

And apparently, I should read chapters 26-28 before proceeding so I understand diodes and transistors because those are related.

I had hoped to share my new-found understanding with you in this post. Instead, I feel like I’ve wandered around in circles until exhausted. I’m going to go sit in a corner with this book and see what I can learn.

Or maybe I’ll do some paying work.

Naw, I think I’ll go run errands.

Or maybe push reload on twitter.

 

h1

In which our intrepid heroine learns about resistor dividers

September 5, 2013

I need to monitor my gadget’s battery.

It has a 4.2V LiPo battery with Adafruit’s USB charging circuit. The system can be charging and running at the same time. However, the circuit does not have a fuel gauge or other monitoring information. It has a couple LEDs to say when charging is finished and when it is charging, but nothing to say “battery is nearly dead” (what I need).

My Electric Imp can only take up to 3.3V as an input. If I try to plug by fully charged battery (4.2V) into my Imp’s ADC input, well, fire is fun but bad. (Ok, it probably won’t cause a fire but it may cause an early demise to my Imp.)

Level shifting a signal is a common thing to do. I know this because, in role as software engineer, I have said, “Can’t the hardware just level shift it to a better range for the software?” It is easy!

When someone else does it.

Swotting up

Faced with the problem, I went off to read a little bit. I asked my EE friends to recommend books (other than the physically heavy, mentally heavy, doesn’t-come-in-Kindle Art of Electronics). I read Make:Electronics awhile back and enjoyed it but it was too simple. I need something beyond “here’s how to read a schematic” and more on the order of “here’s how to solve the 25 most common problems a DIYer will have”. Though if they ever do a Headfirst Electrical Engineering book, I’d be all over that.

Anyway, I eventually found that I want a resistor divider. This is like page 3 of a good electronics book so it wasn’t like I spent more than an hour on it. I don’t remember which web page made me think, “This is what I need” since I found it in a few places, including Wikipedia. Here’s what I learned about a resistor divider:

 

So if Vin is my battery and Vout is going to go to the Imp’s ADC to be measured, I need to set the resistor values (Z1 and Z2) to be something that makes sense.

I’m too lazy to do real math when I’m just poking at this. Ideally, I’d look at the range I want to measure (4.2-2.8V) and the range I want it to shifted to (3.3-0V) and crank. But lazy. So let’s just set Z1=Z2 so my resistor divider divides everything in half. I can prototype that and not blow the Imp, work out the details later.

But wait! Resistors to ground are power vampires. Since this is a battery system, I want to minimize power.  I typed “power calculator” into Google and came up with a reasonable webpage that would do the math for me, though the equations were there so I went ahead and thought about it. Here is the important equation, from Wikipedia:

So if I want to minimize power… then I need to maximize resistance (R).

I know I’ve used these equations before but I’ve always been answering a review or exam question, not my own need-to-know musings.

Next, I thought about looking through my bag of resistors. But I realized that the 4.2V already gets translated to 3.3V so why didn’t I use that? I don’t even need to dig through a pile of anything.

Use existing resources

I connected 3.3V to my ADC input and wrote the software to sample the pin. Well, really I just copied it from the Electric Imp Sampler API page and then got it working for my system.

The ADC measured 0xFFFF (maximum value). That made sense, it can measure 0-3.3V and I was putting in 3.3V.  I sampled every second as my battery took forever to die, eventually it measured 0xFFEF. Since the ADC is only 12 bits (shifted over to 16), that actually means there was only one bit of difference.

One minute after it went from 0xFFFF to 0xFFEF, it died. So there is only one bit of difference between “great” and “dying”. Plus, only one minute of “dying”.

This method won’t work.

Resistor networks, Part 2

Well, I had estimated the resistor math so after my failure, I got my bag o’ resistors and fished out the highest value ones: 91MOhm, 33MOhm, 10MOhm, 1.5MOhm. I’ve got several of each, from buying a pack of 500 at RadioShack.

I was pulling over my solderless breadboard when I realized that this was too easy. I started hearing that “monsters ahead” music in my head. (Dear brain, can’t we find another way to communicate? And what does the Gilligan’s Island theme mean?)

Plus, it was about lunch so I shot off a quick email to Phil (of Weekend Engineering) and told him my plan. His reply was two paragraphs long. The first one made me wish we’d used a white board:

The voltage divider output is just R2 / (R2 + R1).  So if you want your peak 4.2V input to be 3.3V at the output, you want a ratio of 3.3 / 4.2 = R2 / (R2 + R1), so you want resistors proportional to R2 = 3.3, R1 = 0.9.  This makes sense intuitively if you think of a series stack of identical resistors with the voltage dropping across it.  If you had a stack of 100 equal 1 ohm resistors, then 1% of the voltage drops as you go through each resistor.  If you put 4.2V in the top, the voltage decreases by .042V every resistor you move down.  22 resistors down, the voltage has dropped by 22 x 0.042V = 0.924V to 3.276V.  So R1=22 ohms (the 22 one ohm resistors in series), and R2 = 78 ohms (the remaining 78 one ohm resistors in series.)  There’s your 0.9 : 3.3 ratio.

He probably did all that math. None of my “well, voltage squared is around ten” ballpark nonsense for him. So, cool, he did the math. I can just use his answer.

The second paragraph burst my bubble:

Now, the larger resistors you use, the less current you’re drawing through this stack of resistors.  BUT, if you draw current out of the stack, into your ADC, then the you change the voltage, because the resistor divider assumes that there are no other current paths.  So the max size resistor you can use depends upon the effective input impedance of your ADC.  You want that impedance to be very large (10X or more, possibly much more) compared to the total resistance of your resistor divider.  As the current through your resistor divider gets very small (because the resistors are huge), that signal will also be more and more subject to sources of noise. That’s the motivation for not maximizing.  (Otherwise, you’d want to just use giga-ohm scale resistances.)

Yeah… I think that was the monster: why doesn’t everyone use giant resistors? And how am I to wade through Electric Imps documentation to find what the input impedance is. (I like my Imp but their Wiki is often a maze of twisty little passages, all alike.)

I looked at their forums (mental note: write a blog post about why I deeply dislike forums) and found an answer deep in a comment thread: around 50kOhm. Later in the thread, they report which processor the Imp uses (but I don’t think they want to bandy that about so I’ll let you look). I went to the processor’s datasheet (already on my harddrive as I used it in a client project recently) and 50k looks right.

So according to Phil, my resistance needs to be 1/10 of the input impedance: around 5k. But the power dissipation is huge! (3.528mW, Phil and I exchanged emails and, again, he did the math.) Essentially, it burns 0.8mA all the time.

This is a crime in a battery powered system.

To deter my continued questions, Phil suggested using a FET to control whether the battery monitor was on. But that requires an IO pin. I don’t have any extra, I’ve already made my tricolor LED a bicolor LED since I need to have a pin from the accelerometer to wake up the Imp.

Stomp stomp grrr. Electrical engineering is all about making difficult things more difficult. Hmph.

Buy my way out

Once I got over my post-lunch-need-a-nap-fussiness, I thought about some projects I’ve worked on and tried to remember how the problem was solved (without cheating and looking at client schematics). I remember someone swearing at a fuel gauge driver and an EE remarking at how stupidly expensive the part was. A little bit of searching led me to a SparkFun board with an I2C power monitor.

The first product comment is a plea to add this to a USB LiPo charger board. That was two years ago. Nothing. Not on AdaFruit or MakerShed either. Someone is missing a big opportunity here.

Anyway, this bumps my materials cost up by $10 but solves the problem very neatly. Plus, since it is I2C, I actually get an IO pin back so I can have a tricolor LED again.

Tempting, so tempting.

Plan

If this was a startup, I would be strongly in favor of buy instead of make. You can always make (and make cheaply) later but you can’t get the startup rolling if you take on too much at the start.

I think I’ll sleep on it and see if I can find a better solution. One that doesn’t involve much soldering.

Sadly, one of the negatives is that I need to buy a few other pieces of gear and right now I’ve got carts on SparkFun, AdaFruit, and Digikey but I don’t want to have three orders of stuff. I don’t know why. I’m just that way.

 

h1

A promise that, in the future, it will be better

September 4, 2013

Elizabeth came on my podcast to talk about Dolores, an older neighbor who lives alone. We got to talking about a device that would let Dolores maintain her independence while reassuring her family (and Elizabeth) that she is fine.

The idea is similar to the thinking-of-you jar I’ve been working on to explore the Electric Imp. Essentially, add an accelerometer, put it all into something cute (i.e. a teddy bear), have Dolores pat it when she wakes up (or if it is in the kitchen, when she walks by). If Dolores doesn’t pat it by 10am or three times a day or (setting to be determined), it will contact her family who can call and checkup on her.

This isn’t a hard concept. And I’ve been scooped a bit by Goodnight Lamp. (Hmph! People who take my ideas and go back in time to make them!) But their solution is pretty expensive (~$150) and I think I can do something for $80 from off the shelf parts.

Parts:

On the podcast, I said I thought it would cost around $80 to do a handcrafted one and my total here is $81. Yay estimating skills! Oh, I forgot:

  • Adorable receptacle: priceless.

On the show we also talked about features:

  1. Dolores would pat the bear.
  2. WiFi or other configuration to be set up by a daughter, Elizabeth, or other caregiver.
  3. Bear will also light when people hit a website (so the thinking of you functionality).
  4. System will message daughter (text, email, phone) if Dolores doesn’t pat the bear before certain times. (No check-in)
  5. System will also message daughter if bear is not charged or service is down for some reason.
  6. Daughter can see when the bear was patted (to verify system is working).
  7. Chargeable: 1 week of battery. Plugged in via USB wall wart.
  8. If battery is low (1/3 usable charge remaining or 3 days), system will email Dolores.
  9. If the battery is very low (2 or 1 day of battery left), system will email daughter.

Some I added later:

  • The bear will respond to a pat with an LED light (white if tricolor, green if red-green).
  • If the bear’s charge is low, it will respond to a pat with a blinking red light.
  • If you keep patting, the bear’s LED turns yellow. After thirty seconds of intense “patting”, the bear turns red and messages the family.

None of this is all that difficult. I looked at the Electric Imp hardware. I need to add battery monitoring so I’ll learn their Sampler class. And I need to add an I2C accelerometer but I already made an I2C LED work so I do not expect a problem. Much of this is server side, the agent software that I’ve been avoiding. I know in theory how to do it but I suspect the practice will be like hitting my head on a wall a few times.

Some of the work will be electronics: the battery is usable from 2.8V to 4.2V, the ADC input to the Imp presumably can’t go above it’s operating voltage (3.3V) so either I need to sort out a level shift (resistor divider? but that is a waste of power!) or figure out where else I can monitor power (maybe going into the Imp, on the April board?).

Also, I know an accelerometer is overkill, especially three axis ones; there are other motion sensors. On the other hand, I know how to use an accelerometer really well and I’ve got many lying around. Though I wonder… a temperature sensor would cost nothing but it takes longer to work and breaks my patting method.

Also, since the unit is going to be sleeping most of the time (for power reasons), the pat needs to wake it up. The Electric Imp has six pins available. I’m using 2 for I2C to the accelerometer, 1 for monitoring battery voltage, and 3 for the tricolor LED. If I need the accelerometer to interrupt the processor, I’m going to need to go to a bicolor LED so the user will only see red, green, and yellow. I think that is ok. But it makes me wonder if the accel really is the way to go. I don’t think I want a simple push button switch (not cute). Well, I need to go look at force sensitive resistors and soft potentiometers. Though how those are going to wake up the processor, I don’t know.

Yet.

h1

Cute internet enabled LED

August 29, 2013

Ok, I’m done. Or done enough.

Thinking of you LED

 

As you can see, I procured a jar and some semi-transparent rocks to diffuse the light. Recently the jar was mistaken for a jar of ice, so that’s what it looks like when it isn’t lit. The webpage looks like it did in the last post. It now posts the sender name as well as the color. I can snoop to see the server log with the sender name but didn’t make a page for the thinkee to see who sent them love when they weren’t looking.

The battery got bigger so that it lasts for about a week with 3-5 events/day. I did switch to a standard LED instead of my I2C LED so the total parts cost is about $70, pricey but it is handmade.

Things I kind of want to add to the project (projects are never finished):

  • Add battery monitoring so it does something when the battery needs charging
  • Add a thinkee page to see who sent love
  • Add an accelerometer so the thinkee can tap and have that get back to the sender
  • Update the Electric Imp to use the beta agent interface so the response is prettier after love is sent
  • I suppose some would say it needs a better container but I find this one quite amusing in its homemadeness.

I thought about selling this on Etsy but, really, I could sell this to a couple real-life people without bothering to learn how to do Etsy.

If I sell it, though, I don’t think I’d build another. I have a different idea. One that matters a more to me. But we’ll talk about that later. Soon.