GBAmp3 Mod PCB Order Now
also available at retromodding.comand Deadpan Robot

Thursday, November 3, 2011

TI LaunchPad Shield pcb template

Yes, it is a TI LaunchPad shield pcb design template I've made in Eagle for future projects.


It has two sizes wide and narrow and you can cut opening to show LaunchPad leds.
The source is at code.avrnoob.com hosted by Bitbucket.

Tuesday, October 18, 2011

Endless servo mod

Just a little endless mod for my GWS Sail Winch S125 6T servo, which is used to move automatic door in my chicken coop. This servo has 6 turns and this is enough to open the door, but I did this mod before automatic door to be sure.

So just open this servo, remove potentiometer, solder 10k trim pot in place of potentiometer.



Then set 1.5ms pulse on servo controller and turn trim pot till servo stops moving. This is it, servo is endless now. To move CW send >1.5ms pulses and to move CCW send <1.5ms pulses.

Or you can use 5k resistors instead of trim pot and then ajust pulse width to stop movement. And when you found needed pulse, just use lower or higher pulse width to move CW or CCW.


Monday, October 3, 2011

Diode fail

Two cheapo 10W led drivers, which I hacked (see previous post) to supply 1A current, just died. They make high frequency noise now. Checked components and found that output diode has failed. Diode is SR260, 2A shottky. I guess it's failed because of temperature inside driver enclosure. I made holes in second driver and it's failed too.
Replaced SR260 with 2x1N5819 in parallel, works for now, will test inside enclosure later.

Saturday, September 24, 2011

Lamp 10W Power LED Retrofit

I had a small side-project about power leds.
Received some 10W (advertized) warm and cool white leds. Yeah, it's bright! And hot too.
Then got some cheapo 10W constant current led drivers, which should drive a led with 900mA max (advertized).



But when I put it to the test, I saw just 580mA, sad. So I opened it and done a dirty hack - soldered a little resistor (75 Ohm on picture) across feedback optocoupler. Now, Viper22A (constant current driver ic) sees less feedback current and drives harder, delivering stable 960mA after warming up. It works a lot hotter now, needs ventilation holes at least.


Forgot to mention that my leds max current is 1 Amp (advertized), I don't know really if I'm overdriving these leds.
Then I found unused lamp which was bought to fit CFL inside, but as it turned out there is no place even for small 15w CFL. I removed E27 screw holder, scraped paint in center and polished. Then drill two holed to hold led tight and put led on polished area with some CPU heat grease/paste. Yea, backside of this lamp is made of metal, it acts as somekind of heatsink now. Double holes at top and bottom is for airflow purpose. Hot air goes up, sucking less cooler air from bottom and so on.


Screwed frosted glass lens back.


The glass lens is not that great quality, as you can probably see it has somewhat greenish tint.


Yea, color is not really correct on this picture, but it's a cheapo led afterall =)
Let it work for a night and in the morning it was not that hot (I mean backside), this is good. Driver was naked while test and was pretty hot, so ventilation holes absolutely need. This was warm white led. Next time I'm going to use smaller lamp for retrofitting.

Wednesday, August 31, 2011

Nokia accessory as a CB radio external speaker hack



I thought it's nice to have a backup speaker for CB radio in a car. When I saw old Nokia BHF-3 handfree which is not in use, I start thinking how to hack it.
I desoldered phone connector, opened the case and found sound-in pads which is marked as LSIn+/-. Soldered 3.5mm jack to that pads and turned handfree on to test sound, and there was no sound at all.
So this handfree somehow knows when phone connected or sending sound in and turning on an amplifier. Time to check datasheets for chips on pcb. There is a chip marked as K990 in DFN8 package and looks like datasheet for TS4990 from STM fits nicely. This audio amplifier have standby pin with low active. So I just added a wire from Mute pad (which have +5v) to transistor base which turning standby on and viola, I have nice external speaker :) Don't know if it's powerful for cb radio incar use though, need some test run.

Friday, June 10, 2011

OBD-II USB adapter to Bluetooth adapter hack



Hi. Yes, I was pretty busy or lazy to write something. There was not interesting projects. The last one was a battery backup switcher, it switches power source to battery when mains go down. Based on relay and transistor.

Today project is not a big deal too :) I have a cheapo OBD-II USB adapter and serial bluetooth module. As bluetooth module was not used anywhere for a long time I decided to hack OBD-II USB adapter and make it Bluetooth instead of USB.
Yea I know I can buy a cheap Bluetooth OBD-II adapter, but I like DIY.



So I opened the box and found PIC18F4 mcu inside and FTDI232RL UART to USB serial converter.



Then I desoldered FTDI chip with usb crystal. My bluetooth serial module needs 3.3v supply, so I had to add 3.3v regulator with couple of capacitors (took 5v from 78M05 voltage regulator on pcb). OBD-II box has 5 leds indicating rx/tx from car and serial and power status, BT serial module can indicate it's status with led too, so I drilled a little hole in the box top right under sticker and glued the led with hot glue.



When I finally soldered this mess-o-wires to adapter pcb in place of FTDI chip I found that is does not work, not receiving or sending any data, but bluetooth pairing works and BT status led works as it should. Took a bit of time to solder FTDI chip and crystal back for debug. Find out that it works as USB ok but not bluetooth. Then I take a look where tx and rx connects to PIC mcu and you probably guess already, I connected BT module tx to PIC tx and that's wrong :) Changed wires and soldered them right to the PIC mcu legs, that works. Time run away and I leave FTDI chip on pcb.

That's it, works great with my Android phone even better than windows scanner apps under wine in Ubuntu :)


Friday, February 18, 2011

Another temperature related project

While Duothermo project is frozen I started working on new one. It's a very simple thermostat project. I need it to keep temperature in chicken coop with help of 12V fan heater running on battery. First I used a p-channel mosfet with pnp transistor to set level to 12V from 3.3V. Heater is pretty powerfull for this. Then this is just melt my mosfet. Heater eats about 10 amps 12V. Mosfet is rated at 15A. Maybe I did something wrong :)
Then I found some automative 12V power relay rated at 20A. And made a simple driver with n-channel mosfet to swith relay from 3.3V and it works ok, relay just gets warm.
This driver done as a shield for TI LaunchPad kit on prototype perfboard, you can see mosfet driver shield picture in the twitter.
Now it's time to write firmware. What I want is to save my battery from over discharge it means not more than 5.5 hours of heater overall runtime. Turn heater on when temperature is 5C lower than needed. Status indication with leds on launchpad board. Manual mode switch with button. External wire with temperature sensor, because relay is getting warm and shield is too close to mcu then internal sensor is not sutable for temperature reading.

Project code repository: code.avrnoob.com/thermostat

Saturday, January 29, 2011

Duothermo: sensor back but changed to LM335

Mystically found my DS18B20 sensor in TI LaunchPad box :) But I already started to work with LM335 analog sensor. Connected it to LaunchPad VCC and A1 channel of ADC10.
While ADC10 clock source is set to ADC10OSC read value is not constant, it's jumping around +/-3. While clock source is MCLK (with 8 divider, 16MHz/8) read value is pretty constant if temperature does not change. And with ADC10OSC value is 3 points higher. I don't really understant why it is so, but if I will need a low power mode I definitly will use ADC10OSC.
Now LM335 needs some calibration. I will use this sensor as external ranged (2-3 meters max) sensor so I want no more than 2 wires. I don't like hardware calibration, because I don't have small variable resistor pots :) I'll try to do it in firmware. I don't know if recalibration needed if I change Vref for ADC10. Now VCC as Vref used and it's 3.55V(or 3.56V) on LaunchPad. The actual project will use 3.3V. This will limit sensor temperature range to no more than 55C or so. It's ok for me. I can use 5V reference for MSP430G2231 which I use, but lose another pin, which is no go for now.

A1 read function:

Thursday, January 13, 2011

Duothermo: sensor lost

I somehow accidental lost my DS18B20 sensor, maybe threw away in garbage bin with some garbage from my table.
So I have to found some new sensor or fall back to single sensor mode, but I need to measure temperature externally.

Wednesday, January 12, 2011

TI LaunchPad project code name Duothermo

I selected some parts for this project. MCU is MSP430G2231 which have internal temperature sensor (MSP430G2211 does not have ADC). DS18B20 1-wire digital temperature sensor as secondary sensor. 74HC595 8-bit shift register to show digits on 7-segment leds with multiplexing. I desided to use 3 7-segment leds with decimal point. Actually I don't have 7-segment but I do have 14-segment leds, I'll just use them as 7-segment leds. 3 transistors to power and multiplex leds.

So I have to use 4 pins for shift register, 3 pins for led multiplexing, 1 for decimal point (but it can be instant on), 1 for negative temperature minus (this is would be a dot actually). 1 pin for 1-wire interface for DS18B20 sensor. So 9 pins at all. Full port 1 and 1 pin from port 2, so no external crystal. 1 spare pin, 2kb of flash.

I already wrote a driver for 74HC595 shift register and a function to read internal temperature in celcius, but without calibration. Temperature read is not that steady as I thought. It jumps a lot hi and low (from +39 to +28 just with one read) if ADC clock is set to ADC10OSC, but if clock selected as MCLK temperature read is pretty steady.

Here is a temperature read function:



It reads ADC10 value then converts it to 3 digit celcius value with decimal point. Temperature struct is for this 3 digit format.

Main problem now is to write 1-wire interface driver for DS18B20 sensor. My code already eat almost 1kb and I need 1-wire driver, segment multiplexing driver, temperature conversion for DS18B20. Another problem is that 1-wire interface needs correct timing and it's not as easy as 74HC595 spi interface. If I going to fail with Duo part of the project, I'll fallback to single termometer and maybe without DS18B20.

Full code is available as always: code.avrnoob.com

Wednesday, January 5, 2011

TI LaunchPad project

A week or so ago I've recieved TI LaunchPad kits for experiments. It's pretty cheap kit, just $4.30. Contains 2 MSP430 line mcus both with 2kb flash, just like my favorite tiny Atmel AVR mcus.
It's time to think what project to do with this kit.

I need a double digital thermometer and MSP430 mcus have integrated temperature sensor.

For external parts I need external temperature sensor and 2 segment leds to show current temperature.

Time to think which sensor to use and how to show 2 digits on 2 segments leds with only 8 gpio pins. And how to calibrate internal sensor. Maybe buttons to calibrate or switch between two sensors.