Thursday, July 2, 2009

Sandisk Sansa Clip Disassembly and Repair


A friend of mine gave me his 1gb Sansa Clip mp3 player claiming it didn't work and there's no way to fix it, so if I repaired it, I could have it. When I got home I jumped online and did a quick google search for the symptoms this player was exhibiting. It won't turn on no matter what buttons you press in any combination for any amount of time. Also, when you plug it into a computer the 'connected' screen comes up, the battery appears to charge for a couple seconds, then it shows the battery fully charged. However, once you unplug it from the computer, nothing. After ruling out firmware I figured it was probably the battery, and after some more google'ing I found that other people had experienced the battery wires falling off.

So it was off to the work bench. I had nothing to loose, so out came the soldering iron the screw driver and some pliers. After some
prying with the screw driver I was able to get the thing appart and, low and behold, all three battery wires were disconnected from the board. Very carefully I stripped the wires with a
razor blade, make sure not to let the positive and negative touch once you have them stripped because
lithium polymer batteries are know to catch fire when shorted. Anyways, I was able to solder all the wires back to their homes

(red to + blue to N and black to -). I slid the power bar and the
screen lit up, so I put the buttons back and snapped the case back together and now I'm happily listening to the previous owners music as I type this.
Hope this helps someone out there.

My First Arduino Project


Being a fairly tech savy lad, when I heard about the Arduino prototyping board about a year ago I knew I wanted one. This summer I finally mounted up and bought a Duemilanove and have been having a great time with it. After playing with some of the sample sketches I decided I would try and make binary clock. My breadboard is rather small so I had to do some substantial soldering in order to get my 13 led's to the 13 output pins of the arduino.

After I had the hardware setup, I started writing the code. I have some basic skills in C and C++ so I started by writing my code in C and having it spit out times to the comand prompt so I could test for bugs. After everything appeared to be working it only took a couple of changes to get the code compiled as an arduino sketch. After some more debugging and fixing of my own stupid mistakes... it worked. I was quite pleased and left it running all night; in the morning the time was still correct (to what degree I don't know).

Well here's the code. Keep in mind that I was too lazy to program in buttons to set the time so you have to set the intial values in the code to the time that you load the sketch.




//Initializes time. Change to current time then upload to arduino i.e. 03:02
int hour_one = 3;
int hour_ten = 0;
int min_one = 0;
int min_ten = 2;
//unsigned long is good for 1193.05 hours
unsigned
long last_time;

void setup() {
pinMode(1, OUTPUT);pinMode(2, OUTPUT);pinMode(3, OUTPUT);pinMode(4, OUTPUT);pinMode(5, OUTPUT);
pinMode(6, OUTPUT);pinMode(7, OUTPUT);pinMode(8, OUTPUT);pinMode(9, OUTPUT);pinMode(10, OUTPUT);
pinMode(11, OUTPUT);pinMode(12, OUTPUT);pinMode(0, OUTPUT);
}
void loop(){
last_time = millis();
//keeps track of how long is took to run through loop()
if (min_one < 9){
min_one++;
//adds to the ones place in the minutes
}
else {
min_one = 0;
//resests the ones place in minutes to 0
min_ten++;
//adds the tens place in minutes
if (min_ten == 6){
min_ten = 0;
//resets the tens place to 0
hour_one++;
//adds the ones place in hours
if (hour_one == 10){
hour_one = 0;
//resets ones place in hour to zero the adds on
//to tens place
hour_ten++;
}
if (hour_one == 4 && hour_ten == 2){
hour_one = 0;
//resets hour to 0 if 23:59 was last printed time
hour_ten = 0;
}
}
}
display(min_one, min_ten, hour_one, hour_ten);
//displays the time to leds

for(;(millis() - last_time) <= 60000;){} //waits a minute taking into
//account the time to run
//through loop()
}

void display(int min_one, int min_ten, int hour_one, int hour_ten){
int hour_t[2] = {0}; //intialized arrays to store binary
//version of time
int hour_o[4] = {0};
int min_t[3] = {0};
int min_o[4] = {0};

int i = 0;
int x = 0;

//Creating arrays that contain binary form of current time
while(hour_ten != 0){
hour_t[i] = hour_ten % 2;
i++;
hour_ten = hour_ten/2;
}
i = 0;
while(hour_one != 0){
hour_o[i] = hour_one % 2;
i++;
hour_one = hour_one/2;
}
i = 0;
while(min_ten != 0){
min_t[i] = min_ten % 2;
i++;
min_ten = min_ten/2;
}
i = 0;
while(min_one != 0){
min_o[i] = min_one % 2;
i++;
min_one = min_one/2;
}
//tens place in hours
if(hour_t[0]) digitalWrite(0, HIGH);
else digitalWrite(0, LOW);
if(hour_t[1]) digitalWrite(1, HIGH);
else digitalWrite(1, LOW);
//ones place in hours
if(hour_o[0]) digitalWrite(2, HIGH);
else digitalWrite(2, LOW);
if(hour_o[1]) digitalWrite(3, HIGH);
else digitalWrite(3, LOW);
if(hour_o[2]) digitalWrite(4, HIGH);
else digitalWrite(4, LOW);
if(hour_o[3]) digitalWrite(5, HIGH);
else digitalWrite(5, LOW);
//tens place in minutes
if(min_t[0]) digitalWrite(6, HIGH);
else digitalWrite(6, LOW);
if(min_t[1]) digitalWrite(7, HIGH);
else digitalWrite(7, LOW);
if(min_t[2]) digitalWrite(8, HIGH);
else digitalWrite(8, LOW);
//ones place in minutes
if(min_o[0]) digitalWrite(9, HIGH);
else digitalWrite(9, LOW);
if(min_o[1]) digitalWrite(10, HIGH);
else digitalWrite(10, LOW);
if(min_o[2]) digitalWrite(11, HIGH);
else digitalWrite(11, LOW);
if(min_o[3]) digitalWrite(12, HIGH);
else digitalWrite(12, LOW);
}