Light to Frequency toy/noise generator

| No Comments | No TrackBacks

...getting it in the box was easy.  the hard part was getting it into the box!

I've been obsessed with TSL230R-LF programmable light to frequency converters; many have been burnt up by these hands.  They're commonly available, cheap and if you like making music/noise, then wiring them up is a snap (even compared to making a 555 generator).    

There are two TSL230R-LF in the blue box (recessed below the black holes), and and an Arduino micro-controller for simple syncopation.  The box pictured above is wire-wrapped with a 24 pin header connecting the board to the controls.  When plugged in, the box produces super clean digital square-waves based on the intensity of light.  You can simulate 8-bit acceleration in spy hunter, create noisy beats, or control it like an optical theremin with a very full audio range.  The switches control the sensitivity and the pots control the syncopation.  The led's are a direct indicator of when the LTFC is generating a pulse.   The output is to a stereo mini 3.5mm jack with one generator to a channel i.e left and right.   On the oscilloscope, the two outputs have been plotted in XY mode to create the spiral.  

The arduino code is very simple; two pins are set to analog read, the value is then translated to on/off pulses with digital write and sent via two pins to the LTFC enable/disable pin.  If you can't tell, I almost always start with an arduino example and build onto it for this case there are some erroneous lines of code as bonus!

After I get the PCB back (and working!), I'll post that, for now, here's a schematic and code:

p.s.  The schematic is missing a 120 ohm resistor at the ground of the 3.5mm jack.  This will allow for the LED's to remain on when plugged into anything with a coil (i.e. headphones, speaker, etc).  Also, when the battery drops below 5 volts, the 5 volt based Arduino will stop working, whereas the LTFCs, which are tied to a 3 volt regulator, will continue to function.  This could be solved by using the 3.3 volt Arduino pro mini.  And maybe, there will be a version two.

//fun trick noisemaker, syncopator, tc 2010

int sensorPin = 3;
int sensorPin2 = 2; // select the input pin for the potentiometer
int ledPin = 9;   // select the pin for the LED
int ledPin2 = 8;
int sensorValue = 0;  // variable to store the value coming from the sensor
int sensorValue2 = 0;
int x = 100;
int x2 = 100;
int y = 0;
int y2 = 0;
float z = .255;
int pwm = 0;
void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(ledPin, OUTPUT);  
  pinMode(ledPin2, OUTPUT);

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);    
  sensorValue2 = analogRead(sensorPin2);    
  // turn the ledPin on
 // digitalWrite(ledPin, HIGH);  
  // stop the program for <sensorValue> milliseconds:
 if(sensorValue < 670 && sensorValue > 65)
      //pwm = z*sensorValue;
      y = sensorValue/3;
 else if (sensorValue > 670)
    digitalWrite(ledPin, LOW);
 if(sensorValue2 < 670 && sensorValue2 > 65)
      //pwm = z*sensorValue;
      y2 = sensorValue/3;
 else if (sensorValue2 > 670)
      digitalWrite(ledPin2, LOW);

Enhanced by Zemanta

No TrackBacks

TrackBack URL:

Leave a comment

About this Entry

This page contains a single entry by admin published on February 16, 2011 10:42 PM.

3 computers, 1 console: sync'd HD playback. was the previous entry in this blog.

nexus one, piecemeal is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.