my project Capacitive Sensing LED dimmer 12F1822 via PWM


Closed Thread
Results 1 to 40 of 43

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    I like your PIC power supply. What is the expected life of that zener? Little current = forever?

    Robert

  2. #2
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    I didn't know that zeners had a limited life span.

    One thing that did occur to me (during the night ) is that this type of power supply would limit the PIC's ability to provide a "high" output with any amount of current. So if you want to use those pins for something else you would want the active state to be a LOW or ground, or change the value of the 10K resistor to a lower value.

    I did measure the current draw at 0.9 ma.

    I designed this to specifically be an emergency light or camping light so I wanted the PIC to draw as little power as possible in the OFF state.

    With a 7 amp hour gel cell it should last quite a while drawing only 1ma.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Quote Originally Posted by Heckler View Post
    I didn't know that zeners had a limited life span.

    ...
    I don't know, that's why I'm asking. I've thought of this idea before but didn't know if it was reliable, or what the limitations were.

    I kept thinking it was too simple to be true and wondered why I didn't see anyone else doing it.

    Robert

  4. #4
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Quote Originally Posted by Demon View Post
    I don't know, that's why I'm asking. I've thought of this idea before but didn't know if it was reliable, or what the limitations were.

    I kept thinking it was too simple to be true and wondered why I didn't see anyone else doing it.

    Robert
    This approach is often used as a voltage reference, but rarely as a power supply because it's very inefficient and has lots of other issues. You need to size the resistor so the voltage across it does not cause a troublesome dip in the VDD voltage at peak currents. Typically, you would need to have about 10x the current the PIC needs flowing all the time in the zener. A much more robust approach would be to put this circuit to the base of a NPN transistor, with the collector on the supply rail and the emitter on VDD. Then you can reduce the quiescent current consumed by roughly the gain of the transistor.
    Anyway, this circuit is fine for a demo or an application where there's lots of free current. Of course, every time the PIC takes a sip of current, noise is induced on VDD. Maybe it doesn't matter - but anything with an ADC using VDD as reference won't be happy. Note it will have a much better sense of humour with a big cap across the zener for those computational gulps of current. Of course, then it will come up slowly, which might cause other issues. In the end, a 3 terminal regulator is the easiest, and may even be the cheapest solution.

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Quote Originally Posted by Heckler View Post
    ...

    One thing that did occur to me (during the night ) is that this type of power supply would limit the PIC's ability to provide a "high" output with any amount of current. So if you want to use those pins for something else you would want the active state to be a LOW or ground, or change the value of the 10K resistor to a lower value.

    ...
    What if you just used VDD (pin 1) as your source, couldn't you then do as you please with that "regulated" 5V?

    Edit: ok, I see where you're going. Even using a transistor on the pin, you're still limitted by what can pass through the resistor.

    What if you use a higher wattage resistor?

    Glue a heatsink on it.

    Robert
    Last edited by Demon; - 1st December 2013 at 19:02.

  6. #6
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    I would use LDO with low Iq, eg. tps709135
    And put pic in sleep, wake up with timer interrupt, do things, back to sleep...
    This way you can get average current very low, under 100uA.

  7. #7
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Wow, I didn't know they made voltage regulators with that low of idle current.

    My intention was to be able to leave the ckt connected to a, say 7 Ah, gel cell battery for at least a few weeks.
    I will probably add to the circuit board a jumper or small switch to completely disconnect the ckt for storage. Even 1 ma will use up 8.76 Ah in a year. Probably not much more than the self discharge of the batt, though.

    For a hobbyist though the junk box is your friend. That regulator is a bit esoteric and the shipping cost would drive up the cost for just a few items.

    If you study Zener regulator ckts they are somewhat inneficient if your current needs vary by much. This ckt would get below 2 volt if the current draw gets over 1ma with a 12V source. Since my ckt pulls a bit less than that I am OK. Actually now that I look at it I may want to lower the 10K resistor to say a 5K or so. It's all just experimentation at this point.

    If one wants to be able to draw more current for the other PIC pin outputs then it quickly becomes necessary to use a lower value resistor.

    I'm sure a good electronics engineer could shred this idea for any kind of commercial application.

    Mostly I was determined to get the Cap Sense working and be able to evaluate its suitability for other applications.
    Sometimes I just enjoy the challenge of figuring out these Little PICS and what they are capable of. They truly are amazing what is in these little packages for such a few dollars.

    For example the APFCON register. It allows you to move the function of some of the PIC peripherals from one pin to another if needed!! (which I did need to do with the PWM from A.2 to A.5)
    Last edited by Heckler; - 1st December 2013 at 21:42.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  8. #8
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Ok Demon,

    You got me thinking and as I did some more measuring I found that, with the 10K R, I had only 2 volts to the PIC. Which is ok but mabie a bit low. So I switched out the resistor to a 4.7 K and now I have 3.95V to the PIC and the current draw is 1.7ma (0.0017Amps)

    I used one of these... http://www.eevblog.com/projects/ucurrent/
    to measure the current

    The zener is probably still not working too hard to control the voltage yet (not sure how sharp the zener voltage point is)

    Any way I just wanted a simple way to power this ckt from the 12 to 15 Volt source battery.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  9. #9
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    If anybody is interested I have modified the CODE so that the light turns off after 30 minutes.

    not too hard to do, but I'd be glad to post it.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    I'd use Darrel's interrupts and check the Minutes. Is that the easy way out?

    Is it more efficient to use another method?

    Robert

  11. #11
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Quote Originally Posted by Heckler View Post
    If anybody is interested I have modified the CODE so that the light turns off after 30 minutes.

    not too hard to do, but I'd be glad to post it.
    C'mon Dwight, Post it, you know you want to. Somebody will see it and learn something from it, possibly me.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. 16F726 Capacitive sensing module
    By Byte_Butcher in forum General
    Replies: 39
    Last Post: - 15th May 2014, 19:40
  2. Need help setting up Capacitive Sense 12F1822
    By Heckler in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th November 2013, 21:10
  3. Replies: 1
    Last Post: - 6th August 2012, 10:57
  4. Capacitive sensing module on 16f1936
    By grahamg in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 25th April 2010, 14:17
  5. mTouch capacitive sensing
    By jrprogrammer in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 1st November 2008, 22:54

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts