Fall 2004

  • Phys Comp

Fall 2005

  • Advanced Tech
  • The Creative Act
  • Video for New Media

Spring 2005

  • Conceptual Design
  • Networked Objects
  • Video Art

Spring 2006

  • User Centered Design

Post-ITP

Recent Entries

  • DC Motor Lab: A Solar-Sensitive Window Blind Operator
  • Midi Lab
  • Serial Communication Lab--Using Pots to change RGB
  • Beer Garden Sound Meter -- Project 1
  • Lab 4 - Analog Out
  • Lab 3 - Analog Input
  • Lab2 - Digital Input
  • Lab 1

November 14, 2004

DC Motor Lab: A Solar-Sensitive Window Blind Operator

At first, all I could think to create with DC motors was wheel driven robots. However, after I spent a long time building an H-Bridge, the idea occurred to build a system to control the blinds in my room.

In my room, I want the window opened during the day to let the sunlight in, and closed at night for privacy. The idea is, when the sun shines on a photocell outside the window, the PIC tells a DC motor to open the blinds. When becomes is dark outside, the contraption closes the blinds.

I did not get to far with the implementation--I still have no idea how the mechanics of opening/closeing the blinds would work. However, I built a working H-bridge and hooked it up to a motor. The motor comes from what I think is an old tape deck. I had a button that would reverse the current (taking the place of the photocell) and make the motor change direction.

H-Bridge and Motor w/ Gears:

Posted by rus200 at 08:21 PM

November 03, 2004

Midi Lab

I got the midi-out up and working. I overcame a problem with the code from the lab web-site, and I modified the picBasic random number generation to work with my application--a sequence generator.



------


I got the midi-out up and working. I ran into a problem in that the code from the lab did not work with my setup. This code:

DEFINE OSC 20
DEFINE HSER_RCSTA 90h ' enable the receive register
DEFINE HSER_TXSTA 20h ' enable the transmit register
DEFINE SER_BAUD 31250 ' set the baud rate

needed to be changed to:

'setup hardware serial port:
define HSER_RXSTA 90h
define HSER_TXSTA 20h
define HSER_BAUD 31250 'midi data rate

Once I got that working I thought of an application. In 20th-century music theory a la Schoenberg, a sequence of unique pitches can be used to create serial music. I thought I would create a device that could generate a 7-note sequence and, at the push of some buttons, play it in retrograde, inversion, and transpose it. However, due to time constraints I only got as far as generating a random 7-note sequence.

Overcoming lousy random number generation:

For my application, I had a button that triggered a function that put random numbers in a 7-element array. This array was then converted to pitch so a 7-note sequence would play. Pressing the button would produce a new sequence. However, the RANDOM function produces the same random number ever time the chip is turned on. Every time I turned on the chip I would get the same sequence. To overcome this, I enabled a counter that would increment with each iteration of main. I then added this counter to the newly generated random number. To convert this to a pitch I did modulo 12 on the random number. There is the possibility that the random variable with the addition of the counter could exceed the memory allocation of its data type. Does anyone know what happens when that occurs?

Here's the code.

Posted by rus200 at 01:00 PM

October 20, 2004

Serial Communication Lab--Using Pots to change RGB

For my serial communication lab, I wrote a processing program that changes the RGB values of a JPG according to potentiometer input from my board.




----

For my serial communication lab, I wrote a Processing program that changes the RGB values of a JPG according to potentiometer input from my board.

My Board:


Mapping
My processing program multiplies the RGB values in a picture by variables that are connected to the potentiometers. The potentiometers have an output between 0 and 255. Some mapping was in order to make them have a desirable effect on the pictures. After some experimentation, I decided that 0-125 would make the multiplier go between 0 and 1. For pot values between 125 and 255, the multiplier goes between 1 and 15.

Random Numbers
To create interesting visual effects, I had the multiplier fluctuate randomly. The pot input set boundaries for the random number generator. If the mapped pot input is 0, the multiplier will fluctuate between 0 and 1, if it produces 15, it will fluctuate between 1 and 15. For aesthetic reasons, 1 is always one of the boundaries.


Here's the Processing code.


Movies
In this movie I have JPG of the visible spectrum. At the start, all pots are at their midpoint. Then I move them, starting with blue, towards 0. As a result the colors start to fluctuate between 0 and their original values. After I have done that to all colors, I move the pots, starting with the red one, to their maximum values. This causes the colors to fluctuate between their original value and the maximum value allowed by Processing.


Here's another movie where I do the same thing to a more interesting picture.



Here's the Processing code.




Posted by rus200 at 06:12 PM

October 15, 2004

Beer Garden Sound Meter -- Project 1

Here's two movies of our Beer Garden Sound Meter.



-----

Meter Mode:

Bucket Mode:


Posted by rus200 at 03:35 PM

October 04, 2004

Lab 4 - Analog Out

Lab 4: Servo/Analog out. I had problem with the servo responding bizarrely to the analog input. I also built a musical instrument of sorts using freqout.



-----

I ran into a problem in the second step. Following the instructions in the lab, the analog output (using PWM) would only go from 1 to 1.5 volts, instead of 1 to 2 volts. As a result the servo would only move in 50% of it's full range. This is what fixed it. I changed the equation in the lab:

pulseWidth = minPulse + (pulseRange * (sensorValue/10)) / 100

to this:

pulseWidth = minPulse + ((pulseRange * (sensorValue / 100)) /10)

I'm not sure exactly why this works, but one possibility is that pulseRange * (sensorValue / 10) creates a number too large for the chip to process. Dividing it by 100 creates a manageable value that can be then divided by 10. Unfortunately, this results in the loss of some resolution in the reading/translation of the analog input.

Did anyone else have this problem?


Here's a video of the servo.

For my application, I made something like a musical instrument. I used analog input from a pot as a parameter for the freqout function. I tried to use two pots and two freqout functions to get harmony, but I'm not sure the chip is capable of that. It resulted in this cool rhythm though.

Here's a video with sound.

Posted by rus200 at 01:44 PM

September 29, 2004

Lab 3 - Analog Input

Analog input. I built an audio preamp and a level meter.



-----

I cheated a little with this lab. I did the first few steps, and then my group project sort of took things over. The group project, however, is very similar in spirit to the lab. There's lots of analog input and variables and whatnot.

Step 1 (1mb avi)

I couldn't get my serial output to work so I used the flashing rate of an LED to measure the input from a pot.


Step 2


I got the serial output working (it was a wiring issue) and I was in business with a flex sensor.

Step 3 (.4mb avi)
another video (1.2mb avi)

Ok, here's were I start cheating. Our group project is to create a souped-up sound meter for a beer garden. The idea is that when the sound level gets too high, our system can warn the patrons, they quiet down, and beer gardens don't have to close early anymore.

In order to do this, we had to rig up a microphone up to our pic. This required us to make a pre-amp. I used a circuit from another ITP student's journal.

Here's what it looks like on the breadboard:

Then, we wired 7 LED's to create a level meter.

None of this was too hard to wire. However, the software was a bit more difficult. We found that the output from the pre-amp was erratic. Our first attempt to tame the signal was take the average of 100 samples. However, this resulted in a value that never fluctuated. Now what we do is take the maximum value of 100 samples and use that for our output. The results are consistent with noise levels.

Here's the code.

Now, what makes this different from a normal level meter that you would find on a stereo? Well, there is computational power available to us in that chip. With software, we can log noise levels over time. What we will do with this information is not clear at the moment.

Posted by rus200 at 11:17 PM

September 22, 2004

Lab2 - Digital Input

I built a combo lock and had a problem with using a 20 mHz clock.



-----

Here's Step 1 (1mb avi). Millions of man hours to create a pic chip, and I turned it into a light switch.

I had a problem with a 20 mHz clock, where the pic would only run if I touched the clock. In class today I learned that this could have been remedied by changing the preferences in the EPICWin program to "High Speed." Since I didn't know this at the time I switched to a 4 mHz clock.


Step 2 (1mb avi) went pretty smoothly.

For Step 3 (video below) I decided to make a combo lock. The idea is based on the directional controller of a game pad. To open the lock, you enter a code very similar to cheat codes in a video game; Left Right Up Down, for example. Conceptually it is pretty simple. It took me very little time to draft the code, but it took hours to debug and get working. I had a lot of trouble with what I think was a short in my board. Also, having to take pic chip out of the board and into the pic programmer for every compilation was very time consuming.

I rigged up a serial output to help me along. Here's a sample of the output:

Here's a video of the finished combo lock:
Third Step -- Combo Lock (6mb AVI)

If I press the buttons once each, from right to left order, the lock opens (the green light turns on). Any other order and the lock remains closed. In the movie, I touch two wires to activate a reset.

Posted by rus200 at 09:39 PM

September 15, 2004

Lab 1

I put together my breadboard/container setup and built a tripwire.



-----

I started out with only parts:


After a lot of trouble, including trying to get a broken soldering iron to work for about 20 min., I got my board and box in order.


Step 1:
What you see above is Step One. I got the LED to light up.


Step 2:
I wired three LED's in series and they did not light up. Using the multimeter, I measured the voltage from the positive prong of each LED to ground. The readings were 5.1V, 3.4V, and 1.7V. The voltage form the negative prong of the last LED in the series read 0. The LED's where lowering the voltage by about 1.7 volts each, which is a total of 5.1 (1.7x3)--that's equal to the total available voltage. There was too much resistance for the electricity to get through the LED's, and they didn't light up. I rewired them in parallel, and they all lit up.

Step 3:

I wired a 10k pot between into my circuit in series after the first 220 Ohm resistor. Turning the pot adjusted the brightness of the LED.


Step 4:

When I was a kid, I read in some project book how to make an alarm system out of a radio. It involved creating a tripwire out of clothespins and tinfoil. I took a clothespin and wrapped some tinfoil-like metal around the two halves that form the clamp. After gluing them there, I soldered a wire to the foil on each half. Now, if the clothespin is closed, the a cicuit is completed; open, it is broken.

Open:

Closed (Notice the lit-up LED in the background):

Now for the trip-wire. All that's needed is an insulator that will sit in-between the contacts in the clothespin. Attach a rope to the insulator, and when the rope is tripped, the insulator will pull out and the circuit will close. I glued two peices of plastic around some nylon line.

Voila! A tripwire!

Posted by rus200 at 04:11 PM