Buying a cat with logic switches

Blog — Dillon @ 1:43 pm

Charles Petzold’s book Code is an awesome read. I’m reading it again actually. It’s so elegant and simple. Walks you through history and experiments in a style I find extremely invoking. I wanted to build a logic switch but I don’t want to blow anything up so I tried this java applet at falstad.com and it works pretty well. I tried qucs but it’s way too complicate for me and doesn’t include an LED.

An example from Code (this is not the exact example) is where he’s trying to buy a pet from a pet store and he creates a logic circuit that will light up a light bulb when the pet is correct. Let’s say I’m looking for a normal gray cat as a house pet (not a tiger! rawr!). When I flip all the switches correctly, the LED lights up but if I get a gray tiger (that’s technically a cat) then the LED (the red dot) says nope.

The salesman brings me a gray tiger. Nope.
logic_gray_tiger

The salesman brings me a gray cat that’s not a tiger. Yep.
logic_gray_cat

Arduino Sessions

Arduino — Dillon @ 12:14 pm

seven_segment_ledHacking around with sparkfun shipments and components. I got a starter set with a box. Included a 7 segment led. Got it to display the number 4. Moved on to a capcitor test. Arduino playground has a read/discharge example. It reads how many milliseconds it takes to charge/discharge. I got it working but don’t understand it still. I did a potentiometer test. A basic rocker switch test. Resistors in serial, resistors in parallel. I made a push switch toggle on/off led light with a transistor (I think). Transistor testing (those things are weird). Just kinda went through the box and saw what did what. I want to understand multiplexing and make a 2 digit or more 7-segment LED display work. I have a bunch of wire and things to make it work now. I need a resistor kit, sparkfun was sold out recently but now they have them. It’s a kit of every resistor you can think of.

wingshield
I also put together a wingshield kit. I makes connecting wires to the arduino a little more stable because you can screw them into the screw terminals. I seriously screwed up at one point, snipping off the header pins when you aren’t supposed to snip them, doh (what will plug in to the headers if you snip the pins?). I had to desolder and use parts from another kit. Amazingly the desoldering went better (although it takes a long time) and the shield seems to work.

Sparkfun Onslaught

Arduino — Dillon @ 10:42 pm

simon_sparkfun
Sparkfun had their free day today. I tried to nab some stuff but their servers were too busy and I couldn’t sit there and refresh all day (what am I idle rich?). I just happened to have an order placed the week before and it all came in today.

WRL-08664 XBee 1mW Chip Antenna
DEV-09063 Arduino XBee Shield Empty
KIT-09285 Beginner Parts Kit
DEV-09282 ScrewShield
DEV-00666 Arduino USB Board
LCD-00258 Serial Enabled LCD Backpack
TOL-09465 Tool Kit - Beginner
TOL-09317 Third Hand
KIT-09343 Simon Game - Through-Hole Soldering Kit
TOL-00298 Wall Adapter Power Supply - 9VDC 650mA
SEN-08958 Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F
SEN-08733 Infrared Sensor Jumper Wire - 3-Pin JST

Chief amongst the loot was a soldering iron and a simon game kit. Really, I could care less if the thing worked. I wanted to learn soldering. I seriously have never done it before. I couldn’t believe my eyes when the damn thing lit up and worked! I thought for sure my scorch marks had screwed something up. When I was soldering the legs on the mega-168 processor the thing got warm. I was working kind of fast and nervous. I guess I didn’t burn anything too bad. Many of my connections look like shiz and I have pointy parts all over the place. I was really trying to peer and study how the solder was making the connections. I’d shake and bend the pins to see how much strength it had and so on. I was really surprised at out unintuitive the whole process is. You’d think it’d be harder but after doing the same pins over and over you start to see what a good solder bead looks like. I just followed the instructions (some of which were a bit off because of a newer board rev) and it wasn’t too hard when I took my time and read ahead making sure I wasn’t doing something stupid.

helping_handsCrazy pants! I can’t believe it worked! The cheapy soldering iron and solder they sent with a starter kit worked really well. I just held the solder inside the plastic tube it came in. I thought that the cheapy iron would be crappy but it worked well. I got some helping hands to help. They helped. :D What was also helpful was having a workbench, damp sponge, helping hands and some youtube videos for instruction. It’s just not as hard as I thought it was. Now SMD soldering, I have no idea how people do that.

So really I was expecting the kit to be a learning experience and I’d throw it away. But somehow, despite the weird and PCB-stress-inducing battery clips, the Simon game worked. When it lit up and I played a little game of simon, I was really surprised. Kristin has it on the coffee table and she plays it a lot. I don’t think she ever played it in the 80s, weird. I tweeted about my success and the freaking official Sparkfun twitter account saw my #sparkfun tag and congratulated me. Awesome!

After a holiday break, a sudden rush of software-type-hacky-motivation came to me. I grabbed my arduino and laptop and checked it out. First, it didn’t work. The laptop is new and I had to set up the dev-env again. Apparently the default now is the ATmega328 and my Arduino is based on the ATmega168. After that was settled, I had a led blinking again.

So I had this Hitachi based LCD panel that I had never done anything with. I got it powered (3.3v) and was trying to figure out how to run the thing. I read and read and found that I didn’t have the right crap on hand. First, it seems like there’s two ways to drive it. You can drive it “manually” with a bunch of parallel type wires or you can buy a serial backpack and solder it on (I think). I tried getting things working parallel but it turned out to be a little more than I was comfortable with. I don’t understand multiplexing yet and I actually didn’t have enough hook up wires to get it done. So part of the order you see up top is a serial backpack. Well somehow I managed to get it wired up but it’d short out my Arduino board, I was just using the board for power. My LED would fade away, it seems to do that when I short something out. Thinking that this was a power problem, I plugged in the 9v adapter with the usb (5v). Well then I started smelling a plastic smell. I heard a crackle and then I saw a little bubble appear on the backpack chip. Ow. I threw it away and I don’t have a picture of it. All it reminded me off is when Tim and I burned up a southbridge on my old AMD computer. Smells like fail.

So I just played around with the broken backpack. I desoldered some of the headers off for practice. Desoldering is hard, I burned up the PCB pretty bad but it was a good learning experience. Then threw it away. I ordered a proper serial LCD from sparkfun. I recently got that working electrically although the code side of it I need to clean up a little bit and grok it some more.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2012 SQUARISM | powered by WordPress with Barecity