Further Stupid Pet Trick Testing

Last Thursday I did some more testing on building the circuit for my stupid pet trick.  I forgot to document it so I’m uploading it now.  First off, I needed to do the lab for building a high current load in order to power my very bright (turns out almost too bright) LEDs.  I used a voltage provider guy to test it.  It was hard to figure out exactly how the transistor works but I eventually got it going through trial and error.  After that I added a potentiometer to the circuit to test changing the power going to the LEDs to fade in and out.

See this work:

[yframe url=’http://www.youtube.com/watch?v=UoJcuk0dw7M’%5D

Here’s the circuit:

Then I wanted to add a switch so I could turn it on and off.  Here’s the switch video and diagram.

[yframe url=’http://www.youtube.com/watch?v=glyfi9pAM28′%5D

Then I tested replacing the potentiometer with my shitty small IR leds.  This worked okay, but I’m waiting for my fancy IR sensor to make it really work.

[yframe url=’http://www.youtube.com/watch?v=8BO-zZfaXuM’%5D

Then I tested the shadow thing by building a small version in the box that our arduino kits came in.  I found that the LED strip I got wouldn’t work as well because all of the LEDs are different light sources and cast different shadows.  Duh.

[yframe url=’http://www.youtube.com/watch?v=tkYH2cG3P18′%5D

I’ve got a lot left to do.

Oh, and here’s the code:

//initialize vars
const int ledPin = 9;
int aVal = 0;
int brite = 0;
int convert;

void setup(){
pinMode(ledPin, OUTPUT);


void loop(){
//read analog signal
aVal = analogRead(A0);
// convert = 1023 – aVal;
// brite = aVal/4;
brite = map(convert, 0, 1023, 0, 255);
//write to led
analogWrite(ledPin, brite);

//write value
Serial.print(” “);
// Serial.println(brite);



Author: owen ribbit


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s