Nov 10 2007

Talking Microcontrollers

Published by Ron at 2:04 pm under Electronics

While microcontrollers, such as the Arduino, are good at making LEDs flash and speakers beep, they can do a lot of other stuff. One of the more interesting things you can do with them is get them to talk.

When I say “talk” I don’t mean speak, but communicate. For example, they can talk to a computer they are plugged into (via USB). They can talk to other devices on a network (wired or wireless ethernet). They can even talk to each other, using something as simple as a twisted pair copper connection to something more interesting like ZigBee or Bluetooth.

Some sample applications:

Perhaps you have a weather station which collects windspeed and direction. One of the challenges of having an Anemometer is that it must be placed away from buildings (ex. on the roof). So, you’d have to run a lot of wire up there. Instead, you could have a microcontroller connected to a ZigBee module, all of which is powered by a small solar panel. (Most microcontrollers are very low power and can easily run on a battery/solar combo.) The ZigBee has a 100 meter range (indoors) so you can place it quite a ways away from the house.

Or perhaps you want the ultimate child monitor. You place a microcontroller, ZigBee module, and RFID reader combo next to each deadly area in the house (stove, stairs, paint thinner, dirty magazines, etc). Then you embed a RFID in your childs arm. Every time they get near the RFID reader, the microcontroller picks it up, transmits information via the ZigBee, and alerts the parent. (Since ZigBees work as a mesh network, they hop messages to each other, so you don’t need direct contact between child and base. Every module is a base station of sorts.)

You could be an avid bird watcher, with several bird feeders set up around your land. You could put a ZigBee and microcontroller and a sensor (heat, accelerometer, whatever) on each feeder. Then, when a bird approaches, the info is passed over the mesh network alerting you that there are birds in the area. It could also trigger things like cameras, which would record only when birds are in the area. (Similar to the ones that hunters use for deer; except these cameras communicate back to the base station in real-time.) At the base station, a module could be connected to the internet, sending you an e-mail each time a feeder is used.

You get the idea. There are tons of uses for these low power, mostly inexpensive, devices. The problem is finding a place to learn about them, and for that I would suggest a book called “Making Things Talk”.

Making Things Talk

You can pick up a copy at Amazon for about $20. It focuses on the Arduino, so if you are interested in learning how to do more complicated stuff with that board, this is a book for you. It starts up easy, and then gets into connecting stuff to ethernet, Bluetooth, and Zigbee. It also does a good job in covering a number of different sensors (probably the most expensive part of many of these projects).

I’m not a big fan of how the book is laid out (trying to be too cool, and thereby making some sections hard to follow), but the information–and ideas–are gold. It also starts you out with little assumed knowledge of electronics, which is nice for beginners; though the book is not dumbed down, especially in the later chapters.

What really impresses me in general about this stuff is how easy it is to get a microcontroller talking with another one over a wired/wireless connection. The connections are pretty straightforward, and all the radio negotiations are handled by the ZigBee/Bluetooth boards. Just give them power, and connect the transmit/receive pins. That’s about it. This is wonderful, because it allows people to take ideas and make something very complicated without needing a degree in electrical engineering and a million bucks.

9 responses so far

9 Responses to “Talking Microcontrollers”

  1. Ronon 10 Nov 2007 at 6:56 pm

    Another thing I’m digging is that there is a real electronics renaissance happening right now.

    I remember being interested, in the late 1990s, in electronics. The problem was, there were very few good books, the magazines were going under, and Radio Shack had become a cell phone store.

    This is really an excellent time for people to be getting into electronics as a hobby. Heck, we may even see a rebirth of Ham Radio.

    Also, I think that it’s VERY important that this hands-on microcontroller stuff be introduced to more kids. Over the past 10 years or so people have gotten so far away from the hardware that it’s become nothing more than a black box. Things like microcontrollers really help you to understand the computing big picture.

    Finally, I think that ALL professional developers be required to know how to program on one of the 16K chips. They really do teach you to be inventive, keep super-clean code, and have to deal with very clear hardware limitations. You can’t just “throw more RAM” at a problem. You have to FIX the problem. I’m talking to you, Web 2.0 developers!

  2. Debon 11 Nov 2007 at 12:03 pm

    My aunt could not graduate high school without calculus: no one could. And this was just Mars High School in rural PA. he’s a bit more than 15 years older than me. Our schools are undervaluing students, and not teaching to an adequate standard.

  3. Ronon 11 Nov 2007 at 2:29 pm

    Undervaluing students and overvaluing standardized tests. Though, I think school has ALWAYS sucked, one way or another. Look at my extensive array of degrees: A Chicago Public High School Diploma.

    Most of the useful stuff I learned outside of school. I learned to read at home. I learned science at home. I learned to build things at home. I learned to hate math at school, thanks to awful teachers.

    Frankly, I think good role models, a good stack of reference materials, and a well-supplied workshop are what people need.

  4. Evelynon 11 Nov 2007 at 2:55 pm

    Math and Science are a difficult subjects and for some people the learning curve is a little longer. Problem with schools these days is that most are teaching enough to score high in standardized testing but the actually learning and understanding is lost in the process of getting the student to memorize and pass those markers.

    Furthermore, the would have been teacher (who are exceptional and really interesting) choose not to teach because they earn far more being a professionial than a teacher. Also they don’t have to deal with the sort of bureaucray or the high number of student per teacher and the lack of support teachers get when it comes to supplies, class projects, labs and such.

    I initially thought of being a teacher but there were way too many obstacles.

    The clincher for me was when I had to do an emergency teaching for a private high school in the southside. The math teacher was shot about a month before the year ended. Through my years of volunteering network, I was approached to help out. I accepted. The challenge / goal was to help and get the seniors through their final year.

    I got them through it. I taught 2 classes of freshmens, juniors and finally seniors.

    I assigned homework, had quizes, and gave the lecture. I made the class fun by having the student interact via demos or solving on the board their process.

    This experience left me with no desire to pursue
    teaching. Why? Simple for every assignment, quizes, and planning it involved more of my personal time which I was not being compensated. In other words not only was I working the typical 9 to 5 but now I had more work at home to do. I didn’t mind in this case since it was an emergency but it sure did open my eyes to a potential future if I were to pursue teaching.

    Another point was dealing with student’s attitudes and issues. I enjoy working with kids a lot but not in a system that ties my hands.

    Maybe that’s why I do the volunteering because at least in this environment when I come in I do what needs to get done and I see immediate results. I don’t feel like I’m wasting my time.
    Furthermore, when I see these kids at different times I get positive feedback. Some have told me personally that they appreciated my support.

  5. Ronon 11 Nov 2007 at 4:36 pm

    Dave brings up almost the definition of the “liberal arts” education. It’s supposed to make you a well-rounded person. However, I’m not sure how well it acutally works these days.

    Seems to me that most college students are focused on their “major” and do the minimum of everything else.

    Perhaps there is little we can do about it. After all, the body of human knowledge right now is greater than all recorded history up to now. (Just as there are more people alive today than have been alive in all history.) Perhaps there is just too much to know.

    Even in a given field, like “computers”, there are an almost infinite variety of skills. Are you a programmer? What language do your program in? What platform? etc. etc. And that’s one subset of one “career”.

  6. Evelynon 11 Nov 2007 at 5:41 pm

    I agree, it’s really what you make of it… whether you go through the motion of getting the degree or being self taught, it’s who you are, your determination, and hard work that makes you a sucess whether it’s for your own business or working for others.

    In this modern day there are more information to obtain then ever before and just like that you as an individual has to make choices therefore there are trades off in how much you succeed or what you concider is happiness.

    Also, since there is an overwhelming amount of information there are those individual who are experiencing what I call “information overload” causing those individual to be neither going or coming. They’re at a stand still not sure of what to do or how to do it.

  7. Debon 12 Nov 2007 at 5:10 pm

    I want to put in a word for high school education here. It’s a shame that many schools don’t have a good curriculum. I was fortunate to actually go to a school (in what was then rural PA, we’d look out the window of our math class & watch cows f***) that taught useful things. In Jr. High we had a 6-week section about how to study. I got all my good study skills here. Then we could choose a speed reading/comprehension class. I took that. Very useful. We also had a 6-week section in critical thinking — how to recognize propaganda techniques. I was aforced by my mom to take a summer class in typing. Hated it, but again useful throughout my whole life. Still, graduation requirements were lax, giving too much choice to the student. I graduated without calculus, on a college track. Don’t know what’s happening to schools now (I graduated in 1970), but I was shocked to learn that Ev had been taught no study skills in the Chicago school system. I mean, it’s not something you just know.

    I am a victim of information overload. Just too much is out there. I want to just hang out in the woods and look at birds. My deevolution scenario: move to a central american country and live in a tree by the beach. Eat bananas and fish.

  8. Ronon 13 Nov 2007 at 9:51 am

    What kind of bizzaro world did you grow up in Deb? Here’s how it compares to the Chicago Public School experience:

    How to study: Nope
    Speed reading: You have got be be joking!
    Critical thinking: LOL!
    Typing: Not available until High School.

    You had to graduate HS with 3 years of math, I think. But the *type* of math didn’t matter. You could do fundamental math, geometry, and basic algebra.

    My siblings and I went to the *good* schools, which were excellent under the principal, Don Bayer, but sucked ass after his retirement. My sister went to the “Ag School”, which I believe was a good deal better than the halls of Morgan Park.

  9. Evelynon 13 Nov 2007 at 10:07 am

    It’s true about the studying skills. Growing up I was too busy trying to survive and take care of my family. High School was especially bad for me, first day of class was a full blown shooting when my mother had parked to drop me off. We ducked in the car and she yelled at me we’re going home as I opened the car and told her I’m not going to miss school. I closed the door and ran to the other side of the building and begin my journey.

    I was a good student and did my best to get good grades. I was in the honor roll most of the time. Just as in grammer school, I had to deal with the gangs and drug dealers. My best way to deal with it was to AVOID it all. I didn’t have time to make friends and strangely enough I had a bodyguard in high school who in exchange I tutored.

    For those people who think that most kids graduating from the city school are well rounded and have been properly taught, it’s an illusion.

    I struggled in college and the only course that I felt quite comfortable was with math and that’s why I ended up with a math degree. Sure yeah that’s an accomplishment, right! This college was quite supportive—NOT

    I was lost in red tape and being the first one in college I didn’t know what needed to be done.

    Hell, it’s when I meant Debbie in one of our math classes that she invited me to study with her group. I am forever grateful because it was through this group of fine ladies that I learn to study NOT any school institution.

    I sound biter and it’s because I am. This first round of higher education I paid with hard work since I didn’t have the financial support. It was pay as go and it took me literually 12 years to get a stupid degree. This school didn’t help me it was making money off of me. I could have had 3 degrees at the rate I was going. There was a particular math teacher who helped me break this cycle and finish my schooling. It’s rare to find a teacher who really cares. I’m grateful to him.

    The system doesn’t work not for poor or working class neighborhoods.

    When I interact with my kids during my volunteering, I still encourage them to stay in schools and I do my best to mentor them. I don’t want them to experience what I did.