Wednesday, May 25, 2011

Macro Photography

I'm working on a reverse lens macro photography setup. My initial trials are done with a Canon EOS Rebel.

The plus side to film is the nostalgia. The down sides are everything else.

Anyway, I have the lens reversed and mounted at the end of a long cardboard tube (poster tube I essentially cut in half). I have a remote trigger and a tripod and a Ikea lamp that is focused by a magnifying glass so that it delivers a pinpoint of light to the object I am taking a picture of. The focusing is done by sticking a compass in a book and using the fine tuning wheel to raise and lower the book cover.

I'll spare you the details until I have my more finalize setup, which hopefully actually happens (I need a DSLR...).

Sugar vs. Splenda vs. Salt


Magazine Cover


Xacto blade

Saturday, February 19, 2011

Picking and Choosing Your Coeffecients: Playing with the DCT of an Image

Where have I been?
Junior year is a ton of work. I've been extremely busy.

What is the post about? (Super simple version)
Sometimes I want to make a salad.



For my definition of "salad" I have a set of ingredients with which I can make ANY salad I like, ingredients like lettuce, tomatoes, cucumbers...etc.

A recipe for any given salad is essentially a 'linear combination' of those ingredients, for example, 1 tomato, 2 heads lettuce, 4 drops vinegar, 1 lemon. I am scaling and adding things from my dictionary of salad ingredients to make my particular salad.

I may want to play with that list, deleting terms, scaling terms differently, or who knows what. I might just want to demonstrate to you how the salad begins to look more like the salad we want to have as we add more and more of the ingredients in.

I can do this with anything. Here, I do it with images, and I represent them as a linear combination of 'checkerboards.' For example, for one case, we have 64 different checkerboards, which look like this:



I could prepare any image if I had all of these 'checkerboard' ingredients. I could convince you that it was the same image even if I only had a few of those checkerboards available (specifically, imagine I ran out of the ones towards the bottom right...I really don't need them). That's the theory behind lossy image compression.

What is the post about? (Less simple version)
I'm taking the 2 dimensional DCT of 16x16 blocks of this image of a bunny rabbit, then picking and choosing which coefficients to keep before computing the inverse and reconstructing the image. Since M,N=16 so there are 256 basis images.

Some pdfs for your reading pleasure:
-"Lab 6: the Discrete Cosine Transform"
-JPEG Tutorial
-Image Compression and the Discrete Cosine Transform

Results
Original Image:


DC Coefficient only
(the very first term, which is just the average value of the image part)


AC Coefficients only (everything else but the DC Coefficient)


Line Coefficients only (no 'checkerboards' -- 'stripe' coefficients only )


First Four 'Lowest Frequency' Coefficients
(the first 2x2 coefficients from top left)


No Horizontal Stripes


No Vertical Stripes



I'll Do it Later
1. To take the DCT of the whole image (not just a block at a time).
2. To make a animation showing the terms added in a sequential zig-zag, showing the reconstruction of the image from all basis vectors.

Time to start my homework.
-Shira

Saturday, October 9, 2010

Three Step Rainbow Cake



Ingredients:
  • Ready-made cake mix in a box, like the ubiquitous Betty Crocker kind.
  • Food coloring.
  • Water or milk.
Step one: Mix some water or milk with some powder. Aim for a thick batter consistency.

Step two: Add food coloring. For layers, just parcel out the batter into small bowls, mix several drops of color to each bowl, and then just layer them in your microwave-safe cake-preparation container. If the batter is thick enough the layers will stay neatly separated.

Step three: Microwave. Time: usually at least a few minutes. Check by inserting knife; the cake is done when the knife comes out clean.

Hints: Cake rises. Use a larger dish than I did. There is a glass dish hidden inside this cake.



Pretty pretty colors. Of course now my hands are stained again. If it isn't oil paints then it is hair dye; if it isn't hair dye then it is food coloring.



Flourishes: add pieces of apple to the batter, or banana slices, or chocolate. Serve with a cold glass of milk.

Inspired by the rainbow-cake endeavors of my friend Dani. Her blog is here: http://lovingsweets.wordpress.com/

Thursday, September 30, 2010

Hair Dye

At the end of this summer I decided to dye a section of my hair some bright color. To this end I bought some Manic Panic in "Shocking Blue" and "Atomic Turquoise." I initially had it done at the salon along with my haircut.



Later, while traveling in Japan, I saw a brown duck with a blue feather that reminded me of my new hair. Google seems to say that it is a female wood duck. Here's an image of a similar (though not exactly the same type) duck.


I like the idea that the design used for my hair can be found in nature.

The hair dye is semi-temporary so I have done two subsequent re-dyes by myself and with the help of my friends. Both the bleach and dye processes are really easy to do yourself; you can find instructions on the back of the box or online.

Here's a picture of my most recent hair. I did part in Manic Panic "Purple Haze" and part in "Shocking Blue" again.




As a last note, here's a link to a pdf I found that goes over the chemistry of bleaching hair in detail: journal.scconline.org/pdf/cc1970/cc021n13/p00875-p00900.pdf

Tuesday, August 3, 2010

Painting Still Not Finished

This painting is starting to drive me crazy. Still, I promise I will finish it. Otherwise I'll never get that floorspace back in my workshop...



Work will have to stop for a while (vacation, school starting) after this week.

Thursday, July 1, 2010

Summer Update

A pretty empty update for now...most of my projects are crawling along as a lot of my time is sucked up by my writing class, my summer research, my efforts to learn Japanese before my trip to Japan in August, and my terrible afternoon-nap-habit (I blame the heat...it makes me drowsier than usual).

One thing I did start doing again this week is cooking (after weeks of eating out or eating PB&J sandwiches). Earlier this week I made pasta primavera (with fried red & yellow bell peppers, fried yellow & green squash, and red, yellow, and orange tomatoes to garnish it) and also tomato-cilantro soup (tomato-basil recipe with a substitution). I like cooking, so next week I am going to try my hand at a chicken-liver paté.

I've also been decorating and cleaning my new place. Allen left his plants with me so I could babysit them over the summer, and I don't really want to give them back, though I do want to put them in nicer planters. This is a glass of green tea with fresh mint from my garden.



The coaster is a mosaic I made at the Getty Villa. I couldn't pass up a chance to do some arts & crafts, even though everybody else at the table was under the age of 12. If you can't tell, I tried to depict a stylized skull, since I had just seen the Aztec Pantheon exhibit. It's an exhibit worth seeing unless you have already visited/plan to visit the Museo Nacional de Antropología in Mexico City (that's where all the pieces came from). If you're into blood and gore then you can get a kick of of the sacrificial stone, sacrificial knives, and sacrificial stone eagle with a hole in the back for burning the hearts of the sacrifices.



After mosaic-ing I remembered my plan to make a large mosaic to cover a portion of the wall of my parents' courtyard. I scouted out a tile store and will be preparing some photoshop mockups in the coming months.

I mistakenly bought some plaster of paris before realizing that mosaics require a different sort of adhesive and also grout. Since I don't feel like returning it Asher will most likely be enjoying a homemade birthday piñata (inflated balloons are coated in plaster of paris to make the body of the piñata) and eventually I will have to try my hand at sculpture.

Coming soon:
  • My FM transmitter works, but is waiting on me to order a 7 segment display and level-shifters so I can run it off the car's outlet.
  • When I get a camera I can show off my newly decorated home
  • I got hit by the LED art bug again and am designing tiny lamps (but so far I've been coming up with the wrong pairings of batteries/bulbs and nothing lasts as long as it ought to)
  • When school starts up again and I can gain access to the School of Architecture's laser cutter, I will attempt to learn some basic AutoCad so I can make the Settlers of Catan plywood board

Finally here is another shot of the painting, coming along very slowly.

Tuesday, June 15, 2010

Painting's Progress

First, I gridded the 36 " x 48 " canvas into 0.9" squares...



I paint in sessions of about 2-4 hours each. As awesome as my workshop is, it is not an art studio and I am have to paint on the floor (not to comfortable). Here is the painting right at the beginning:



Here is the painting as of last week:



Here is the painting as of today. I've probably spent at least twenty hours so far on it. I don't want to even think about how long it might take me to cover the whole canvas. I just hope I get it done before school starts again.

Friday, June 11, 2010

Space Invaders Hard Candy


I recently stopped by the Popkiller store and picked up this Space Invaders ice cube tray for $9.00. I made some ice cubes but they weren't all that impressive because they melted in my glass before I had a chance to really appreciate them. Since the tray is made of food grade silicone and is rated for -58 to 446 degrees Farenheit (-14 to 230 degrees Celsius), I decided to use it to make something more permanent.



I went with hard candy first. I used this recipe.

Ingredients

  • 1 cup sugar
  • 1/3 cup corn syrup
  • 1/2 cup water
  • 1/4 teaspoon cream of tartar
  • between 1/4 and 1 teaspoon flavoring
  • liquid food coloring
  • 1 to 2 teaspoons citric acid (optional, adds tartness)
I bought some citric acid in the form of "Fresh Fruit" fruit preserver, which is actually asorbic acid and citric acid and some dextrose to boot. For certain recipes this substitution may not be a good idea, but for this one it seemed to have worked just fine.



First I boiled some water to test my candy thermometer. I had just bought it and it only cost $2, so I wanted to check the accuracy. It showed about 5-10 degrees less than 100 degrees Celsius when the water first started boiling.

The recipe is pretty simple. You mix the sugar, corn syrup, water, and cream of tartar in a saucepan. I don't have any nonstick pans so I spread some vegetable oil all over my saucepan (this worked out fine). When the candy thermometer showed ~300 degrees Farenheit ('hard cracked' temperature) I turned off the heat. At 275 degrees I added ~6 drops red food coloring and 1/2 teaspoon imitation strawberry flavor. Then I immediately poured it into the mold. I thought it would cool down very fast so I rushed and did a messy job. What was in the saucepan actually cooled down pretty slowly.



I thought it might help to use this cast iron pan as a heatsink.

I laid them out on a piece of waxpaper in the obligatory arrangement. I think the shapes aren't quite true to the original arcade version but that is probably something the company did to avoid copyright issues.



I wanted some better photos (or zoomed in photos) to show how sharp the outlines of the invaders came out, but my camera stopped working...

Taste: they taste just like generic strawberry hard candy. They remind me of the kind that used to come wrapped in a wrapper that was supposed to resemble a strawberry. They are pretty sweet and not sour.

In the future I plan to try green/mint, orange/orange, clear/coconut, and yellow/banana space invader candy.

I also bought some baking chocolate to make chocolate space invaders.

Other future plans: Allen put it into my head to make a carbonite Han Solo chocolate. I'm not aware of any commercially available molds, and I don't want to buy a toy to use in mold-making, so I think I might find a friend with CAD skills (or learn myself) and go from there.

For practicing my CAD skills I might make some Tetris trays. I saw that on instructables and it seemed pretty cool for ice cubes (no small details that will quickly melt away).

Sunday, May 23, 2010

Fun with 555s

The 555 timer IC is an incredibly useful & popular chip. If you're not already familiar, there are plenty of useful sites on the internet that will explain it in detail. I like this site best: www.doctronics.co.uk/555.htm.

The 555 is great for a lot of simple projects, usually involving functions like generating a tone, generating a timed delay, generating a timed pulse, and so on. In this post I'll go over two that I really like.

1. The Steady Hand or Buzz Wire game
The Steady Hand/Buzz Wire game involves leading a wire loop through a wire maze without touching the two together.

The wire maze and wire loop will act as two contacts of a switch. You'll want to build a 555 astable circuit. On the Doctronics page I linked above, look at the "minimum component astable" circuit. Instead of the LED and 680 ohm resistor, plug in a speaker or piezo transducer (polarity isn't important with these). Then calculate the R1 and C values using the provided equation, aiming for a tone you can hear (440 Hz for example). When you fail the game and touch the wires, the switch closes the circuit (you could place it in line with +V for example) and the buzzer sounds.

2. Return Key to Hook Alarm
Somebody on my robotics team has a bad habit of forgetting to return the conference room key to its place. He puts it in his pocket and leaves for the weekend, and nobody can get in the conference room and the entire listserve gets a series of angry emails. So I brainstormed this: an alarm that goes off if some time has passed and you have not returned the key to the hook. The circuit must achieve the following when the key is removed from the hook: first, it must wait for a certain interval of time, and then it must sound the alarm (buzz).

A reed switch is a switch that turns on or off in the presence of a magnetic field. I mount a strong magnet on the key hook, so I want a reed switch that will be "normally closed," in other words, OFF in the presence of the magnetic field. Two 555 timers (both included on a 556 chip) take care of the rest.

This page http://clarkson-uk.com/555-timer/operation/frames3.html shows you how to construct the first part of the circuit: a timed delay. When the reed switch is ON (key is off the hook!) the delay begins and lasts for the calculated interval (depends on the value of the resistor and capacitor you choose). For the duration of the interval the output pin is LOW, but as soon as it is over, it goes HIGH until the circuit is powered off (key is returned to the hook).

We use the output of that first 555 to control the RESET pin of the second 555. When the RESET is LOW the output of the 555 is always LOW. Only when the RESET goes HIGH is the 555 allowed to function normally.

So, again referencing the Doctronics "minimum component astable" circuit: replace the LED & 680 ohm resistor with a speaker/piezo transducer, and calculate the R1 and C values appropriately (ie something in the range of human hearing!).

Here is a photo of (left to right): a magnet, the Key Alarm device, and some keys.



In the future, if I ever want to actually use this, I might get a nice PCB fabricated and use surface-mounted parts and a smaller enclosure. This one is just a prototype obviously, haphazardly put together and stuffed into this box that some ICs were shipped in.

Friday, April 23, 2010

FM Transmitter - in Stereo!

A long time back I built a super-simple FM transmitter that worked off 1.5 volts. I used this schematic which you can find all over the internet (this image is from a pdf of a book called "101 Spy Gadgets for the Evil Genius"). It worked well and was easy to build.



Understanding nothing about how it worked, I attempted to plug in my iPod in place of the microphone. While I could recognize the received signal as definitely the same one I was sending, it was very strongly garbled. The iPod transmits a signal with some power, and it was enough so that when I unplugged the AA battery the thing still transmitted. This probably screwed up its operation a bit.

A few weeks ago my EE200 (Intro to Signal Processing) professor mentioned that we could do an extra credit project. The project could be just about anything so long as he approved it. I immediately decided to return to the FM Transmitter project. I quickly found this page that describes how to build one without using a special IC designed for stereo FM transmission. It is relatively simple to build and the page describes how it works in detail.




Here is a photo of it assembled on a breadboard. I tested it by listening to the output through my roommate's portable radio. Once I got everything right (see the below listed quirks) the sound was of very nice quality! It is powered from the wall via an adjustable breadboard power supply from LadyAda of Adafruit Industries.

Quirks:
  • There's a lot of background noise. The website makes a few suggestions about how to improve it, some of which I may try in the future. Then again, I don't think it will be so noticeable when listening to it through my ancient and terrible car radio.
  • Every so often, when I touch something (even the iPod's metal case!) I hear I high-pitched, very clear tone. No clue what causes that. It isn't consistently replicable...
  • Finicky tuning. The signal is only really clear if you tune it just right. If you don't you can hear the signal but it starts to get badly distorted and very noisy.
  • Clarity of signal is best if the iPod is set to about 1/4 volume and the radio is adjusted to liking. I got weird distortion above that.

After this project has been presented I plan to pack it all onto a piece of Veroboard and into a nice enclosure. I will make it either battery powered or car-outlet powered with the addition of a 5v limiter. I will fix the tuning issues (touching the inductor/variable capacitor or getting anywhere near them changes the frequency to which the transmitter is tuned, which means I will have to isolate these parts while still having some mechanism for turning them in place).

While buying a transmitter is cheaper and probably results in better sound quality, it just isn't as cool as building one myself. I'm so excited about this project that for the last hour or so I've been listening to my iPod through the radio even though I could technically play all my music directly from my laptop.