GBAmp3 Mod PCB Order Now
also available at

Friday, December 7, 2012

PIR Motion sensor relay fast repair

Recently my motion sensor lights switch went bad. I opened it up and found that main ic is dead, but relay and relay transistor is ok. So I ordered really small PIR Sensor Module to fit it in place of dead ic. That ic was LP8072C which is a pir controller and it support light intensity sensor which is just a Photoresistor. So my motion sensor does not switch relay in daylight, designed for lights switching.
Pir sensor module I've got does not support photoresistor, so I had to design it in myself. What I've done is connected photoresistor to the base of relay switch transistor and second lead to the ground. With a base resistor which was on pcb already it makes a strong pulldown to transistor base. So when it's a daylight, photoresistor changes it's resistance to about 220 Ohm which prevent transistor to switch relay. I had to remove some parts from original pcb which interfere with photoresistor. An I removed LP8072C too.
Then I removed actual pir sensor can from module pcb and removed connectors too. Wired pcb pads to old pir sensor can on original pcb and to power and wired output to the output pad of LP8072C ic.

Then I glued sensor module pcb in place. Works ok except this new sensor has short keep relay on timeout, but whatever. This can be adjusted I guess, ic on sensor module pcb is unknown, no markings, it looks like sanded.
As you spotted there is no power supply as we used to see. It's just Live wire through 0.47 uF 250v cap in series with resistor to diode bridge. Then to 25v filter cap then to regular diode to drop voltage a bit then to zenner diode to get 5v with filter cap. It's a low power supply. Sometimes it's used inside cheap led light bulbs with many leds. This red 0.47 uf cap is half dead already because it's rated to 250v and as you know 220v mains has 315v sine peaks. It's capacity is 0.2 uf and it still works.

Saturday, October 13, 2012

Game Boy Color Loud Sound Mod

Update: new version available for order

Update: published schematics and pcb design files for Eagle and Gimp. Make your own pcb and respect the license =) Take a look:

Recently I've got used Game Boy Color and noticed lack of sound volume, it is barely audible. So I tear it down and pulled speaker out, it was all rusty.

 I had a speaker for Motorola L7/L6/L2/L71/K1-GSM/V8 on hands and soldered it in. So this is fixed sound. But it is still not loud at all, so low volume, I had to use my headphones instead. Oh and there is loud hiss noise, guess it's coming from power supply. I had to do something with it =)
I looked in my parts bin and spotted TPA2000D1 - a class-D mono amplifier from TI. It is 2W power rated with programmable gain and class-d is pretty efficiency means low power consumption.
After some time pcb was made.

I used schematics from datasheet but in the final version I changed 1uF bypass cap and other 1uF caps to 10uF and added 0.1uF. Also I had to change 120k resistor in oscillator circuit to 180k to keep frequency below 300 kHz, it was 330 kHz with 120k resistor.

Powered up ok first time wires connected and sound now is much louder even with gain of 6 dB but then I set it to 12 dB by moving one resistor to outrun any ambient noise. This is max before clipping I guess. Unfortunately noise hiss did not gone away and become even louder on high volume, so this is power supply. Game Boy Color is powered with two AA batteries. But it has switching step up power supply with 15V and 5V output, this makes noise because amp is powered from 5V. I had to add additional 470uF cap to 5V power rail to make noise go almost away, now it's barely audible on max volume.

Amplifier pcb moved over speaker and case closes nicely.

Amp barely visible inside. This Game Boy Color now definitely has Hi Fi sound =)

Sunday, August 19, 2012

OBD II Bluetooth PowerUp

Just upgraded my Bluetooth OBD II adapter with class 1 power module. Now I can diagnose a car sitting at home.
You can get bluetooth OBD2 adapters from Amazon but neither of them has class 1 power bluetooth module with ceramic antenna! =)

Friday, August 10, 2012

DIY Car Bluetooth A2DP

Does not have bluetooth in your car? No problem, let's do it yourself.
I had a spare iPod / iPhone dock Bluetooth A2DP receiver, never used. So I decided to open it up and fit into car 12v plug with aux out.
Here what it looks like when new:

When opened there is one pcb with OVC3860 Bluetooth chip. Actually it sounds better than ISIS chips. That why I decided to use it.
I desoldered 30 pin ipod connector with heat soldering gun.
Backside has some testpoins, maybe useful to easy solder wires for aux and power.
I traced 30 pin connector pads to testpoints and found out that this thing needs 5v power and has left, right, audio ground and 5v in and power ground on testpoints.
I've opened 12 car plug, removed guts and tried to fit this pcb in, no fit =( But with desoldered 30 pin connector there is much unused space on pcb, so I cut it to fir nicely.
Soldered 5v linear regulator and put heatshrink over it later.
Wired power and AUX out to 3.5mm female socket with screw mount and it is done.
Forget to take picture of it when closed, but there is nothing special, just plug hole visible. Sounds nice, but becomes hot almost instantly. This thing eats 100mA when receiving sound and 60mA when idle. So linear regulator works on the edge, it is rated for 100mA. But chip itself gets hot too, not sure why. Anyway I connect car AUX to this plug and have Bluetooth now.

Tuesday, June 26, 2012

TI LaunchPad with OLED

ti launchpad oled

Have not time til this week to play with my little OLED display which I won in Seeed Studio lottery last year.
Connected it to TI LaunchPad. Made a little library to control it. Pixels addressing is a bit confusing. Had to do a font converter to make big digits font suitable to send to display without much processing in micro.
Anyway, it is equipped with SSD1308 controller with i2c bus on connector. Used my oldy USI i2c driver library.
Code which outputs those digits:


 oled_command(OLED_DISPLAY_OFF); // off
 oled_command_arg(OLED_CONTRAST, 255);
 oled_command_arg(OLED_CLOCK, (15 << 4)|0); // 0b1111 0000 fastest clock
 oled_command_arg(OLED_PRECHARGE, (3 << 4)|(3)); // 3 dclk for 1 and 2 phase precharge
 oled_command_arg2(OLED_COLUMN_ADDRESS, 0, 127); // column address from 0 to 127
 oled_command_arg2(OLED_PAGE_ADDRESS, 0, 7); // page address from 0 to 7

 unsigned int i;
 // clear display
 for (i = 0; i < 128*8; i++) {

 oled_command_arg2(OLED_COLUMN_ADDRESS, 0, 127); // column address from 0 to 127
 oled_command_arg2(OLED_PAGE_ADDRESS, 0, 7); // page address from 0 to 7

 oled_print_big_digit(0, 0, 0);
 oled_print_big_digit(1, 1, 0);
 oled_print_big_digit(2, 2, 0);
 oled_print_big_digit(3, 3, 0);
 oled_print_big_digit(4, 4, 0);
 oled_print_big_digit(5, 0, 1);
 oled_print_big_digit(6, 1, 1);
 oled_print_big_digit(7, 2, 1);
 oled_print_big_digit(8, 3, 1);
 oled_print_big_digit(9, 4, 1);


Not much memory left in MSP430G2231, so I'm going to port this library to AVR for my projects.
Display is really great, easy to read. This should be low power, but in off state module eats about 4mA. I guess it is because of 3.3v to 12v converter on board.
Seeed Studio does not has this module anymore but has another one even smaller: OLED 128x64

Saturday, February 18, 2012

Desk lamp leds retrofit with diy constant current driver

Continuing my previous post about diy constant current boost driver for 9 leds in series, here is a mod for my burned out desk lamp.
I've designed new schematics with 4 mosfets in parallel, because this is only mosfets I had on hands and they are pretty low power with high Rdson. So I decided to use as many as I can.
New schematics:

Then I tear my desk lamp apart, throw internals away except power switch and measured insides how to fit driver pcb.
With this measurments I designed new pcb:

As long as this driver can drive 9-18 leds in series I want to use 3 modules in parallel with 9 leds in series each.
Here is one module pcb assempled:

What diy project without hotglue? Hotglued new driver assempled pcb in place.

New design has push button to switch power modes from low light to max output light. So I drilled a hole to fit this button in. It's pretty invisible and handy to switch light output.

3 led modules glued in place of cfl bulb:

And now it shines my desk, well actually just wall behind my lcd monitor =)

Sorry forgot to picture the whole build.
This project is Open Source and Open Hardware as all what I'm doing here. So take a peek inside the sources and schematics at and fork if you want.

Thursday, January 19, 2012

DIY 9-18 series leds constant current driver

When my desk lamp died I decided it's time to upgrade it to led desk lamp.
I have several 8mm straw hat leds which are laying around unused for too long. So I thought to put those into lamp mod. Then I thought about how to drive these leds with as little power wasting as possible and come across to constant current drivers. Yes I can power leds with series resistors to limit current, but there is power wasting in resistors and I can't drive each leds with the same current. In this project I wanted to learn something about boost converters and opamps, this means I'm going to do a constant current driver with voltage boost converter to power many leds in series. That way I can keep the same current on all leds in the module.
I took ATtiny13A + some generic opamp and made it.

Shematics looks like this:

To test it I've made a pcb with generic white 5mm 9 leds in series and drive them with 20ma (ajustable in fw):

Yes it may look ugly, but it works. Push button is for changing power modes in final design. I've tested it on 9 leds in series with output around 27.5v and on 18 leds in series with output around 58v, works fine with not much current to leds.
Actual lamp mode and source files next time.