1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

School Bell Controller Final Project - PIC16F628A

Discussion in 'Microcontrollers' started by Gayan Soyza, May 31, 2007.

  1. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,822
    Likes:
    19
    Location:
    Colombo
    Hi!

    I just want to show you all a project I recently made, it named as SCHOOL BELL CONTROLLER designed under a PIC 16F 628A.

    The purpose to build this project is its fully automatically controlling the bell in each school periods. So no need manually ring the bell in each period by the user or no need a computer program to operate the Bell.

    Even if this can done with a simple timer IC or from counters (without a microcontroller)
    It’s hard to add more options or displays to that to work the circuit very accurately.

    So I planned to do like this way.

    [​IMG]

    Operating the School bell controller?
    Some fancy features

    *Manual Mode – anytime operator can ring the bell manually while the circuit is running.
    *Any time START operation – operator can switch ON the circuit at any time or can adjust if it is inaccurate.
    *COUNT DOWN - timer to check the accuracy or whether it is working correctly.
    *Period notification -In each bell ring displays the correspond period.
    *Display check – to check the two segments working correctly when power up.
    *Automatically turn off - After last bell automatically turn off feature.
    *Battery backup
     

    Attached Files:

    Last edited: Aug 1, 2007
  2. upand_at_them

    upand_at_them Member

    Joined:
    Apr 23, 2005
    Messages:
    609
    Likes:
    8
    Location:
    Pennsylvania, U.S.
    Very nice.

    Mike
     
  3. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Looks good. Nicely done.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Suraj143

    Suraj143 Active Member

    Joined:
    Jan 11, 2007
    Messages:
    1,586
    Likes:
    2
    Location:
    South Mald Isld

    Wow What a project.It was well planned.Also your drawings looks nice to mee.
     
  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,235
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi gayan,

    Looks good to me.

    What's the PP3 battery for??

    Do you have a box/enclosure for the pcb/display assembly?

    Are those little white clouds on the circuit diagram , puffs of smoke?? :rolleyes:

    Regards
     
    Last edited: May 31, 2007
  7. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Something to consider,
    Use a 32768 hz watch crystal instead of the 4mhz crystal.
    The wee 32khz will not only run at much lower power than 4mhz its also more accurate and easier to divide into seconds (use timer 0 and 1:32 prescaler for an exact 1 second overflow)
     
  8. Shax

    Shax Member

    Joined:
    Jan 8, 2007
    Messages:
    172
    Likes:
    3
    Location:
    London
    I like the circuit diagram.. Looks very cool. What did you use to make it?

    Nice application, and well thought out.. 10/10 :D
     
  9. bananasiong

    bananasiong New Member

    Joined:
    Mar 7, 2006
    Messages:
    1,893
    Likes:
    7
    Location:
    Malaysia
    I've heard that using a crystal as oscillation clock, at the same time another crystal is used at T0CK1 for counter. But I haven't seen anyone is using this, just heard about this.
     
  10. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,822
    Likes:
    19
    Location:
    Colombo
    Thank you Guys.

    Hi Eric

    This battery for the backup power supply if the AC power turns OFF.
    Also there is a small DIP switch in the layer2 board to turn ON/OFF the battery back up.

    9V battery can supply the circuit for 8 HRS until school over. I have dropped down its voltage to 5.1V.After last bell circuit enters to the SLEEP mode.

    If no AC power the AC Bell also not working. But the circuit is running until the power comes. For sudden AC mains fall offs or the delay when shifting to the generator this battery very useful.

    For the time being I don’t have an enclosure. I’m planning to build one. Just now I found a plastic sheet shop.

    Puffs of smoke are call outs :D

    Hi blueroomelectronics

    The low power crystal is good, but due to unavailability of that 32 KHz I shifted to standard 4 MHz.

    Otherwise I have to sacrifice a working wrist watch for this project :rolleyes:

    In overall, considering power, spacing, coding, accuracy the watch crystal is ideal.
     
  11. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Too bad the 32KHz crystal is a hard to get where you are. They are very delicate and might be a trick to desolder.
    TMR1 can use the 32KHz and your PIC could run from internal RC , you can even put it to sleep and TMR1 will wake it up when it overflows (2seconds or multiples of 2sec)

    Could run for days. Also make sure your LEDs are really off.
     
  12. pasanlaksiri

    pasanlaksiri Member

    Joined:
    Aug 28, 2006
    Messages:
    328
    Likes:
    4
    Location:
    Sri Lanka
    This is nice
     
  13. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    Very nice Gayan.

    Looks like a well thought out project.

    Mike.
     
  14. savnik

    savnik New Member

    Joined:
    Apr 27, 2006
    Messages:
    82
    Likes:
    0
    Which programm you use to make it;
     
  15. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,822
    Likes:
    19
    Location:
    Colombo
    Hi I’m using MS excel drawing tools & Adobe Photoshop. It’s a mixture of both.

    I like my drawings to be visually colorful other than ordinary circuit diagrams :)
     
  16. Hero999

    Hero999 Banned

    Joined:
    Apr 6, 2006
    Messages:
    14,902
    Likes:
    79
    Location:
    England
    Looks like someone already wants your good grades. :rolleyes:
     
  17. kjennejohn

    kjennejohn New Member

    Joined:
    Mar 19, 2006
    Messages:
    338
    Likes:
    8
    Location:
    Bay Area, California
    Nice going, Gayan.
    Next time you want to implement a timer or a clock consider using the mains as your clock source. It is highly regulated throughout the day, and is readilly available. Even crystals wander a bit due to temperature variations. Power your circuit off a simple AC wall wart. Tap off the power-in jack, before the rectifier. Run this voltage through a 1N4148 signal diode (or similar, watch the polarity!) and a two resistor voltage divider to get it down to 5V or less. Use a serial resistor, 1K Ohm or so, inline to the PIC pin, to protect the PIC from the occasional AC spike. Run this 50 or 60 Hz signal to an internal comparator (the '628A has two) set to the appropriate Vref. Every time the rising wave hits the Vref setting an interrupt can be used to increment a software counter. If interrupts are not what you want, simply poll the comparator's flag bit to detect when the threshold has been reached and then follow through in your code.

    Of course you will have to add a rectifier, filter caps and regulator, but that's the trade off for a simple clock source that has successfully run wall clocks pretty accurately since Tesla convinced people to use AC generators to supply power.

    'Luck in your project.
    kenjj
     
  18. Hero999

    Hero999 Banned

    Joined:
    Apr 6, 2006
    Messages:
    14,902
    Likes:
    79
    Location:
    England
    I personally don't like using the mains as a frequency source because it might go wrong if I decide to run it from an inverter or in another country. Also other countries might not have such a procise frequency as the US and Europe; I don't know how accurate it is in Colombo, Sri Lanka.
     
  19. Sig239

    Sig239 Member

    Joined:
    May 25, 2006
    Messages:
    223
    Likes:
    0
    Location:
    USA-Ohio
    Very nice Gayan! Perhaps you could also ring the bell at the end of the forty minute periods and allow a time between periods to get to the next class.
     
  20. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,822
    Likes:
    19
    Location:
    Colombo
    Hi Kenjj

    I went through your idea. It helped me in my upcoming project.
    I put your idea other way.
    It means taking AC mains as the CLOCK SOURCE or as a SIGNAL to detect whether the AC mains have stable 230V/50Hz value, and if it has come to this value (230V/50Hz) can provide the output. If not settle (not reached) triggering a false signal.
    Because here we have a very poor mains supply.
    Also here AVG TEMP = 28 C no too much cool & no too much hot.
    I checked the accuracy with some real time clocks almost perfect in this circuit. The circuit runs maximum 6 hours per day. So for 6 hours accuracy percentage is almost full.
     
  21. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,822
    Likes:
    19
    Location:
    Colombo
    Hi Sig239

    I had your idea in the very first time before designing this circuit.
    But here the period change time is grabbing from the next period. Also in earlier manual systems there’s no bell rings in period change times.
    Sometimes in the upper school classes two periods time take as a one period. This called double periods.
    If somebody needs a bell ring in between the period change time can develop easily. But here I didn’t add that.
     

Share This Page