Dead Bug, Revisited

My previous dead bug attempts were just that, dead bugs … although the mounting method was successfull, it was really difficult to get the chip to stay put – the heat from soldering the connections melted the glue and the thing was sliding around.

So, I made up some PCB layouts for an SOT adapter, allowing me to solder the chip properly, and still provide something I can use easily in a breadboard. This is what I came up with:

tps61040 dc-dc converter switch mode power supply boost step-up

Not the cleanest example of my work, I admit to the fact it looks pretty awful. But it does work well. It is just a simple SOT-23-5 transistor pad layout, expanded to 0.100″ pitch pads. To the big pads, I solder the short side of a molex C-Grid pin header, and then solder the IC to its pads. The C-Grid pins plug perfectly into a breadboard. The whole thing is about the size of a nickel.

Ok, so now that I have the IC in a managable package, what does it do? The IC is a Texas Instruments TPS61040 step-up dc-dc converter. You feed it a low voltage (3 to 6v), and it produces a high voltage (3 to 28v). The IC contains almost all the parts of a switch mode power supply, including the switch itself.

switch mode power supply texas instruments tps61040

Add a hand wound inductor, a few caps and a schottky diode, and I have a complete SMPS. The 040 offers a few neat features, including analog and digital dimming support, automatic softstart to limit inrush current, open load detection, and very very low standby / no load currents. For my experiments, I decided to power eight white piranha LEDs at 50mA (the 040 can handle up to 400mA). My power source was two 1.5 volt alkaline batteries, connected in series.

I was able to run the leds for a few hours until my super cheap “Shazam” brand batteries gave out. I’m sure with a proper set of four NiMH batteries, the LEDs would run for a long time.

My next experiment will be to run a string of power leds using this converter… say four 2 watt jupiters (well, at 400mA, I won’t achieve quite 2 watts). I need to get a proper inductor and a larger output capacitor, to handle the much increased load.

Another hair-brained idea!

One of these days, I’ll get around to re-wiring my house, however there are a number of obstacles in the way … the largest being the 2ft of clearance between my crawlspace and my floor joists.

Along with plenty of 20a rated outlets to go around and ethernet glaore, one thing I’d like to have is music in every room, well, nearly every room. I’d especially like to have audio in the kitchen, work shed (attached), bedroom and dining room. The bedroom would be a special case, I’d like to have the audio system, and an additional thin/fat client for full AV usage.

My idea for the audio system revolves around using a linux server. Here’s the basic idea … each room would have a small LCD screen and some buttons (or maybe old pda’s?). So I’ll call that the interface, whatever it ends up being. Each interface will be able to select the source (perhaps four or five source channels, whatever I can get away with, plugging cheap sound cards into my linux box). If the source is digital, i.e. mp3, the interface should be able to pause playback, next track, previous track, random track. The interface would also need to present a pre-programmed list of Internet radio stations (my main source of music, I have a very small cd/mp3 collection). In the case of internet radio, the interface should let me select the previous station, next station, random station, play, pause, etc. When using a live source, cable, tivo, etc, I dont want to mess with an inter-device interface, so, the only option would be mute. For any source, the interface will also provide a local volume control.

MPG321 and the linux kernel modules apparently have support for multiple DSP audio devices, so a rather simple script should allow for a specific input (file or live) to be routed to a specific output. For mixing of sources, that is, two rooms want the same source, I plan to use a series of analog multiplexors, designed for just this application. These simple ICs can be controlled by the server, and connect specific analog ouputs to specific analog inputs. For example, a 8 channel mux arranged as 2×4 will allow a single stereo output to select from a choice of four inputs. So one IC is required for each stereo output, allowing each source channel to select any of the four sound cards as inputs. A similar IC setup would be used to allow the sound cards to share live-output sources (tivo, cable) as inputs, connecting their line-input to any live source available.

I’m not sure about distribution. I could either go with matching transformers, and send line level signals over cable to the room, and use local amplification… or, I could go with central amplification and just use some heavy speaker wire to drive speaker jacks in the rooms. My house isn’t huge, so there wouldn’t be any runs more than 50-70 ft, so inexpensive 14ga speaker wire should serve nicely … I’m not looking for killer sound while I’m stir-frying … just want to be able to hear the tv or shoutcast stream without having to blast my stereo at the opposite end of the house. The advantages I see of central amps, I can build up a big power supply using old computer psu’s, and drive inexpensive car-audio DC amps, one for each source. The server could control the power to the amps, turning off unused sources. Secondly, line level signals are really low voltage… trying to send them over a long run of wire seems to be asking for trouble … unless I use something expensive like RG58 or RG6. Local amplification also means I need to locate an amplifier somewhere in the room, and provide power for it … not that big of deal I suppose.

This project is a long ways off, but its something that keeps crossing my mind, so I figured I should write it down.

Later!

On the drawing board

My mental fire has too many irons on it… things are falling off the tracks left and right! So I figured it would be a good idea to write some stuff down, as a note to myself, and perhaps to interest of anyone reading this!

******
Project: Water Watcher
Problem: My reverse osmosis filter that delivers drinking water has some sort of problem, in that it continously consumes water, even when the production tank is full. My thinking is the auto-shutoff valve has failed. Well, I could get another asv but whats the fun in that. The filter system has a pressure sensor in it, which disables the booster pump (100psi output) when the tank reads full, but the water supply is not controlled. I’ve been manually turning the water supply on and off to the filter, as well as unplugging the pump when the water is turned off. The second, perhaps larger problem is, my filter drains its brine (waste) water out a tube through the side of my house, rather than going down the drain. In the summer, I collect this water and use it for filling watering cans. In the winter, the water likes to freeze in the drain.

Goals: Design and fabricate a microcontroller operated filter management controller. The first goal will be to monitor the outdoor temperature. When the outdoor temp is safely above freezing, enable filter operation. The second goal is to monitor storage tank pressure. When the tank reads low, enable filter operation. This is so easy, I’m not sure why I haven’t started it yet.

Solutions:
Goal number one; using as DS18B20 digital temperature transducer, monitor the outdoor temperature. A simple interrupt driven routine can sample the temperature every N amount of time. If the temperature is above freezing + 5 degrees (to account for any sensor accuracy problems), enable a register in the microcontroller, saying filter operation is allowed. When the temperature is below the set-point, disable filter operation. This should take five or ten lines of code.

Goal number two; using the pressure switch that is already part of my filter, sense the fluid level in the tank. The switch is normally closed, and opens when the storage tank is ‘full’. An interrupt driven routine will sample the state of this switch. When the switch is closed, an input pin on the microcontroller will read low, indicating the tank needs topping-off. The mcu can then set a register enabling operation of the filter.

The microcontroller in its idle loop, can monitor the state of the registers mentioned above, ANDing them together. When both registers are set to enable, the mcu will enable the booster pump and a solenoid valve (sprinkler valve) controlling the water. When either the temperature or pressure registers read disable, the AND will read a zero and filter operation will be suspended. Additional features could include a remote led status display, indicating filter status (temp high/low, pressure high/low, pump and water on/off). Another feature that would be handy is a change filter indicator, which times out every three months, indicating the need to replace the prefilters. I’m not sure how to do this, without including a real time clock, and that doubles the expense of this project. Of course, there are probably simpler means, like counting the oscillations of a 32khz crystal and just waiting for approximately three months worth of time to go by?

******
Project: Finishing the MAX1668 temperature sensing data logging clock.

I already have the clock and data logging working, but sort of lost interest when it came time to program some data analysis and reporting features, as well as make a PCB for the circuit, so the clock could be installed in an enclosure. So the clock has been sitting under my monitor shelf. Its kinda handy as it is, I use it as a desk clock and local temperature readout.

Goals; Add some menus to review logged data. Daily average temp readout for each channel. Daily and all-time min and max memory for each channel. Temperature trend indicator (rising / falling). Historical data like lowest recorded temp (what date, time and channel), highest recorded temp (date, time, channel).

******
Project: High end kitchen counter lights.

Goals; The lighting concept works… scaled up, the lights should provide ample light for task lighting. I need to build (or find) a power supply for the lights (~36v, 1a). I also need to start on the controller. Some features I want to have:

Using a capacitive proximity switch (qprox). Touching the fixture should change the state of the lights with light sensing intelligence. If the room is dark and you request the lights to turn on, they ramp up to perhaps 25% output, as a night-light mode. Another touch of the fixture would bring them to 100%. If the room is light and you request a turn on, they would ramp up to 100%. Additionally, if the room goes from light to dark (like the main lights were turned out at night), ramp down to 25% output and remain on for an hour or so, as a night light. If the main lights are off and the fixture is off, should the main lights come on, sense this and automaticly come up, ramping up to 100%. If the room is light, and the fixture is on, touching the fixture shall turn the fixture off. If the room has gone from light to dark and you touch the fixture with-in N minutes, the lights should turn off, after N mintues, if the fixture is still on and another touch is detected, ramp to 100% output.

All that sounds like a lot, but it should easily be handled by a microcontroller and maybe a few dozen lines of code, all those conditions are simple binary logic comparisons.

******
Well, that was a good start, got a few ideas down – still too many in the ‘ol brain, so there will be a part two shortly!

Welcome Back

Welcome back everyone… or at least, welcome back to myself.

I took the week between Xmas and Newyear off, and caught up on some non-electronics.

I have a few things in the skunk works, not that they’re really secret or anything, but I’m reserving a lot of details until the projects are farther along – hoping to write up some articles rather than just short posts in the blog.

For now, here’s a few pictures:

smps switch mode power supply buck converter step-down hv9910

switch mode power supply … this circuit is a buck converter or step-down regulator … it’s programmed to supply 500mA into a load (constant current regulation). With my load (seen below), I measured about 90% effiency.

warm white nichia jupiter luxdrive moon power led

four warm-white Luxdrive IO Moon leds, two watts each, using Nichia Jupiter leds (click for larger picture)

same leds above, lit up

Booster Board

Here are a few pictures of my boost-mode converter, originally posted in my thread on linear1.

switch mode power supply boost step-up breadboard
breadboard with 10 led series string, and boost converter circuit


just the boost converter circuit – here you see the output capacitors, the rectifier (buried under the heatsink), the switch (on the other side of the heatsink) and the inductor

pwm waveform
this is the pwm pulsetrain from the PIC … only 10khz and already not quite square – it looks a lot worse at 20khz

out current waveform
output current measured across a 10 ohm resistor, with a basic choke filter on the output from the converter.

Down to the wire

Well well well – time is running short, and only one of three outstanding orders has been filled.

The boost converter is coming along – I’ve made refinements to the software that offer some good features and better performance. However, I think my hardware design needs more work… and for that, I need parts!

Out of desperation, I visited Satan’s Lair aka Radio Shack and was pleasantly surprised to find some of the items I had been missing. I managed to get a 2a 100uH inductor and (only) two 1uF tantalum capacitors. Having a proper inductor really made a big difference in the output of my boost converter – it sails to the limit I set for 25mA without any problems now, the old hand wound torrid would struggle to get past 20, begrudgingly giving me 25mA along with a lot of HEAT. The real test will be tonight – I’m going to wire up some power resistors as a test load and see if my boost converter can give me half an amp. Why 0.5A you ask? I need half an amp to drive my Moon LEDs at their fully rated 2w power.

The boost converter was originally intended to be a power supply for two parallel strings of LEDs, installed as under cabinet lights.

The lights themselves will be made of aluminum C channel and plexiglas, using 2 watt IO Moon led modules, spaced evenly along the length. I’m not sure what the spacing should be – there is probably some math that would tell me, based on viewing angle and what not. Since these are a prototype, I’m going to ballpark the spacing, so the LEDs I have (4) are spaced evenly across the length of the countertop. I need to take a few covert measurements to figure out how long the channel needs to be. I managed to find a local source, and have secured sixteen feet of aluminum C channel. This stuff has a chunky 1/8″ wall thickness and 1.5″ x 0.5″ outside measurements… combined with a little Arctic Silver, this should be an awesome heat sink for the LEDs.

Pictures to come shortly!

PIC Based Boost Regulator

I have a running thread over at the linear1 forums, chronicling my experiences with building a digital switch mode power supply.

Here is a re-cap of where I’m at now.

The boost converter is a coil, a few capacitors, a diode and a darlington transistor. The PIC manages switching the transistor. Switching is done autonomously by a PWM generator inside the PIC. Constant current regulation is achieved by measuring the voltage drop across a 100 ohm resistor. The voltage is measured approximately 5000 times a second, and the pwm duty cycle is adjusted up or down, depending on the read voltage’s deviation from the set voltage. With a 100 ohm resistor, the math works out real easy – 100mV is 1 mA. Of course, 100 ohms will not work for a heavy current load – so I will have to reduce it to 1 ohm or 0.5 ohms, which changes my math a little, but no big deal.

oscilloscope digital tds 210 Tektronix current ripple

I’m having problems with noise in the output current corrupting the A2D input to the pic. Better capacitors and a real ‘power’ inductor are on order and should arrive wed or thur. When they get here, I will rebuild this project so I don’t have, for example, a 12″ piece of wire connecting my switch to my pwm output.

PIC Based Boost Converter

The idea of using a PIC microcontroller as a replacement for the analog circuitry of a smps controller was originally suggested to me by SurJector over on the linear1.org forums.

Originally I felt the topic was over my head. I also dismissed it because I thought it added unnessecary complexity to an already difficult to understand process. However, as I read more about how switch mode power supplies and dc/dc converrts worked, I realized that using a PIC as the brain was indeed a good idea, and very cutting edge. ‘Digital’ switch mode power supplies are just now starting to ‘pop up’ in the industry, with all the current “all in one” controllers still relying completely on analog.

As I understand it, a digital controller offers the potentional for great efficiency, by adjusting the operating frequency of the switch dynamicly with the load. I’m not sure how that all works yet, but I have a few other things in mind, related to using these converters in the field of solid state lighting. Firstly, I like the idea of being able to digitally controll the output current to the load. Instead of having to dim a bulb using PWM, which is very non linear, I can instead dim a bulb using current mode control… using whatever interface suits me. Secondly, a digital controller could be integerated into a larger project, an illumination manager. For example, combine the dc/dc conversion routine with a routine reading a thermistor – monitor your bulb temp and dynamicly vary the current to keep it at a safe level. Another possibility – with a digital processor monitoring the current draw of the load, a faults such as shorted or open diode could be detected and an alarm condition set – in addition to reducing the current to compensate, a small indicator led could light up – “Check Lights”.

I have some pictures and schematics to share when I’m back home – more to come!

Dead Bug

In addition to my new moons, I also received some sample DC/DC converters from Texas Instruments. In order to experiement successfully with this new switch-mode power supply, I need to be able to use it on a breadboard.

I could have drawn up and made my own ‘breakout board’ pcbs. I could have bought commerically made ‘experimentor’ boards. But I decided to use the cheap and fast “dead bug” method instead. I used a little dab ‘o hot glue and a 6-pin DIP socket to convert my SOT-23 packaged device into something I can now use with a bread board.

The jumper wires I used are two strands of wire for a 24ga stranded wire. I twisted the two strands together for a little more strenght. I also used some 24 ga solder wire to extend up from each spring in the socket, rather than soldering to the spring itself. The hard part with this process, and I think I’ll look to epoxy instead of hot glue next time – as I heated the part during soldering, it would soften the glue, and the part would move! In the last picture, it looks like there are some solder bridges, but there are not – that crap between the pins is just debris from my parts cleaning brush … looks like its time for a new brush!

More on the TPS61040 and what it does a bit later.

Enjoy:
dead bug solder tps61040 sot-23 smd
6 pin dip socket

dead bug solder tps61040 sot-23 smd
cut tape string of four converters

dead bug solder tps61040 sot-23 smd
single converter sitting on an 8 pin DIP package IC

dead bug solder tps61040 sot-23 smd
converter glued to ic socket

dead bug solder tps61040 sot-23 smd
starting the soldering process

dead bug solder tps61040 sot-23 smd
finished soldering