pic vs cigarettes


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Posts
    78

    Default pic vs cigarettes

    Objective:
    -to take one cigarette every 2 hours

    Mechanical description:
    -the cigarettes will be on a sliding tray who slide out of the box
    -the tray will be locked bye a latching solenoid
    -the box will have a “dumb” LCD to display the countdown “timer” (999 to 000)
    -The sensor (switch) will be normal open and will close when the tray is all the way out

    Parts:
    -microcontroller
    -latching solenoid
    -h-bridge
    -optoisolators
    -“dumb” LCD
    -spst switch

    Requirements:
    -The box (including the solenoid) should be powered by one 9v battery
    -The pcb shouldn’t be bigger than 1” diameter

    Logic:
    1.Configure the microcontroller, variables, …
    2.Lock the box
    3.Start the count down
    a.For LCD=999 to 0
    b.GoSub display_to_LCD
    c.Add delay 2hours/999
    d.Next
    4.Unlock the box
    5.Display_to_LCD
    6.END

    Questions:
    -Do you think the pic16F913 is suitable for this application?
    -Should I use external interrupts (by the switch) or just power on reset will be enough?
    -Should I use external or internal clock source (the 5% timing tolerance is acceptable)?

    Any recommendation regarding the circuit and programming are welcome

    Thanks in advance guys
    … from a newbie who try to quit smoking

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    Well described. I think the 913 has the LCD driver built in and as such is suited for this kind of application. Tray fully opened switch - thats something which might be an issue. What if you want to cheat on the timer? hehehe You could open the tray just half way and take a cigarette. I'd rather have the switch close when the tray moves out from fully closed position.

    Internal clock source will be just fine for this app. See 2 hours or 2hrs 1min dont really matter when it comes to avoiding a smoke.

    Why do you need interrupts? You may need to clarify this more. If this is battery powered, it makes sense to use sleep mode and an interrupt to notify the switch changeover to your program code.

    1" dia, possible.

  3. #3
    Join Date
    Jan 2009
    Posts
    78


    Did you find this post helpful? Yes | No

    Default what about

    At the beginning I was thinking to use external interrupts (INTE bit)…but anyway the interrupts will occur only at the END (point 6) of the cycle, when the uC will be in the sleep mode and the box was already unlocked.

    So, what about if I will use a reset circuit (pull-up resistor connected to the MCLR/Vpp pin + pushbutton switch connected to ground)… will not be the same for this application?…please take a look at the pictures
    Attached Images Attached Images  

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    Definitely a good idea. However, you should consider the SLEEP command to put the PIC in ultra low power mode while counting if you power this box by a battery OR you may get just a few hours of operation.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    that's an interesting way to quit smoking.. *cough* I'll have to try it!

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

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