Tuesday, December 6, 2011

CC2500 Project (Part 3)

Here's an even smaller update!

Since the MSP430G2452 doesn't have a hardware UART, it's not very useful in communicating with the computer. I could use the bit-banging method to get 2400baud, but I didn't feel like figuring it out.

For my thesis, I implemented a serial-to-radio repeater using the EZ430-RF2500 and a USB-to-serial converter. I was able to modify the code to get it working. It ends up being a 19200baud link. For some reason, I can't get the processor to run at 16MHz without it giving me problems. Since I don't wan't to figure those out now, I'm running it at 1MHz, which prevents me from doing the usual 115200baud. (Not that I really need that speed.)

I then wrote a quick processing sketch to capture audio and send RGB values out the serial port to the microcontroller.

In short, I can now sync the lights to the music wirelessly!

Here's a quick video demo (As you can probably tell, I'm really happy it worked!):


Sunday, December 4, 2011

CC2500 Project (Part 2)

Here is a quick update on the project's progress.

Today I was able to get the radio libraries working better and actually set up constant radio communications across a room. I also wrote an RGB led controller using PWM and combined them together.

Here's a brief video of the result:


So far it's just one microcontroller generating RGB values and sending them to another one. Now I need to work on getting the PC to talk to the first microcontroller so I can control the lights with my computer.

Here's a demo of what I want it to do later. I have it working in the video, but it's fully wired and uses an ARM Mbed for control.

Saturday, December 3, 2011

CC2500 Project (Part 1)

So I've started working on another project... This one includes microcontrollers and radios. The "goal" of the project is to have a very cheap 2.4GHz radio module and libraries to use it. I used the CC2500 radio module for my thesis project, but it was part of the EZ430-RF2500 development kit. The kit itself is nice, but at $20/device, it's not the cheapest.

My first though was to build my own board. I decided against it for several reasons. The first being that the CC2500 only comes in QFN packaging, which would make it a pain to hand solder. The second is that I have no experience designing RF circuits, which would probably result in the thing not working. The last reason is that I found a better alternative.

Turns out that the CC2500 is also used in some PS2 Guitar Hero controllers. They have the CC2500 chip on board and all the passive components (plus antenna!) I figured that would be much easier to work with. It has an SPI interface, so it can talk to most microcontrollers. The best part is that the whole thing costs less than a single CC2500 chip! I was able to get the whole thing for $1.80. (If you buy more than 1000, it only costs $1.35!) The only caveat is that the module has to be purchased from the manufacturer in China, which, at small quantities, makes the shipping a bit expensive.

CC2500 module with breakout board.
Since the header for the board has 0.05'' separation, I had to make a breakout board for testing. I decided to test the radios with an MSP430G2452 microcontroller. I chose that one because is has hardware SPI and is available in 20-DIP package. The hardware SPI is really useful when interfacing to the radio at higher speeds (instead of bit-banging) and the DIP package makes it easy to work with (and fits into the launchpad).

MSP430G2452 in Launchpad with radio.
I started writing my own radio libraries. TI provides a network stack called SimpliciTI, but it's bloated and I don't like it. For my thesis project, I wrote my own lightweight radio library, but it's all set up to work under linux and msp430-gcc. Since I want everyone to be able to use it, I'm porting it to work under TI's Code Composer Studio and putting it on github. So far I only have TI's demo code from slau144h working, but it confirms that all my wiring is ok and the radios work. Since I only have one launchpad, I replicated it on a breadboard. The code just sends a message when a button is pushed and toggles an LED when a message is received.

Breadboard with second radio and MSP430.
The next step will be to get my radio libraries working and well documented...

Tuesday, November 29, 2011

West Texas Thanksgiving

So I had a few days off work for thanksgiving... Most people usually visit their family during that time, but due to a late change of plans, I ended up doing something else.

I found out that about 600 miles west of Houston is a town called Fort Davis, Texas. Near this town is the Davis Mountains State Park and the McDonald Observatory. Since I hadn't seen a clear night sky since I was a kid, I decided to drive over and check it out. (It's one of the places with the least light pollution in the area.)

Being the time-lapse nerd that I am, I decided to experiment with my camera and newly acquired suction-cup camera mount.  The first experiment consisted of mounting the camera in the rear window and taking pictures every minute during the drive there.

NOTE: Watch the time-lapses in HD and full screen if possible, it really does make a difference, especially for the night ones.
Also, for more photos from the trip, check out my flickr set.

Rear window mount.
Unfortunately it didn't turn out so great...



My second experiment took place later that night near someone's ranch. I'm not sure if I was supposed to be there or not, but no one kicked me out (or saw me...) I found a radio telescope and did a very brief time-lapse of it with the stars in the background. I should have stayed longer, but I was tired from the drive and maybe a bit worried about being noticed.

Radio telescope.
The video is extremely short, but I thought it came out alright.


Since I went there to look at the night sky, I had to find stuff to do during the day. And by stuff I mean mounting the DSLR on the hood of my car and driving around while making more time-lapse videos. I used the same suction cup mount I mentioned previously. It held just fine while driving at speeds of 75+ mph! The actual device was purchased from filmtools.com. It worked great!

Camera on car hood. Talk about trust!
The first one happened during a drive from Marfa to Fort Davis.


Another one was from Fort Davis to Alpine.


There were other driving time-lapses, which you can see in my youtube channel.

The last was a more traditional time-lapse. I was driving and saw a nice field as the sun was setting. I set up my tripod and started taking photos.

I can't seem to stay away from those "no trespassing" signs!

Unfortunately I was on the side of the road, which produced some "interesting" effects due to car headlights... I tried moving the camera near the end to just point at the sky, but it's an ugly transition. Notice that Venus and the Moon are setting close to each other following the sunset. Again, for best results, watch the HD video in full screen!

Monday, November 21, 2011

Time-Lapse Experiments

I recently started experimenting some more with time-lapse videos while moving. I bought a suction cup mount for my DSLR and tested it out in my car.
Testing mount on my window!
Here's a very rough test of the car setup. I just wanted to see if the mount stuck to the window and didn't fall with the rough Houston roads. 


I also tested it on a quick flight around the area. Since it was a bit gusty, the video shakes a lot. I tried out youtube's built-in stabilization feature and it seemed to do a good job!


You can see the original, much shakier one, here:

Friday, April 8, 2011

New Toys – Project Updates

I have been working on a few projects recently. Two of them involve having custom PCBs made. I'm currently waiting for them to arrive. In order to prototype and test the circuits, I had to order a bunch of parts, so I took advantage of the buying spree to get myself some better tools.
My favourite so far is my new Agilent U1251A Multimeter. After seeing the great review of the U1253A (which is just the OLED display version of this one, instead of LCD) on the EEVBlog, I found one for a decent price and decided to get it.

Agilent U1251A

Another purchase was a vaccum base vice that can hold small-ish circuit boards. Since I'm going to be doing some surface mount soldering for my intervalometer project, I wanted to make sure I had something better than my helping hands to hold the boards.
New Vice

I plan on doing full write ups of both of these projects once I finish, but here are a few details.
The first one is an intervalometer for my Canon camera which will use an Attiny13 microcontroller and a small CR2032 battery. It will have a configurable time interval and is only 1x1 inches.

Intervalometer PCB
The second one is a simple breakout board for my MBED microcontroller. I plan on using a few of these to permanently attach sets of sensors and other peripherals, while still being able to swap the main MBED board around. It's not the most exiting PCB, but I'm trying out different services to see which one I like better. I ordered the intervalometer board through BatchPCB and the mbed one from DorkbotPDX. I will also do a write-up about those when I get them.

Mbed Breakout PCB
One of my projects requires multiple temperature sensors. I ordered a bunch and tested one earlier. I cut up some phone wires and connected it there so I could put it out the window without exposing the whole board. It seems to be within 1 degree of the actual temperature, which is more than enough for what I'll need.

MCP9701 Thermistor

Tuesday, April 5, 2011

Hip MRI!

A few months ago, I found out that my school offers a diving class. I enrolled and was having fun for a few weeks until I messed up an entry off the 3m board and hurt myself. I didn't notice initially, but the next day my hip was hurting a lot.

I went to the doctor, got some x-rays, and began physical therapy. There was no bone damage, so they figured it would sort itself out with the therapy.

After a few months, some of the pain went away, but some still remains. (The injury happened in January!) The doctor recommended that I get an MRI Arthrogram. It's like any other MRI, except they put a contrast solution so they can see the soft tissue better (or something like that.) The catch is that they have to inject this contrast solution, with a huge needle.

I asked the imaging people (who were all really nice!) if I could have the images, so I'll use them here to explain. Here's a quick video someone else made about the contrast placement.


Now here is how mine went:

As usual the first step deals with your clothes. They only let you keep your socks on, along with those stylish hospital gowns. I then lay on a bed with a cool portable x-ray machine above. The first take an x-ray to make sure everything is aligned.
This is the first X-Ray.

A few minutes after they tied down my foot so the leg position wouldn't change, the doctor arrived. They applied some of that yellow antiseptic stuff and let it dry and proceeded to stick me with a smaller needle to apply the anesthetic. It didn't really hurt much, I was expecting a burning sensation for a minute or so, but it was really quick. Now that my hip was all drugged up, they brought out the big one.

You can see the size of the needle here.


That needle needs to be long enough to reach the hip joint and wide enough to let the fluid through in a timely fashion. This step didn't quite hurt, but it sure felt strange. I could feel that they were pressing down, but couldn't quite pinpoint the source of discomfort. Once they started injecting the solution, I could feel it filling up.

Here's another X-Ray with the colors inverted.

The injecting part was really quick. I think they said it was only about 12cc's of solution. They then removed the needle and cleaned me up. After that was done, I went over to the MRI machine and spent ~45 minutes laying motionless. I kept drifting in and out of sleep, which is quite fun. Waking up inside an MRI machine working is quite something.

One of many slices from the MRI.

After that was done, I got my CD with all the images and headed home. The whole experience was not bad at all. I was slightly worried after reading other peoples reactions, but fortunately they did not apply.

Sunday, March 27, 2011

Slow Motion Roller Derby

I recently purchased a Casio EX-FH100 digital camera. Unlike most other point-and-shoots, this one can do high-speed video. It ranges from regular 720p HD video at 30fps to high-speed 120 fps(640 x 480), 240fps (448 x 336), 420fps (224 x 168), 1000fps (224 x 64). The resolution on the fastest two is pretty bad, but it's still fun to mess around with.

After testing the camera on myself jumping around (pretty lame), I decided to try it out at the ROC City Roller Derby bout at RIT. Here are some high-speed clips:

NOTE: I have over 100 of these, if you want to have them and use them, let me know! I don't have the skill or time to make a decent video using several of the clips.
For some reason, YouTube will only embed videos at 360p. Make sure you click on 480p to improve the quality. Enjoy!

This first video shows when Lethal Lorelei fell, injuring her ankle. (120fps)


Goldie Fox whips Hy DeMonic forward.(120fps)


Asa Clubs falls and calls off the jam after tripping.(120fps)


Gwar slips (240fps).


Toxin Dioxin and Thea Pocalypse race ahead. (120fps)


Toxin Dioxin is hit by Goldie Fox and calls off the jam.


Jammers off the start line. (120fps)


No skating in this one... Throwing t-shirts at the crowd. (120fps)


This last one is a mix of 30fps and 120fps. The girls did an extra jam after the bout finished, but this time with Thea Pocalypse wearing a camera on her helmet.


Please correct me if I screwed up anyone's name!

I also took some photos during the event, but since I was recording with the little camera, I didn't get too many. You can see them here: http://www.flickr.com/photos/apg88/sets/72157626237482515/

Sunday, March 20, 2011

Projects Update

I’ve decided to actually write about what I’ve been up to in the past few years. Today, I’m going to start with a project from the summer of 2006. I decided to go to DEFCON and take part in the defconbots competition. The main goal of the competition was to build a device that shot targets using autonomous control only. You can see the competition page here and the results. Unfortunately, I didn’t start working on it until two or three weeks before.
Here’s a brief description of how it happened. Since I was right out of high school, my budget was extremely limited. I decided to get a webcam mount with two servos and a USB servo controller, along with a really cheap BB gun.

One of three BB guns.
USB Servo Controller
After receiving the gun, I took it apart to figure out how it worked. It was basically a DC motor with some gears pulling back a spring that loaded, then fired, the BBs

Firing Mechanism
The Guts
Instead of buying a webcam, I took one from my dad and (after some modifications) mounted it in front of the gun.

Cannibalized Webcam
Gun with Mount and Webcam
At the time, my knowledge of programming was limited to PHP and VisualBasic. I figured out how to talk to the webcam and servo controller using VB and proceeded to write my aiming program. I had no idea about any image processing algorithms or anything like that, so I had to make it very simple. The targets were lit by infrared LED’s, and by using a filter in front of the webcam, I was able to isolate IR light from everything else. My high tech filter consisted of some developed film. After going through the filter, infrared light showed up as white pixels, while everything else was red or black. This allowed me to “find” IR light by counting white pixels in the image. I divided the image into a grid and counted how many white pixels were in each section. After figuring out which square had the most white pixels, I would move the gun in that direction. Once the most white pixels were in the center of the image, the gun would fire until the lights disappeared.

Fancy IR Filter and Laptop with Aiming Program
I tried a few different methods for firing the gun, but ended up going with the simplest. I connected another servo and glued a temporary switch to it. All I needed to do to fire was move that servo so it would push the button and close the circuit driving the DC motor in the gun.

Firing Servo
The gun was not designed to hold too many BBs, so I added a parmesan cheese container to hold more. After everything (almost) worked, I packed it in a box and flew to Vegas. The TSA people were rather intrigued when they searched my luggage, but let me through after a few minutes.
The actual competition was a lot of fun. I came in 5th place (out of 6), but had a lot of fun doing it. Some of the competition consisted of university senior design projects with awesome equipment, so I really had no chance. Here are some photos from the competition. These last two photos were not taken by me. I can’t find who took the second one, so if it’s you, let me know so I can give appropriate credit!

During Competition 1
During Competition 2
Oh, I also added an “about me” page over here.