# 15A tailcap controller, multimode pwm, piezo/magnetic/clicky, feeler thread



## DIWdiver (Oct 12, 2010)

I'm thinking of building a new board. It would be an interface from various switch types to a load up to 10A (20A or more with heatsink)
Some of its potential uses are:
- DIY piezo switches using a cheap piezo element instead of an expensive switch
- latching circuit for piezo switches
- single and multi-mode hall interfaces
- high current PWM driver for any switch type

I'm sure forum members will come up with many other uses.

The hardware would have the following features:
- Interfacing with 1-3 switches. Switch types could be piezo, reed, mechanical, or hall effect.
- three hall sensors can be mounted on board for multi-mode rotary magnetic switch
- no heatsink required for supply voltages above 2.5V, currents to 10A
- with minimal heatsinking 15A, could go to 20A or so with better heatsink
- Switch a load to ground (FET between load and ground)
- 15 to 50 uA maximum quiescent current, depending on configuration (hall sensors are about 10 uA each)
- Quiescent current can be reduced to a few uA (FET leakage) by disconnecting power supply with a low current switch
- sized to fit in the spring groove of a Mag-D tailcap, can be ground to 1" (25.4mm) diameter
- with a Mag-C spring and insulating ring, can be installed in Mag-D with NO WIRING
- all components on one side of board. Only 0.15" (3.8mm) thick
- supply voltage 2.0V to 16V (lower and higher voltage ranges are possible)
- 120 Hz PWM dimming, 0-100% output, but gets non-linear below 3-4%, max 95% DC with no power connection
- Microchip PIC16F685 processor
- schematics and parts list provided for those who want to work on UI
- can be fitted with in-circuit programming connector
- possible to build a USB or RS-232 adapter for programming

The UI is limited only by the imagination, but I am thinking to offer the following:
Single switch:
- single mode
- three modes, hi-med-low-off
- smooth dimming, touch for on/off, hold for up/down.
Three switch:
- primarily intended for rotary switch with hall sensors on board
- can be cycled in either direction
- three modes, high-med-low-off
- four modes, high-med-low-moonlight-off

I haven't yet decided whether I would release source code for everything, but some basic working UI would be released.

Pricing would be $20-30 USD.

Please reply with interest, comments, needs, and desires.

Don


----------



## 350xfire (Oct 12, 2010)

Reed and piezo interested!


----------



## lucca brassi (Oct 13, 2010)

- *softstart*

-I like to have options of *wet contacts* or *thermal shut down*

( in night dive I have full power in water , when I rise myself from water 
(boat or beach with bulky stones - have enough troubles to find way out from water ; keep balance,.... ) 
circuit should detect coming out of water and protect led from over heating ... but could still run led for example at 10-20% to have minimal light.

It is nice to made such swiss army knife circuit for all purposes , but I think you have some troubles with space and more important wiringor have different modules which directly fit modular like http://pcb-components.de/index.php?...product_id=97&option=com_virtuemart&Itemid=64

Wish you luck!


----------



## DIWdiver (Oct 13, 2010)

lucca brassi said:


> - *softstart*
> 
> -I like to have options of *wet contacts* or *thermal shut down*
> 
> ...


 
Softstart is possible, since there is a processor with PWM capability, just has to be programmed into the UI.

I forgot to mention that there are thermistors for both the onboard FET and for the LED. The one for the LED must be wired to the module from wherever the thermistor is attached. So thermal protection is available.

With a resistor change the remote thermistor contact could be used for wet contacts. The UI would have to be changed.

The board would be offered with 0, 1, or 3 hall sensors. If all 3 hall sensors are installed, you cannot use the other switch types.

I've also completed the circuit board layout, so I'm pretty confident everything will fit! Wiring will be an issue in some cases. In other cases, like incans with no remote thermistor, there will be no wiring to do!

I think the biggest problem will be managing the UI with all the options.

The only question is whether it's worth spending the time to write the UI and the money to build some.

Don


----------



## wquiles (Oct 13, 2010)

Very cool! I just got proto boards for a somewhat similar design, also one inch diameter, but using an Atmel processor and using 7 on board Hall Efect sensors, so it is awesome to see somebody else thinking alike.

I honestly feel your idea/design is a great idea, and I also feel these is a real need for this type of switch/controller, so I am very very encouraged and happy to see another fellow EE working on this type of designs :wave:

Will


----------



## gav6280 (Oct 13, 2010)

3 Mode
Soft Start
Piezo Latching
Boost Driver
Output Power selection from 1A to 5A so could drive SST

Low voltage flashing warning, and Thermal protection dropping the power to a low setting, the light must never just turn off. I would favour reliability over efficiency as it wouldn't be good if your 200yds into a big wreck and your light says NO!


----------



## DIWdiver (Oct 13, 2010)

Must have had a brain fart. I actually meant to start this thread in the Homemade and Modified forum, as it has applications far beyond dive lights. Maybe a mod could move it there, pretty please?

Don


----------



## wquiles (Oct 13, 2010)

DIWdiver said:


> Must have had a brain fart. I actually meant to start this thread in the Homemade and Modified forum, as it has applications far beyond dive lights. Maybe a mod could move it there, pretty please?
> 
> Don



Good idea. Your board/project has a wide variety of uses, and folks with LED/incandescent bulb projects will be delighted to have it available. I feel the features vs price point you have is unbeatable :thumbsup: 

You will also likely get a lot more feedback/suggestions on features since that is one of the most active subforums. Just sent a PM to David (*DM51* - one of our moderators), and he will move it over 

Will


----------



## baywatch106 (Oct 13, 2010)

I would buy one


----------



## kubi (Oct 14, 2010)

Is it only me who would go for a simple but robust solution? Do not implement 3-5 current levels, blinking and fancy stuff.
I'd just overdimension the battery pack to be enough for 1.5-2 hours with the highest output to be on the safe side.

If you are willing to dive in a cave and spend down 2-3 days you will need professional light anyway.


----------



## DM51 (Oct 15, 2010)

DIWdiver said:


> Must have had a brain fart. I actually meant to start this thread in the Homemade and Modified forum, as it has applications far beyond dive lights. Maybe a mod could move it there, pretty please?
> 
> Don


PM also received - moving it now...


----------



## ma_sha1 (Oct 15, 2010)

Can you make it work with mag switch?

only Kai domain has a PWM board that dont need momentary mod, max 2.8A.

3 mode, 15 or 20A no need for momentary mod, it'll be a god send, I need 5-10.


----------



## DIWdiver (Oct 15, 2010)

ma_sha1 said:


> Can you make it work with mag switch?
> 
> only Kai domain has a PWM board that dont need momentary mod, max 2.8A.
> 
> 3 mode, 15 or 20A no need for momentary mod, it'll be a god send, I need 5-10.


 
When you say 'mag switch' do you mean the standard stock switch that comes in a Mag-Lite? If so, then you're in luck! Except that they aren't available yet.

The UI could be offered to work with either the click-on, click-off type switch that's standard in the Mag, or with momentary switches that are available in other products.


----------



## Aircraft800 (Oct 16, 2010)

Keeping my eye on this thread, sounds like a great idea!


----------



## DIWdiver (Oct 16, 2010)

kubi said:


> Is it only me who would go for a simple but robust solution? Do not implement 3-5 current levels, blinking and fancy stuff.
> I'd just overdimension the battery pack to be enough for 1.5-2 hours with the highest output to be on the safe side.
> 
> If you are willing to dive in a cave and spend down 2-3 days you will need professional light anyway.


 
[Note: this thread was originally posted in the Dive Lighting forum]
If all you want is on and off, maybe this controller is overkill. Do you want or need some features that can't be had from a simple FET/reed assembly?


----------



## b-bassett (May 20, 2011)

is there any progrss on this? 

iv got a few housings with piezo's already installed, could do with a driver/latch circuit to finish them off


----------



## DIWdiver (May 20, 2011)

Actually, it didn't sound like there was a lot of interest, so I never pursued it. You could have a look at George's one at TaskLed.

Don


----------



## b-bassett (May 21, 2011)

i thought that might be the case, 

iv looked at george's drivers before, but that would require a seperate latching circuit to be able to use a standard piezo switch.


----------



## DIWdiver (May 21, 2011)

b-bassett said:


> iv looked at george's drivers before, but that would require a seperate latching circuit to be able to use a standard piezo switch.



Yeah, I forgot that. Pity, as piezos are pretty cool!


----------



## DIWdiver (May 24, 2011)

Okay, I just ordered a few boards. It will take a while for them to arrive from China, and a while after that before I'm ready to release the first boards. But we're on the way!

D


----------



## b-bassett (May 25, 2011)

> Okay, I just ordered a few boards.... we're on the way!



superb, let us know how they turn out. the piezo latching part will be especially useful to me, and anyone else who has been having to make our own latches, then try to fit them in with a driver and a fet.


----------



## DIWdiver (May 30, 2011)

I've been working on the UI which results in looking at the schematic again, and have a few updates to the specs:

Typical quiescent current should be 20-35 uA, max 50-80. This is higher than previously mentioned, but should still be irrelevant unless you expect to put the batteries in and leave it for years.

"No wiring" option is only available if you meet certain conditions. This option means you can connect only ground and the lamp to the board. This would be ideal for tailcap operations where the battery+ doesn't easily connect to the board. Incans would meet the conditions if the battery voltage is above 3.0V and the bulb draws at least 3W full on (it gets complicated if these requirements are not met, but it may be okay). LED lights are more complicated. The minimum battery voltage minus the voltage dropped by the LED/driver at low current must be at least 3.0V. It gets pretty hairy trying to predict this, but if the battery voltage minus the LED voltage is greater than 3.0V, you're probably okay. Also, if you use the "no wiring" option the maximum duty cycle of the lamp is about 95%. The exact number depends on many variables, but shouldn't be any less than this. 

For LED lights and low-voltage batteries, it's best if you make three connections to the board: B+, B-, and L- (the low side of the lamp, driver, or LED). If you do this, things should go pretty well until the battery voltage drops below 2.5V. Adding the third connection also allows 100% duty cycle

Updates on the UI will be available soon...

D


----------



## DIWdiver (May 31, 2011)

Comments are VERY welcome on the following:

The hardware offers thermal protection for both the on-board FET and the LED. The LED protection is only available if you wire a thermistor from the board to the LED. Actually you can stick the external thermistor wherever you want, but the LED heatsink would be the most obvious place.

My current intention is to set up the on-board thermistor to derate the current linearly from 100% to 0% as the temperature rises from 80C to 115C. The max junction temp of the FET is 175C, so this should provide ample margin. I wouldn't expect this to be a limitation in most circumstances. Keep in mind that the thermistor temperature is somewhat lower than the junction temperature.

The off-board thermistor will derate the current linearly as the temp rises from 70C to 90C. Since the LED max junction temp is probably 150C (true for both the SST-90 and the XM-L), this would appear to be only slightly less conservative than for the FET. However, the thermal resistance of the FET is much lower than that of either the SST-90 or the XM-L. Also, the placement of the thermistor next to the FET is the same in every case, and the results easily measured by me. Not so for the external thermistor. This makes the settings for the external thermistor much less conservative. But I hesitate to lower them, lest I prematurely shut down a good design.

Comments?

D


----------



## b-bassett (Jun 1, 2011)

as long as everyone knows to put the thermistor as close as possible to the LED, with the best possible thermal interface, i cant see any real danger in a max temp of 90C at the heatsink. no-one would be able to hold a torch that hot.
90C will allow a margin of error, in thermister placement/thermal interface, whilst still providing protection to the LED. 

Im sure a properly heatsunk LED would heat up the inside of a head enough, even if the thermistor was floating with little contact.

im more of a 'hands on' person though, thermal specs and such arn't my strongest subject.


----------



## Epsilon (Jun 1, 2011)

Make the switch battery powered like the FETtie, then you are never dealing with voltages of 3V to power this thing . And what I found: Chose your FET, so the part that needs to be cooled, is the BAT-, not the LED-. This way you can use any conducting compound instead of thermal adhesive tape, since there normally is nothing that has the LED- and a heatsink capability.


----------



## DIWdiver (Jun 1, 2011)

Epsilon said:


> Make the switch battery powered like the FETtie, then you are never dealing with voltages of 3V to power this thing . And what I found: Chose your FET, so the part that needs to be cooled, is the BAT-, not the LED-. This way you can use any conducting compound instead of thermal adhesive tape, since there normally is nothing that has the LED- and a heatsink capability.


 
Unfortunately, the current draw isn't low enough to make a small battery practical. The largest battery that would be practical in a tailcap is a 1632, at 120-140 mA-H. With a load of 35uA, it would only last only around 6 months, which I wouldn't consider acceptable. If you wanted to, you could wire a battery between B+ and B-, if you removed a diode from the board. It ought to work fine.

All the FETs I've looked at have thermal conduction primarily to the drain connection. And no matter how you wire the circuit, the B- never connects to the drain. Do you have an example? If so I'd love to see it.

But if you mount the board in the tailcap, it works great with the L- needing the heatsink. Once you bypass the original switch, the body of the light becomes L-, and the FET connects the body to the B- terminal. Since the board was designed to be mounted in the tailcap, it ends up using the tailcap as a heatsink. The L- terminal on the board includes a ring of bare copper at the edge of the board rests on the ledge of the tailcap, making both electrical and thermal contact. If you use compound, it must be conductive or it will interfere with proper operation, but in most cases I wouldn't bother.

Except for a moderate sized circle in the middle, the flat side of the board (opposite the L- ring) is B-, and attaching that to a heatsink would help a little. I wouldn't want to guess at how much.

P.S. I got notice that the boards shipped today!:twothumbs


----------



## DIWdiver (Jun 2, 2011)

Epsilon said:


> Make the switch battery powered like the FETtie, then you are never dealing with voltages of 3V to power this thing .



Okay, you got me thinking. If I gave up the Hall sensors, making the board useful for either piezo or contact type switches like a reed or a clicky, and intended it to be run off a separate 3V battery, the quiescent current (lamp off) could be gotten down to a few microamps. The battery wouldn't exactly last forever, but 28,000 hours (3 years) is good enough for me.

I could probably get the operating current as low as 0.5 mA, giving you around 250 hours runtime on the 1632 battery. Of course you'd get 3 years or 250 hours, not both. You'd get 1yr/160 hrs, or 2yr/80 hrs, or 2.7yrs/25 hrs, etc.

This would take modifying the firmware somewhat, and ideally re-doing the board to allow a standard battery configuration to be soldered in, so there would need to be some serious interest for me to want to do it. Otherwise, you could just use the regular board and accept the less-than-optimized battery life.

Comments welcome.

D


----------



## Epsilon (Jun 3, 2011)

About the L-, you are correct. I forgot this has to be mounted in the tail .

Personally, I don't mind changing the battery every 6 months if it is not that hard to do i.e. it does not require soldering parts. But thats very personal.


----------



## DIWdiver (Jun 10, 2011)

Epsilon said:


> About the L-, you are correct. I forgot this has to be mounted in the tail .
> 
> Personally, I don't mind changing the battery every 6 months if it is not that hard to do i.e. it does not require soldering parts. But thats very personal.


 
It doesn't HAVE to be mounted in the tail. It was designed to work well there, but it can be mounted wherever it's convenient. Most applications (up to 10A) will not require heatsinking.

A quick-change battery solution is not obvious to me, unless I solder some wires from the board to a connector and provide you some batteries with mating connectors. I could do that, but it's not a very elegant solution. Even if I re-spin the board, I don't see a good solution, without giving up some other features.

D


----------



## DIWdiver (Jun 10, 2011)

I got the boards today!

Actually the postman tried to deliver them yesterday, but I wasn't home, so I had to go to the post office today to get them.

This was quite ahead of when I expected them. I ordered 10 boards, got 12, less then 3 weeks, for $13.50. That's hard to beat! Even if I did have to go to the post office, show my ID, sign both electronically and on paper. That price is AFAIK is impossible to beat or even come close to. Nobody else seems to want to make boards for less than $100.00.

The boards look quite good, especially considering the price, but they made one little error. On one side the copper is supposed to go right to the edge of the board, but they pulled it back from the edge a little. Of course I had to try it out, and soldered a wire across the FET connections, then dropped it into a 2D MAG, and it works.

Now I just have to finish the firmware, build a board, debug both the board and the code, then I can offer some boards for test. I'll keep you posted on the progress.

D


----------



## b-bassett (Jun 13, 2011)

superb, let us know as soon as they becom avaliable, iv been putting off re-doing a few builds awaiting a decent driver for the piezo switch.


----------



## Epsilon (Jun 13, 2011)

DIWdiver said:


> I got the boards today!
> 
> Actually the postman tried to deliver them yesterday, but I wasn't home, so I had to go to the post office today to get them.
> 
> ...


 10 PCB's for 13.50? Thats a bargain indeed .

Interested in the results . You are doing a very good job!


----------



## DIWdiver (Jun 13, 2011)

The piezo circuit works!

I mounted one piezo in my MagD tailcap and a smaller one in the MagC tailcap. The smaller one works fine, but the bigger one takes a LOT of force to activate. This seems strange, since it appears almost identical to the one I did my initial experiments with, which takes very little force to activate. They have the same size, capacitance, and voltage rating, but vastly different performance in this application. I guess I'm off to Radio Shack to get another to play with.

Tomorrow I try programming the PIC.


----------



## b-bassett (Jun 16, 2011)

DIWdiver said:


> Tomorrow I try programming the PIC.


 

have fun !


----------



## b-bassett (Aug 4, 2011)

any luck getting these programmed?


----------



## DIWdiver (Aug 5, 2011)

b-bassett said:


> any luck getting these programmed?



Had a bit of trouble with the build. Those parts are way too small for easy assembly. My second board actually works, and programming is easy once you get the board built right.

I've found that only one of the four piezos I've tried works very well. After my initial success with the proof-of-concept, I've been gaining respect for the folks who make reliable switches with much smaller devices. 

I've gotten it to work, but before I try to make a big deal of it, I want to understand what makes one piezo work splendidly and another seemingly similar one not work (expletives deleted) well at all.

Mixed success plus a fairly low level of interest from the community, along with being rather busy with other things, has me not working on it much, so progress will be slow.


----------



## b-bassett (Aug 6, 2011)

> Mixed success plus a fairly low level of interest from the community, along with being rather busy with other things, has me not working on it much, so progress will be slow.



fair enough.

if i knew what i was doing id make and program my own, maby ill look onto it again.


----------



## DIWdiver (Oct 17, 2011)

Obviously there hasn't been much progress on this lately. I ran into technological hurdles I didn't expect, there hasn't been the kind of interest that I hoped for, and I've been busy on other things. As some of you know, that's a triumverate that's difficult to oppose. 

However, recent events have led me to discover a new circuit that dramatically improves the performance of piezo sensors, compared to the '555 based circuits I had been using. It's so simple it's actually embarrassing that I haven't thought of it before, and it allows ALL of the piezo elements I've tested to achieve a reasonable performance.

For anyonw interested, there will be some activity on this thread soon.


----------



## vestureofblood (Oct 17, 2011)

Hi DIWdiver,

Thanks for bringing this to the table.

I noticed in a couple of posts that you said interest from the community was not what you hopped. 

This is just MHO but if you could post either a schematic or a couple of pictures of what this circuit would look like installed in a light and how it hooks up etc I think you would see at least a bit of a gain in the attention given to it.


----------



## b-bassett (Nov 10, 2011)

thanks for the update. im sure there will be plenty of response once the right ppl see the potential


----------



## b-bassett (Dec 29, 2011)

i take it this is still on the back burner?




> recent events have led me to discover a new circuit that dramatically improves the performance of piezo sensors, compared to the '555 based circuits I had been using. It's so simple it's actually embarrassing that I haven't thought of it before, and it allows ALL of the piezo elements I've tested to achieve a reasonable performance.



i dont suppose you could enlighten us on this discovery? iv just cut up a damaged momentary piezo switch and was going to shove a 555 circuit in the case, but if theres something better ????


----------



## DIWdiver (Dec 29, 2011)

I'd be happy to share the discovery. I expected I'd be done with the prototype by now, but other things have been keeping me busy.

What I found works much better is a simple op-amp or comparator, with the piezo connected from ground to one input, and the other input biased at a few milliamps. I added a 22 megohm resistor across the piezo just to provide a DC path for the tiny input current of the op-amp.

Any op-amp or comparator with a maximum input offset of a few millivolts or less an an input bias current of 1 nA or less should work fine. There are literally hundreds to choose from.

With this circuit and the big piezo from a Radio Shack sounder (the element, when removed from the housing, just fits inside a Mag D tailcap), I can get prolonged outputs of over a minute. With smaller piezos, it's not hard to get outputs of several seconds. This circuit is far more sensitive than the '555 circuit, but it will not latch like the '555 can if you are careful (or careless?).

The problem with these things is that they are very sensitive to impacts. The slightest bump, especially with something hard, can cause a short output pulse. In my designs it's easy to de-bounce the signal inside the microprocessor, but with something like a TaskLed driver, you can't do that. You could reduce the sensitivity by increasing the bias voltage on the amp, or perhaps by adding a lowpass filter on the output.

Don


----------

