Monday, April 2, 2012

Toy debug sessions

My young children have a toy tv remote that makes various fun sounds when the numerous buttons are pressed. It also has two leds at the front that light up and/or flash in sequence. A nice simple toy that keeps them away from the real remotes. This is a good idea because baby slobber gets into anything and isn't good for electronic components. A case in point proved with the hard life this toy has had.

The toy remote had survived the various sucking attacks of my daughter and now it was my son's turn. However over the last few weeks the sound coming out of the speaker was getting quieter and sometimes there was no sound at all (the lights however continued to flash). New batteries were installed (3 x AAA) but a few days later all sound had stopped. The fixitup daddy was escalated to. To the shed...

Five self tapping screws held the case together. All the buttons were on a single rubber piece that came off to reveal the pcb. However to get to the component I had to unsolder the battery terminals from the pcb so the board could come free. Straight away I noticed the large amount of corrosion at the front (where the leds were located and a prime sucking point) of the pcb. The legs of one of the leds were brown and the board was discoloured. So my first thought was that baby slime had made it to the speaker and broken/dissolved it.

I cleaned all the board is isopropyl alcohol to remove the goo. Then I unsoldered the speaker to test it. However when a voltage was applied across it's contacts crackling could be heard. So the speaker was ok. Put that part back in. I replaced the corroded led (even though it still worked, that much corrosion is just bad). At this point I was focused on some passive component having failed. Doing various tests on the surface mount resistors all checked out ok. A diode test on the transistors seemed fine. I then considered the large (compared to the surface mount ones) electrolytic capacitor. It was a 100uf 6.3v. Old capacitor, baby slime - maybe faulty? Testing the resistance across it - 500ohms. That shouldn't be so time to replace that part. Given the small space in the toy I used a recycled 6.3v capacitor from an old computer mouse. Applying power and everything worked! Another of life problems solved by replacing a capacitor.

The next day however, failure. The sound from the remote was dead again. Back to the shed.

I replaced the second hand capacitor with a new one thinking this would be a quick fix. I didn't have any 6.3V caps so I substituted a 16V one. This took a bit of lead bending to make it fit in the space available. However that didn't solve the issue. So either something else had broken overnight (unlikely) or the capacitor wasn't the real cause of the issue. Back to more circuit tracing.

The pcb was dual sided. The heart of the toy was a microcontroller hidden under the standard black glob. So working in reverse for each part of the circuit I traced backwards to the controller. There were three main parts each driven off a separate pin of the microcontroller:

* the speaker driver consisting of what looked like a transistor and a few resistors and capacitors
* two identical led drivers circuits consisting of again what looked like a transistor and a few few resistors and capacitors.

Luckily all the transistors were the same model. The two on the led circuits were working so I could use their behaviour to compare to the behaviour of the transistor on the speaker circuit. Again I checked all the end points between components (use the continuity tester on my multimeter) and tested the values of all the components. All looked fine. Next I powered the circuit and checked the voltages at various points. Again all looked fine.

Concentrating on the transistors I tested the behaviour of the led transistors. Testing the base pin on the transistor I found out it went from 0v to 0.7v when the led was turned on. The collector pin went from 4v (ish) to 0v. Ie the transistor was turned on. Now to test the speaker transistor. When sound was meant to occur 0.7v was seen on the base pin. However the collector pin stayed at 4v. A dead transistor perhaps. I bypassed the transistor by bridging the base pin to the collector. Sound was heard, but it was very soft. So the transistor should be acting as an amplifier as expected, but it was not working currently. I unsoldered/destroyed the broken transistor so I could replace it. I don't have any surface mount components so I used a generic NPN transistor in a TO92 package and held the transistor onto the appropriate pins. Sound was back and it was loud. Not as loud as originally but that was ok as the sound level before was too high.

The original transistor was a SOT-23 package so a TO92 wasn't going to fit. Also the transistor was directly under the speaker so there was no room for a through hole component. However like a lot of consumer toy there were various components on the silk screen that weren't present. Perhaps they are used in other designs or revisions? One available spot was next to the leds which was for an electrolytic capacitor. Plenty of room for a TO92 part. The leads were a bit long but all fitted. The only mar on the whole job was when I slipped and slightly burnt the speak wire.

Putting everything back together the sounds are working and there is one happy little boy who isn't trying to grab the tivo remote as much as before.

Looking back I spent a lot of time (3-4 hours) fussing around on a $15 toy. On the hourly rate test it was a failure (I like to work out based on my hourly rate how much something would take to do before deciding to do it myself or get someone else to do it or buy a replacement) but from a learning aspect it was great success which is why I persevered. Or the obsessive compulsive aspect of me kicked in and refused to be beaten.

Things learnt:

* not having a computer in the shed to look up datasheets slowed things down. I had to use trial and error to work out which pins on the TO92 transistor were what for example. I need to test if the wireless network makes it down there. Or waste time walking back to the house.
* surface mount bits are hard to unsolder. With the normal tip on my soldering iron I couldn't get solder sucker in fast enough after I moved my soldering iron out of the way.
* my guilt on having lots of components that I didn't buy for any real reason is reduced by projects like this.

The final thought now is to build a hand held portable battery powered voltage supply. I'm thinking of LM317 run off a 9V battery and a rotary switch to determine what voltage. Voltages would be in multiples of 1.5V to fix what is seen in toys with maybe 3.3V and 5V added in for good luck.

No comments: