Bitten by the Microcontroller-Geek bug

Ever since ECE4670 (actually since the summer before I took the course), I’ve always wanted to pursue these sorts of electronic DIY projects as an intelligent hobby. In fact, after completing my final project for the class and completing my sole final exam, I hooked up an old school imitation SNES controller to an arduino emulating the controller protocol (it’s not very difficult) and was able to detect which buttons were being pushed (the goal of this step, which was never realized, was to be able to play SNES games on the computer using Zsnes). And then I went ahead and ordered another arduino board that was compatible with various shields (so now I have the nano and a duemilanove), some pin headers and jumper cables, and a wiznet ethernet module compatible with the arduino ethernet shield in anticipation of all the cool projects I’d be doing after starting work. And what do I have to show for it all? Sadly, zilch.

I’ve sorta tried within the first few weeks of moving out to California, but I gave up pretty quickly. I wanted to set up an infrared LED emitter/detector pair and just be able to detect objects, but when I set up the circuit and dumped readings onto the serial port, it wasn’t working. And since I had no debugging tools, I decided it would be a waste of time to try to fix it. I bet the circuit is just wrong since I suck at that, but I can’t definitely check anything without a multimeter. After wasting a few hours of unaided “educated” poking around, I decided the hobby required too high of a set up cost (namely getting all the necessary components that I took for granted in the school lab, actually having a semi-suitable “workbench”, and then spending the time making things work). I packed all my electronic tinkering parts into some boxes and left them in my closet. They’ve been there for the last 5-6 months.

Since then, as is apparent from previous blog posts, I’ve been dabbling in purely web programming. And although it’s been fun and engaging and enriching (while hating on overly complex java web development at work, I’ve picked up django and yii at home), it doesn’t have as much of a “cool” factor as something that is really tangible. Or maybe I’m just looking for variety – people need change and variation to be interested right?

Truth is, the more I think about the high setup cost of microcontroller projects, the more I realized how that it wasn’t as high as I thought. I kept saying, “Oh man I need all these tools and they’re not cheap!” But at a bare minimum, I really only need a multimeter (continuity buzzer a must), soldering iron+solder+stand, wire cutter, wire probes/clips, and that’s basically it – I already have breadboards and components leftover from my sister’s EE projects and from my own projects. Some other things would be nice to have – power supply board, an accessory box so I can finally organize resistors, etc. An oscilloscope would be nice and critical, depending on the project, but definitely not a bare necessity for someone like me. I guess it’s still somewhat of a nontrivial list of supplies, but considering how much money I burned on a DSLR, a cello, and a longboard, the cost of getting what I need isn’t really too high at all. Even if I bought a bench-top oscilloscope, I could find one that comes out to less than half the price of my DSLR.

Then there’s still the issue of time. Getting electronics to work is time consuming. But now that I think about how much time I put into picking up web development, I realized how time consuming that is too (although, there’s much lower of a hurdle to get into web development – $0 monetary cost being a biggie).

So a few days ago, I dusted off my arduino. I downloaded the IDE (along with the Processing environment, which by the way, is a great way to get your feet wet in programming). I loaded a few basic examples and made minor modifications just to familiarize myself again with what it’s like to program for a microcontroller. I rediscovered that the longer terminal on an LED is the negative end. I quickly wrote a sketch enabling me to send serial commands to the arduino. It was all simple and basic stuff, but being able to turn on an LED just by typing “on” or “off” on my keyboard felt good (albeit, in a lame sort of way, but still overall positive).

This is the part where I list out what things I plan on buying in attempt to get back into this sort of thing. I’m trying to be budget conscious so if you know of something that you’ve used for cheaper, please let me know.

  • Multimeter: Debating between (cheaper) ones from futurlec (starting at $4.90) and the $15 one from sparkfun. The cheap one on futurlec looks a lot like ones I’ve seen used in lab, but I’m not sure. The one from sparkfun I know is probably reliable since they only sell things they endorse after using them.
  • Soldering supplies: sparkfun. Soldering iron, soldering stand, solder, and solder wick. Total cost around $25.
  • RS-232 board from futurlec: This is just for convenience when interfacing with serial devices. I suck at circuitry so I’d much rather work with modules for an extra cost than spend hours making an inferior and temporary one.
  • 5V power supply board from futurlec: Also for convenience, in case of projects where I don’t want the microcontroller to be tethered to my computer, or need to supply more power for other components.

Hopefully it won’t all be a waste, and that I’ll not be lazy and have some geeky fun. However, one thing I’m really not looking forward to is picking out the right resistors by trying to read the stupid color bands. Suggestions for a suitable and convenient storage solution would be greatly appreciated.

Personal Computing: Then and Now

Before you think that from the title of this post, this might be some scintillating discussion about the evolution of computers and technology, allow me to severely and promptly disappoint you by saying this up front. This post is solely about – surprise, surprise – myself, and how I used to do things then (i.e. freshman year and prior), versus how I’ve come to use computers now (a lengthy 4-5 years later).

What prompted this post was my visit back to NJ and cleaning around the house. I came across my previous laptop (an HP dv4000 series I believe) which I ditched because it would literally stall at any given time (not freeze, but stall – including the hard drive activity indicator LED). The only remedy was to semi-randomly apply pressure on the laptop with my hand, or to tilt it, until it resumed execution (before stalling again shortly thereafter). Yeah, weird. And very annoying when trying to work on projects, especially time-critical ones. Anyways, it’s still technically usable so I booted it up to give it a run, and browse through what contents I had on it in the hopes that I could salvage some data that I lost when my hard drive recently died. It wasn’t until I browsed through my “programs and software downloads” folder that I realized how much I’ve changed as a computer consumer throughout my engineering education.

Basically, pre-college, I was one of those ignorant consumers where everything I used was a black box (well, that might still be true, but to a lesser extent; at least, that’s what I’d like to believe), and I expected everything to be pre-configured just right. Thanks to the nature of my major (namely, requiring extensive use of a computer), I’m a more well-informed and tech-savvy consumer (again, that’s what I’d like to believe), and thus able to make some better choices in terms of computing. So without further ado, I present the “then and now” list: Continue reading

Cornell 2009 Video

httpvhd://www.youtube.com/watch?v=ILVtD17vb1U

Song: Strawberry Swing by Coldplay

Shot with a Creative Vado HD camcorder (hassle to edit with though). Converted to WMV files for importing into Premiere Pro, which was fine until I had to export. Never ever edit with WMV. I did not know this until finding out the hard and VERY LONG way. The wmvdecod.dll module caused Premiere to crash on export a bajillion times no joke. Basically I had to export in small parts trial-and-error style until it worked.

I hope it makes my Cornell readers at least smile if not laugh.

DONE

I just submitted my last project of the semester, and took my only final exam last Friday. I have officially (well, I guess still unofficially) finished my undergraduate education!

I’m also happy because one of my projects got posted on the hackedgadgets blog (which is one of many blogs for geeks and nerds). Check it out here:

http://hackedgadgets.com/2009/05/10/digital-paperless-receipt-system/

I already talked about what it is in my previous post, but here’s the link to the lab report again:

http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2009/hh236_qc36/hh236_qc36/index.html

Also my software engineering group turned in all the documentation and source code for the iCampus iPhone app we wrote (only relevant for people in the Cornell community or for prospective students and visitors). One cool thing is that the HCI (Human Computer Interactiona) department at Cornell has expressed interest in building upon the app in the future for research purposes. It’s up to the client to decide the direction of the app, but I take it as an indication of good work and a job well done :) It’s not available through the app store, but you can get it free here:

http://iphoneapps.cit.cornell.edu

CIT has an authorized provisioning profile to release apps, so everything’s nice and legal. Just have to add the profile to your iTunes and everything else should be the same (I don’t have an iPhone or an iPod Touch so I couldn’t tell you, but there are instructions on the website).

Lastly, I finished my sparse petabyte filesystem for the operating systems practicum. That’s probably the most bland to anyone who reads this blog, but if you’re curious you read about it on my website.

The last few days I’ve been spending a lot of time looking at electrical components and DIY projects, after being inspired by all the projects that were done in ECE 4760. Playing with microcontrollers actually makes for a really great fun and intellectual hobby and I definitely hope I can spend some time to make more stuff when I start working. My next project I envision using IR LEDs and IR sensors/photodiodes to do something. I don’t know what yet, but I have a feeling it will somehow be related to using the bathroom. It’s inevitable. I’m not going to go so far as to making a fart intensity meter which one group actually did (look at #16 under Spring 2009 here), but maybe something like a “YOU DIDN’T WASH YOUR HANDS” indicator. Just kidding. Maybe.

Anyways, it feels great to be pretty much done. I’ve had a really bad case of senioritis and now it’s okay!

Stuff I did this semester

So, thank God that I’ve officially finished all my ECE courses as of Monday 12pm. Finished my final project lab report and demoed it for the professor, which he liked and described as “slick” :p. To be brief, it’s a conceptual prototype/proof-of-concept of a digital receipts system, inspired by start ups like Third Solutions (http://myreceipts.com and http://digitalreceipts.com) and AllEtronic (http://alletronic.com). It uses a magnetic card reader, an ethernet module, keypad, LCD, and a microcontroller at the POS end, and a remote webserver with PHP and MySQL to store transaction and user information. The general idea behind this kind of system is to offer the service for free to consumers and retailers, aggregate information about what people buy, and sell it to retailers. The retailers could use that information to shape their marketing strategies, business model, whatever. Anyways, for this project I just did it because it seemed interesting and just wanted to have a microcontroller make persistent changes on the internet. Lab report webpage can be found here.

Second major project I have this semester is also almost done. It’s an iPhone/iPod Touch application called iCampus, directed towards anyone in the Cornell community. It has a campus map that can be manipulated much like a Google map and you can locate yourself on the map using CoreLocation if there’s a strong enough signal. In addition there is directory/facility information which can be plotted on the map with fairly good accuracy. Right now it only has dining information, but future data sets could be added to make the app more comprehensive. Other cool features relating to the dining dataset is being able to plot the 5 closets locations relative to where you are, and being able to see what is currently open now, based on the hours information for each place in the database. If you have an iPod Touch or iPhone, try out the app from http://iphoneapps.cit.cornell.edu! User feedback greatly appreciated.

Thank God my projects have been going very well this semester, and that I found them engaging and gratifying to work on. I’m excited to graduate but it’s bittersweet because of the potentially interesting things that can be built upon stuff I’ve done, mainly with the iPhone app. Anyhow, I imagine continuing playing around with microcontrollers and iPhone development down the road.

All I have left is to finish documentation for the iPhone app, my filesystem project (really stupid because of the instructor’s incompetence), and an Operating Systems final exam. Then it’s 1.5 weeks of freedom and enjoying Cornell without worrying about homework and deadlines. Looking forward to just soaking in the nature of the gorges and lakes, running around outside, reflecting to myself, and pursuing hobbies (like cello, drawing, media, etc).

Life is great right now. Thank you God. Help me to never take it for granted. Never.

The Home Stretch

After one more month, I will have completed my last final exam and last semester as an undergrad. I CAN’T WAIT to be done with ECE.

This semester I actually like my classes a lot more. I’m taking 4 courses, 13 credits. 3 of those courses are purely project courses so that means I only have one final exam. That’s really great, but it also means this month pretty much sucks.

My ECE project is an “internet-enabled” magnetic swipe reader system that can read a credit card, take in numerical keypad input (i.e. a price or transaction amount), and send the transaction information over the internet to say, a PHP script that parses the information and stores it in a database. Maybe that doesn’t sound that cool or fantastic for a senior design project, especially since I’m buying a magnetic card reader and an ethernet module that implements a set of network protocols. But it’s also not trivial to implement either, mainly the interface between the micocontroller and the ethernet module. The major source of headache is knowing how to use the darn ethernet module (Wiznet WIZ812MJ module). Wiznet has some firmware source code that supposedly provides an API, but I still have to go through it and understand to know how to use it. I skimmed through it and it’s not going to be fun. Not to mention that in order to understand it, I have to pretty much memorize the datasheet (pinout, memory mapping, register descriptions, etc). But once I get that out of the way, the rest of the project SHOULDN’T be too bad. The interface to the card reader is just an RS-232 interface, and there’s no API with the card reader that’s needed (I don’t think). Then there’s the keypad and LCD display to interface, but we’ve done that already in labs so should be straightforward. The web side of it shouldn’t be bad either. Ugh….Arduino is so much more convenient. I look forward to having more fun with that after graduation.

In another class, software engineering, my group is developing an iPhone application! It’s a Cornell map/directory application that will be able to find your location on campus, and show you surrounding locations that can be searched for, such as dining halls and eateries (what we are focusing on). It’s all fine and interesting except for the fact that 1) it doesn’t work on a real device yet (works in the simulator), and 2) the map doesn’t really correlate well to the GPS data given to us, which means it places marker in the completely wrong place. We’re still working on that….in 4 weeks it will be perfect (ideally). The fact that development can only be done on a mac doesn’t help either.

In my last project class, operating systems practicum, I’m writing a sparse petabyte filesystem using fuse. What the heck is fuse? Chances are you probably don’t care and I’ll probably never use it again after this class. The project is written in C. I hate C (or to put it more softly, I’d rather not use it). Maybe it’s because in ECE we didn’t really program in C much and the CS program really likes Java. In any case, the project is kind of cool in the sense that I’m learning more about how filesystems work. I needed to implement a B+ tree which was kind of gratifying after I finally made it bug-free (I think…). What sucks is for the second part of the project, I probably won’t even be using my code because the data structure I used is not really optimized for synchronization/multi-threaded access. Poop.

Well, maybe my projects sound kind of interesting to my small reader audience. And they are! So why am I complaining about it? I guess you could say….SENIORITIS. I’m lazy and tired of school. Honestly, this microcontroller stuff, I’d LOVE to do as a hobby after I graduate, and make geeky things. iPhone development is also something I’d love to pick up and continue pursuing if I ever get a mac (but both my sisters do so I could use their computers too…and their iPhones). Filesystems? Well, I probably wouldn’t do that in my spare time….but the point is I just don’t want to deal with it NOW and ALL at the same time. Like, I’ll have my moments of excitement from the idea of creating a cool system or application, but then I see how much work it turns out to be and I’m like blahhhhhh. For you Naruto fans, I feel like Shikamaru (minus the strategical genius); I’d rather just lay down and stare at the clouds passing over. So much trouble.

One thing I must say though – we take technology for granted SO MUCH. We don’t get how much rigor and detail is needed just to make something as simple and commonplace as a touch tone dialer. Or when we’re using a computer and open a file – do you really know what the heck is going on when you double click on a set of pixels on a screen? How does “the internet” really allow computers to communicate with each other? I certainly don’t know, although thanks to the engineering education, I have a slightly better idea. Just slightly.

Sometimes I wonder if engineering was really for me. My parents always said a doctor was a good fit for my personality, and I don’t disagree. Besides the fact that theres like countless years of schooling required, I think the pressure of making an incorrect diagnosis or screwing up something during surgery would get to me. Plus, I like having this technical knowledge. I don’t know. I guess that means I’m still waving my arms around, reaching for what truly interests me. I have a feeling that it won’t ever lead me to getting a PhD though….the parents won’t like that.

Anyways, I find myself struggling to transcend all this stress from “fulfilling your potential and ambitions” and to just keep things simple. I’m a Christian; the most important thing is pleasing God. That’s all that really matters, when it comes down to it. If I can’t grasp that, life is moot. Seriously.

Well, time to go read that datasheet and firmware code….