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.


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:

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

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:

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 ( and and AllEtronic ( 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! 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….

Different Fields, Same Concepts

It’s finals week and I have a final on Monday morning that I haven’t started to study for yet. I’m trying to, but I’m having trouble motivating myself. Thus, a blog entry.

One thing I learned for sure this semester – what I DON’T want to continue pursuing. I DON’T want to pursue circuit design – analog, digital, RF, microwave, whatever. Stuff drives me nuts. You’d think after 4 courses in circuits I’d have some intuitive grasp on basic electronics. Key word: intuitive. I don’t.

Anyways, one important concept that I didn’t understand until ECE315 is the notion of a bias point (or Q-point, DC operating point, etc). I couldn’t understand that with a proper biasing point, a circuit becomes approximately linear, and that means it can be modeled with a “small signal model.” This makes me wonder how I even passed ECE210, considering how much small signal analysis is done in that class. But the point is, biasing is critical to the prosperity and functionality of circuits in just about every electronic device.

The final lab in my circuits course this semester was to design an Op Amp. I had a topology already (telescopic, double cascode, if you so care), but I couldn’t bias the darn thing. It drove me NUTS. I could only look forward to the fact that after this semester, I wouldn’t have to deal with circuits and biasing ever again.

My non-ECE class this semester is CS470, Foundations of Artificial Intelligence. The homeworks are challenging, but in a way that really engages me into thinking (unlike circuits homework – I just hate it). So one of the most recent topics was Neural Networks. Neural networks are pretty cool – basic idea is to try to come up with systems that function more like the brain. During lecture I was kind of half paying attention/half asleep like I always am. The overhead has a basic diagram: a circle (a neural node) with a bunch of lines going into it (inputs, labeled with weights), and an output. For a threshold actived function, output is 1 or 0, depending on the weighted sum of the inputs. Sure, easy enough to understand. The professor starts talking about one specific input because it’s always fixed. Then all of a sudden I hear the word “bias.” My first reaction: “OH NOOOOO. WHY?? WHY can’t I get away from circuits??” Fortunately it was easier to understand (basically the fixed input and bias weight define the threshold for which the output is 1 or 0) but the idea was the same: without the proper bias weight, the neural node won’t function as desired.

It’s kind of interesting, now that I think about it. I’m sure this concept of biasing arises in some form or another in many other fields. It’s like feedback. Every field has feedback. Feedback in analog circuits and op amps (YUCK), feedback in signal processing, mechanical control systems – heck, even in a microsoft power point presentation you’ll see feedback in at least one of the flow charts.

So yeah…it’s intriguiing how everything works using the same basic principles. It’s no wonder why fields are converging and everything is becoming more related, the world is flat, blah blah blah. Okay I’m over simplifying a bit.

Sorry. This was a dumb nerdy post.

The Origin of "Nerd"

So I learned this in a class that I eventually dropped. In the middle of lecture he wanted to take a break so he started talking about where the word “nerd” came from.

Basically, back in the day, the people who would go out and party and drink on Friday nights and/or weekends would notice that other students would stay in and study – they were doing the opposite of everyone else. So, they started referring to those studious students as “knurd”, which is “drunk” spelled backwards. Pretty interesting, huh? I guess I am a nerd, and happy to be one too.

During the break of the lecture the professor also asked if anyone had a good joke to tell. He looked around for like 10 seconds and no one said anything. Then he picked on a couple random people and said, “Come on, do you have a good joke?” Both times each person said, “Uh yeah, no I don’t.” Finally, the professor says, “Oh my gosh. You guys are all nerds.”

Keep in mind, this is coming from the professor who is an Indian guy with glasses and a slight accent, and who is teaching a course titled “Microwave Theory, Devices, and Applications.”