A microcontroller and potentiometer for time intervals

Discussion in 'Programmer's Corner' started by Fuji, Jan 26, 2015.

  1. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    - I need suggestions on the type of micro controller I can use to make a count down/delay timer along with a potentiometer. Which one has the smallest features but enough memory to do this task?

    - Basically, when tuning the potentiometer say to 1 minute, the microcontroller will turn on the buzzer at 1 minute. If I tune the potentiometer say to 10 minutes, the buzzer should beep exactly at 10 minutes. Tuned to 30 minutes, it beeps at 30 minutes, etc... All buzzing would only buzz for 30 seconds.

    - Does it only require that a potentiometer and a capacitor be used along with the micro controller and that is it?

    Some time interval options I thought of for the timer when using the potentiometer:
    Minutes: 5 - 10 - 15 - 20 - 25 - 30
    Minutes: 10 - 20 - 30
    Minutes: 15 - 30 - 60
     
  2. ericgibbs

    AAC Fanatic!

    Jan 29, 2010
    2,501
    380
    hi,
    A 12F683 PIC , using the internal osc, together with AN0 set as 10 bit ADC , controlled by a 10K pot should be OK for your project.

    £
     
    Fuji likes this.
  3. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    Thank you. Quick reply, and an affordable micro controller too :).
     
    Last edited: Jan 26, 2015
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Let's see, you need one input and one output, plus a small smattering of code. Additionally, there is simply no accuracy spec given so ay timebase source can be used, including a simple R/C network. An analog to digital input is not even necessary given the wide open limits so a digital input can be used to read the pot value by using the "let the pot charge a cap and read the time" trick.

    Therefor any and all microcontrollers are contained in the set of devices capable of performing this task.
     
    Fuji likes this.
  5. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,357
    +1
    Any microcontroller will do it. You don't need ADC or analog inputs, even for reading a pot.
    Are you stuck on the idea of using a pot?
     
  6. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    The reason for me using a pot is because its just a plain analog that im using for the enclosure box. Since I don't have a matrix membrane or buttons and an LCD display to set time, I thought a simpler way is to use a pot and two LED's. One LED to indicate the timer is on, and the other LED to flash when the time has reached and a sound will buzz for approximately 30 seconds .

    Using a microcontroller for me is far easier and headache free for me since I was building a count down timer with 555 and 4060B with multiple components - which was a headache.
     
    Last edited: Jan 27, 2015
  7. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,357
    The question that I am asking is if you want to select different times, is a continuous rotary knob the only way you want to do this?
    Can a click multi-position rotary position work for you? Or a small rotary or DIP switch?

    How about a single push button and 4 LEDS to indicate selection?
     
  8. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    Thanks for the reply.

    Well, I am using a continuous rotary knob. I thought of rotary dip switches/ click position knobs but they look really expensive even for one piece.

    Seems like the dip swtiches/click position knobs look more stable, but I may need an entire hour of positions. [ 0 - 5 - 10 - 15 - 20 - 25 - 30 - 35 - 40 - 45 - 50 - 55 - 60 ], including the numbers from within. I guess the continuous rotary knob would help for this you think? (Maybe a 10K potentiometer?)

    A single push button I though of as well, but Id rather have the device turn on with the specified time interval of the knob already in place instead of having to save the exact time into to the microcontrollers memory when the device turns back on. Little extra coding there I guess.
     
    Last edited: Jan 27, 2015
  9. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,357
    The devil is in the details... and ergonomics.

    For what application are you planning to use the timer?
     
  10. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    I see...???

    It is a frequency to "cure" certain body illnesses. A frequency has its time limit. Therefore, a count down timer is necessary to not prolong the frequency, as suggested by hulda clark. So as I see it, either you look at the clock many times for 10-20 minutes (annoying and slow), or you let a buzzer indicate the time is up and the frequency should be turned off.
     
    Last edited: Jan 27, 2015
  11. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,675
    2,722
    Snake oil...
     
  12. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    And what are the benefits of snake oil?
     
  13. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,675
    2,722
    Why, it'll cure everything! Even hangnails and halitosis.
     
  14. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    :eek: whoa really? I should have known. Where can I find a snake?

    :D lol
     
  15. MrChips

    Moderator

    Oct 2, 2009
    12,421
    3,357
    Last edited: Jan 27, 2015
  16. KL7AJ

    AAC Fanatic!

    Nov 4, 2008
    2,039
    287
    This is easily done with Arduino...but probably major overkill :) How accurate do you need it....maybe a 555 and a few dividers is all you need
     
  17. Fuji

    Thread Starter Member

    Nov 8, 2014
    100
    1
    Accurate enough really. I thought of a CMOS 555 timer, but everybody keeps saying to throw that thing back in the museum if you know what I mean. :D

    4060B with a 555 timer sounds reasonable since I can place a crystal with the 4060B for better accuracy, but then again I always get the end solution to be a microcontroller. Lesser components I assume.
     
  18. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    "Accurate enough" is a wide open spec, though I guess using a potentiometer as the adjustment gives you plenty of leeway to pass any sort of accuracy spec.

    The '555 is one of those fundamental parts designed just right for a wide variety of uses. However, it is not so good at long delays (due to the large external cap required) so it makes a poor choice for this application.
     
    Fuji likes this.
Loading...