Home
Microcontroller-based Bill-to-Coin Changer with
Contents
1. 5 00 2 pcs 2 pcs S ful 4 P10 00 pc pc 256 20 pcs 20 pcs 8 P1 00 5 pcs 5 pcs Successful P5 00 2 pcs 2 pcs P1 00 5 pcs 5 pcs 9 P5 00 1 pc 1 pc Successful P10 00 pc pc 256 4 pcs 4 pcs P1 00 4 pcs 4 pcs 10 S ful P5 00 1 pc 1 pc 10 00 pc pc Table 8 20 peso Bill Output Test Note Failed incorrect number of coins was dispensed Successful correct number of coins is dispensed In the 20 peso bill output result Table 8 sets 1 and 2 have failed the tests Set 1 failed because the input of the user of 80 pieces 25 cents is not equal to the dispensed coins output which are only 78 pieces For Set 2 it has failed because the output is only 19 pieces 1 coins instead of the input of 20 pieces The errors are caused by unguided flow of centavo coins from the coin dispenser to the coin cargo and the narrow gap between the 1 coin holder PVC tube and the platform where the metal shaft kicks the coins The errors are tolerable with just 1 2 input output difference and 2 out of 10 failed sets Inserted Bill P50 00 46 Set Denomination s Input Output Result 1 25 200 pcs 200 pcs Successful 2 P1 00 50 pcs 50 pcs Successful 3 P5 00 10 pcs 10 pcs Successful 4 P10 00 5 pcs 5 pcs Successful P1 00 30 pcs 30 pcs 5 S ful P5 00 4 pcs 4 pcs mec P1 00 40 pc
2. 18 Liquid Crystal Display LCD is a thin flat display device made up of any number of color or monochrome pixels arrayed in front of a light source or reflector Whatls the Leading IT Encyclopedia Microcontroller MCU or uC is a computer on a chip a type of microprocessor emphasizing high integration low power consumption self sufficiency and cost effectiveness in contrast to a general purpose microprocessor Wikipedia the Free Encyclopedia Motor electrical uses electrical energy to produce mechanical energy which is found in household appliances such as fans refrigerators washing machines pool pumps floor vacuums and fan forced ovens Answers Online Dictionary and Encyclopedia Phototransistor is a bipolar transistor that is encased in a transparent case so that light can reach the base collector junction it works like a photodiode but with a much higher responsivity to light because the electrons that are generated by photons in the base collector junction are injected into the base and this current is then amplified by the transistor operation Wikipedia the Free Encyclopedia Potentiometer is a variable tapped resistor that can be used as a voltage divider it is commonly used as controls for electrical devices such as volume control of a radio Wikipedia the Free Encyclopedia Random access memory RAM is a type of computer data storage that allows the stored data to be accessed in any order i e at rand
3. CEGEDHIG Rp SOTTO Vishay Semiconduct Transmissive Optical Sensor with Phototransistor Output Description This device has a compact construction where the emitting light sources and the detectors are located face to face on the same optical axis The operating wavelength is 950 nm The detector consists of a phototransistor B gt is Applications A e Contactless optoelectronic switch control and counter 15136 Features e Compact construction No setting efforts e Polycarbonate case protected against ambient light e 2 case variations e 3 different apertures e CTR selected in groups regarding fourth number of type designation Order Instruction Ordering Code I Aperture mm 1 5711037 TCST21035 With two flags TCST12029 ITCST13009 TCST23000 mounting flags mounting flags With two mounting flags TCST1202 No mounting flags TCST22026 With two mounting flags 92 93 TCST110 up to TCST230 Vishay Semiconductors Absolute Maximum Ratings Input Emitter Power dissipation Junction temperature Output Detector Collector emitter voltage 70 Emitter collector voltage Vgo 7 V Collector 10 Powerdissipation 11 lt 5 Py 10 mW Junction temperature 1 130 C Coupler Test Conditions Total pow
4. The circuit in Figure 17 is the typical connection of L200 to form a battery charger C1 and C2 are used to smooth the voltage input and output Pin 2 LIM and Pin 4 VREF are responsible for current and voltage regulation respectively Both pins have internal voltmeters that measure 38 corresponding voltages in the output R3 is used to maintain 1A of current from Pin 5 OUT regulated by L200 through Pin 2 1A is the rated charging current for Lead Acid batteries R1 and R2 form a voltage divider where the input is the voltage coming from the batteries and the output is the one going to Pin 4 The fraction of voltage that goes to Pin 4 sets the float voltage going out of Pin 5 This float voltage is a constant voltage applied continuously to the lead acid batteries it maintains the cells in a fully charge condition when power line is available So overcharging is not a problem since float voltage is only applied to the batteries The only disadvantage is that the batteries will charge slowly compared to smart chargers SAZSPSIT SJ gt gt To Vin of Figure 17 AC Source 4 N BR 86D BRIDGE Rectifier 26 SUPPLY Figure 18 Power Supply Circuit Figure 18 shows the circuit of the AC to DC Power Supply with model WY 03C It is plugged into 220Vac socket which is reduced to 12Vac and rectified to 12Vpc 12Vpc is connected to the Vin of the backup battery circuit in Figure 17 Each of
5. calibration test functionality which ensures that the color of the inserted bill is synchronized with the color detected by the system 8 The device has backup battery in case of power failure 15 In contrary to the functionalities of the design the device has also a range of restrictions The following are the limitations which the design cannot accomplish 1 device cannot correctly identify bills other than 20 50 and 100 peso bills The device cannot dispense coin denominations other than the scope e g 5 cents and 10 cents The device can only change one bill per transaction The bill is not retrievable once inserted in the system The device cannot differentiate a non Philippine peso authentic bill with the same color as the scope e g 20KD is also color red like P50 00 thus when it is inserted the system will identify it as P50 00 Very old or faded peso bills may not be recognized as to their respective values The coin dispenser of the device can only hold a maximum of 300 coins container The device cannot identify if there was a pending transaction prior to power interruption The backup battery of the device will last for approximately 4 hours during power failure 16 Definition of Terms Analog to Digital Converter A D is an electronic integrated circuit which converts continuous signals to discrete digital numbers Wikipedia the Free Encyclopedia Buzzer is a signaling device usually
6. 0 key 255 While Num lt gt 16 Num InKey Wend While key lt gt Num InKey DelayMS 50 key LookUpL Num 0 0 7 8 9 0 4 5 6 0 1 2 3 0 255 If key Then Cls Print At 1 1 ENTER PIECES Print At 4 1 Clear Enter Number 0 EndIf If key lt 10 Then Number Number 10 key 69 70 If flag 25c 1 Then If Number lt 301 Then centavo Number EndIf If Number gt 300 Then centavo 300 EndIf EndIf 1 Then If Number lt 101 Then onepeso Number EndIf If Number gt 100 Then onepeso 100 EndIf EndIf If flag 5p 1 Then If Number lt 21 Then fivepeso Number EndIf If Number gt 20 Then fivepeso 20 EndIf EndIf Ifflag 10p 1 Then If Number 11 Then tenpeso Number EndIf If Number gt 10 Then tenpeso 10 EndIf EndIf Print At 2 1 Number Piece s EndIf While Num lt gt 16 Num InKey DelayMS 50 Wend Wend Cls Clear Number flag 0 flag 5p 0 flag 10p 0 flag 25 0 Return Exit2 End 71 APPENDIX C PCB Layouts BOR 10K 3296 Bill Detector PCB Layout Bill Detector Foil Pattern Layout 72 Microcontroller Board PCB Layout 99 43W09 Microcontroller Board Foil Pattern Layout Relay Driver PCB Layout jid din Relay Driver Foil Pat Counterfeit Sensor and Coin Sensor Foil Pattern Layout APPENDIX D NPN G
7. 3 Then test fake If key 1 Then show cb GoTo menu mainloop test fake portd cmp PORTD High PORTB 7 ctr 0 test fakeloop If PORTC 6 0 Then High PORTC 7 Cls Print At 1 1 WARNING Print At2 1 COUNTERFEIT PrintAt3 1 DETECTED DelayMS 3000 Low PORTC 7 GoTo menu main EndIf If PORTD lt 3 Then menu main If PORTD gt 5 Then menu main ctr 1 DelayMS 1000 GoSub msg billdetect If ctr 3 Then detect valloop GoTo test fakeloop detect valloop If PORTD lt gt portd cmp Then menu main If PORTD 00000011 Then bill_ val 20 GoTo show_amt EndIf If PORTD 00000100 Then bill val 50 GoTo show amt EndIf If PORTD 00000101 Then bill val 100 GoTo show amt EndIf GoTo detect valloop show amt High PORTA 3 Cls Print At 2 1 PLEASE WAIT Print At 3 1 FEEDING BILL DelayMS 5000 Low PORTA 3 Cls Print At 1 1 Amount to Change Print At2 1 P Dec bill val 00 Print At3 1 Print At 4 1 Press show amtloop GoSub getkeys If key 3 Then menu denom GoTo show amtloop menu denom Cls Print At 1 1 1 25 Cents Q centavo Print At 2 1 2 1 onepeso Print At 3 1 3 5 fivepeso Print At 4 1 4 10 Peso tenpeso DelayMS 500 menu denomloop GoSub getkeys If key 10 Then DelayMS 150 GoTo enter 25c EndIf If key 11 Then DelayMS 150 GoTo enter 1 EndIf If key 12 The
8. val 00 DelayMS 750 Cls Print At2 1 PLEASE WAIT Print At 3 1 DISPENSING COINS DelayMS 500 dispense 25cloop If centavo 0 Then Low 5 GoSub show dispctr GoTo dispense EndIf High PORTA 5 If PORTA 4 0 Then DelayMS 350 centavo centavo I cb 25 cb 25c 1 GoSub show dispctr EndIf GoTo dispense 25cloop dispense 1ploop If onepeso 0 Then Low PORTA 0 GoSub show dispctr GoTo dispense 5ploop EndIf High PORTA O If PORTE 0 0 Then DelayMS 350 onepeso onepeso 1 cb 1 1 GoSub show dispctr EndIf GoTo dispense dispense 5ploop If fivepeso 0 Then Low PORTA 1 GoSub show dispctr GoTo dispense lOploop EndIf High PORTA 1 If PORTE 1 0 Then DelayMS 350 fivepeso fivepeso 1 cb 5p cb 5p 1 GoSub show_dispctr EndIf GoTo dispense 5ploop dispense 10ploop If tenpeso 0 Then GoSub show dispctr Low PORTA 2 bill val 0 centavo 0 onepeso 0 fivepeso 0 tenpeso 0 64 65 coin totval 0 GoTo msg success EndIf High PORTA 2 If PORTE 2 0 Then DelayMS 350 tenpeso tenpeso 1 cb 10p cb 10 1 GoSub show dispctr EndIf GoTo dispense lOploop msg billdetect Cls Print At 1 1 PLEASE WAIT Print At 2 1 BILL DETECTION 1 Print At 3 1 IN PROGRESS Return msg error Cls Print At 1 1 SORRY The Desired Print At 2 1 Denominations Total Print At 3 1 Value is NOT EQUAL Print At
9. LCDs are their low cost and low power consumption LCDs are ideal in low power battery operated portable applications These displays come in different shapes and sizes Some LCDs have 40 or more 11 characters with several rows Some more advanced LCDs can be programmed to display graphics images Some modules such as the ones used in games offer color displays while some others may incorporate back lighting so that they can be viewed in dimly lit conditions Color Light and Sensor Color is a visual perception property which is derived from the spectrum of light interacting in the eye Color groups and physical specifications are often associated with objects materials and light sources based on their physical properties such as light absorption reflection or emission spectra HSV representations of points in RGB color space represents hue which is the aspect of a color described with names such as yellow etc On the other hand 5 represents saturation which is determined by combination of light intensity and how much it is distributed across the spectrum of different wavelengths The most important is or value because it is used in determination of the value of the bill in the design Value is the lightness or darkness of a color it is found useful in determining the kind of bill when using an LDR as a sensor For the particular design the system is limited only to detect P20 0
10. Shock Mechanical 1 000m s 1006 appraximetaty Operating Humidity 20 tess RH iion condi bd Mechanical Data Termination Printed circuit terminals Enclosure 84V o Flammability Ratings SRUDH SS Vanted Flux tignt plastic cover SRUDH SH Sealed plastic case Woight 0 42 127 approximately Operation amp 191 91 SRUDH Miniature Power PC board relay 2 Enclosure 55 Vent Flux tignt plastic cover SH plastic 4 Coll Voltage EVDC 12 12VDC 48 48 0 09 24 24VDC 6 Contact Arrangement Bl k 1 Form C SPDT M 1 Form SPST NO 8 Suffe 000 Standard medal Other Suffix Custom model Na matatie for inmenin cheating Our authorized distributors are more likely to maintain the following Items In stock for Immediate delivery SRUDH SH 11201 000 SRUCHSH TI2DMT 000 SRUDH SH 124D 000 SRUCHSH T24DMT 000 Outline Dimensions Wiring Diagram Bottom View 1 Board Layout Bottom View Socket Hold Down Spring 27 1064 sockat is rated 10A 300VAC UL Recognized for US and 20C430 spring is designed to sacure SRUDH raky in 27 1064 socket Canada Designed to ft sama suggested board yout as relay de WAX So ry L J im Inka over releranca any pintan unies doct o change Tomar NM 443 APPENDIX I Optical Sensor Data Sheet
11. Table 4 Bill Value Detection Test prelim inary testing Bill Inserted Detected Value Result P20 00 P20 00 Successful P50 00 P50 00 Successful P100 00 P100 00 Successful P200 00 P20 00 Failed 500 00 50 00 Failed P1000 00 P50 00 Failed Table 5 Bill Value Detection Test final testing Note Failed incorrect value of the inserted bill is detected Successful correct value for the inserted bill is detected Tables 4 and 5 show the results of the tests done to see if the system could detect bills other than 20 50 and 100 peso bill Notice that tests for the P200 00 P500 00 and P1000 00 peso bills failed This is because the bill acceptor is designed only to detect bill values of P20 00 P50 00 and P 100 00 Other bills inserted may result to erroneous and 43 44 unexpected values After the test the proponents decided to test old and faded bills to check whether the system still detects the value of the bill accurately Table 6 shows the results of inserting old and faded bills Bill Inserted Detected Value Result P20 00 P50 00 Failed P50 00 P50 00 Successful P100 00 P100 00 Successful Table 6 Bill Value Detection of Old Bills Test Notice that the P20 00 bill failed One primary cause of this is that the true color of it is somewhat darkened due to the fact that it is worn out and faded Thus the system erroneously distinguished the v
12. The HD44780U dot matrix liquid crystal display controller and driver LSI displays alphanumerics Japanese kana characters and symbols can be configured to drive a dot matrix liquid crystal display under the control of a 4 or 8 bit microprocessor Since all the function such as display RAM character generator and liquid crystal driver required for driving a dot matrix liquid crystal display are internally provided on one chip minimal system can be interfaced with this controller driver A single HD44780U can display up to one 8 character line or two 8 lines The HD44780U has pin function compatibility with the HD44780S which allows the user to easily replace an LCD II with an HD44780U The 4478017 character generator ROM is extended to generate 208 5 8 dot character fonts and 32 5 x 10 dot character fonts for a total of 240 different character fonts The low power supply 2 7V to 5 5V of the HD44780U is suitable for any portable battery driven product requiring low power dissipation Features e 5x8and 5 x 10 dot matrix possible e Low power operation support 2 7 to 5 5V Wide range of liquid crystal display driver power 30 to Liquid crystal drive waveform One line frequency AC waveform e Correspond to high speed MPU bus interface 2 MBz when V 5V e 4 bit or 8 bit MPU interface enabled e 50 8 bit display RAM 80 characters max 9 920 character generat
13. electronic which most commonly consists a number of switches or sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed and usually illuminates a light on the appropriate button or control panel and sounds a warning in the form of a continuous or intermittent buzzing or beeping sound Wikipedia the Free Encyclopedia Complementary _metal oxide semiconductor CMOS is a major class of integrated circuits that is used in microprocessors microcontrollers static RAM and other digital logic circuits it uses complementary and symmetrical pairs of p type and n type metal oxide semiconductor field effect transistors MOSFETs for logic functions Webopedia Computer Dictionary Direct Current DC is the unidirectional flow of electric charge which is produced by such sources as batteries thermocouples solar cells and commutator type electric machines of the dynamo type it may be obtained from an alternating current supply Wikipedia the Free Encyclopedia Electrically Erasable Programmable Read Only Memory is user modifiable read only memory that can be erased and reprogrammed repeatedly through the application of higher than normal electrical voltage it does not need to be removed from the computer to be modified but it has to be erased and reprogrammed in its entirety not selectively WhatlIs the Leading IT Encyclopedia 17 Electromotive force EMF is the ene
14. pcs 10 P1 00 5 pcs 5 pcs Failed P5 00 2 pcs 2 pcs P10 00 1 pcs 1 pcs Table 10 100 peso Bill Output Test Note Failed incorrect number of coins was dispensed Successful correct number of coins is dispensed Not Possible the operation is not viable In the 100 peso bill output test Table 10 only set 10 has a failing result with 2 input output differences Set 10 failed because only 298 pieces of coins are dispensed output by the system instead of 300 pieces which is the input of the user The error is caused by the same reason as before thus the proponents placed a guide on each of the coin path from the coin platform to the coin cargo On the other hand notice that set 1 has a Not Possible result The reason for this is that the system is programmed to hold a maximum of 300 pieces per coin type Since the input is 400 pieces the system will 48 change the input to 300 pieces by default Pressing the enter key will not dispense the coin since the input denomination value is less than the bill value With this kind of instance another kind of test must be done regarding the inequality of the input denomination value and the bill value The following tests check the system if it displays an error whenever the input denominations total value is not equal to the value of the bill The results are shown in Tables 11 13 where the denomination s row represents the coin type the input count row st
15. potenfometic ladder to tw 2567 products These convertes me de signed to allow operation wifi fie NSC800 and INSS0 80A dedvative control bus wit TALSTATE output latches di may driving data bus These A Ds appas like memory locations or 1 0 ports to the micraprocessa and no ntec facing logic is needed Ciftwertial analog voltage inputs alow incssasing the com mon mode reecton and offsetting te analog zero voltage In addition fe voltage relecunce input can be adjusted to allow encoding analog voltage span to the full 8 bits of resolution Features Compatibie wih 8080 uP derwatves no iner acng logic neadad access fme 135 ns E Easy microprocessos o operates stand alone Typical Applications m Offerertial analog voltage inputs B logo inputs and oututs meet bot MOS and TTL vot aye level specificatons Works with 25V LM336 voltage reference m On chip dock generator m OV to SV analog voltage range with single SV supply E No zero adust requred 03 sanded width 20 OP package m 20 pin molded chip carrier or smal oufine package Operates ratometicaly oc wih 5 2 5 ana log sp n adjusted voltage reference Key Specifications Aesoluton Tota Conversion time 8 bits 14 158 LSB and 1158 100 us Error Specification includes Full Scale Zero Error and Non Linearity Vazr 2 2500 V
16. related factors such as the displaying of error during wrong inputs or certain cases The only problem is in the mechanical part where there is a 1 2 input output difference in dispensing coins The reason for this minimal error is maybe caused by the small tube containers of coins or the flow of coins during the kicking of the rotating metal shaft Chapter 4 CONCLUSION AND RECOMMENDATION CONCLUSION After the proponents developed and tested the system entitled Bill to Coin Changer they have found out that the usage of UV light could detect fake money The value of money was identified using its binary value as converted by the A D converter from the analog signal read through the Light Dependent Resistor or LDR Moreover blocking and unblocking the optical sensor could be used as counter as to how many coin s was were already dispensed The only observed disadvantage in using such materials A D converter and LDR is that it is not capable of differentiating bills of the same color intensity All in all the group was able to construct a circuit design that enables users to change twenty fifty and one hundred peso bills to their exact equivalent amount in twenty five cents one five and ten peso coins RECOMMENDATION For further improvement on the development of a bill to coin changer device the proponents recommend that the future researchers and designers should look for another alternative device or component other than A D convert
17. requires additional chips to provide these functions A microcontroller is a single integrated circuit commonly with the following features 1 Central processing unit ranging from small and simple 4 bit processors to sophisticated 32 or 64 bit processors Input output interfaces such as serial ports Peripherals such as timers and watchdog circuits and signal conversion circuits RAM for data storage ROM EPROM EEPROM or Flash memory for program storage Clock generator often an oscillator for a quartz timing crystal resonator or RC circuit Light Dependent Resistor LDR A photoresistor or LDR is an electronic component whose resistance decreases with increasing incident light intensity It can also be referred to as a light dependent resistor LDR photoconductor or photocell A photoresistor is made of a high resistance semiconductor If light falling on the device is of high enough frequency photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band The resulting free electron and its hole partner conduct electricity thereby lowering resistance There are just two ways of constructing the voltage divider with the LDR It is located either at the top figure at the left or at the bottom figure at the right shown in Figure 1 below Y out V out Ov Oy Figure 1 Constructing Voltage Divider Circuit using LDR You are going to investigat
18. variables to drive the dependent variables Statement of the Problem The main problem of the design is the development of a device that could accept and identify bills to be changed into exactly similar amount in coins Specific hindrances include the process of detecting fake money and identifying the amount of bill inserted Moreover the determination of the minimum and maximum amount of money to be 13 accepted and dispensed as well as the measure of accuracy and reliability of the study are also particular problems Objective of the Study This design aims to develop a user friendly system capable of accepting authentic bills from the user and allowing the user to choose the coin denominations he wants his bills to be changed into In addition to this the system must not dispense insufficient coins this means that the amount of coins to be dispensed must be of same amount as the inserted bill The design also intends to know if an Ultraviolet light can really help determine fake bills when paired with a counterfeit sensor system Moreover the design also aims to know if light intensity from colored bills can be distinguished and used as a variable to know the value of the bill using a Light Dependent Resistor and an A D converter Furthermore the objective of the design is to see if an optical sensor can be used to count coins going out of the dispenser Significance of the Study The use of a bill to coin changer device is
19. 0 P50 00 and P100 00 Each of the bills has corresponding color va ue such as light for P20 00 orange medium for P50 00 red and dark for P100 00 violet Note that the strongest hue is located in the collar of the person imprinted in the bill so it is advisable to focus in this area Since LDR is sensitive to light different voltage values are measured when each of these bills is placed in between the light source and the LDR focused in the 12 strongest hue Thus the different output voltage can be used to identify the kind of bill i e the measured voltage across LDR 1V P20 00 1 5V P50 00 2 25V P 100 00 Conceptual Framework Independent Variables Intervening Variable Dependent Variables Peso Bill Microcontroller Dispensed Coins Keypad Input Coin Dispenser Bill Acceptor E LCD Output Figure 8 Conceptual Framework Diagram In order for the system to do its purpose fundamental variables are necessary Figure 8 shows the conceptual framework diagram of the system The input comes from the user this includes the peso bill which could be 20 50 or 100 the keypad input and bill acceptor The number of dispensed coins coin dispenser and LCD output are highly dependent to it Without the user input the system will not be functional The principal part of the system is the microcontroller The microcontroller controls the operation of the whole system and is the one that processes the independent
20. 047uF e S k S LDR Bill to Coin Changer Circuit A 33 54 From Circuit D sd 220 LED Ys 1N5404 ZN ZN 145404 UU L amp gt lt 1P Motor From Circuit Ad ik From Circuit Ad 220 LED Zy 1N5404 ZS CF Motor gt _ 5P Motor From Circuit Ad From Circuit Ad lt 19 P Motor from Circuit Ad gt from Circuit Ad 16 RELAY DRIVER Bill to Coin Changer Circuit B 2 12417 2 01 18 805835 0 Josuas uio osag g Josuas osag MEN xb 1 13 37 5 4 AL MOT T34 037 8J zy 2 V 31n24 2 JO 9 31n24 5 JO Josuaec dg OL Josuas q OL Josuas uio osag g6 Josuas 44875 62 Wm m 4 Q6EN2 mo Ta aa S H L MOTT34 Q03 sA i zy V V 9 31n2415 39 g 3 n2415 39 dosuas qs OL dosuas 3 2 OL 96 1119417 4 8 u107 01 ig Y 2119419 Jo 995 01 24 wyo 2141 4 Kd311U8 0298 VOBDTNL 8 aac 3 415 JO PPA OL A lddfls 93 0 S2ade NUH L souanos 29 4 Deng Senge 2834984 1 oo APPENDIX B Source Code Device 16F877 XTAL 4 ADCONI 7 LCD DTPIN PORTC 0 LCD RSPIN PORTC 4 LCD ENPIN PORTC 5 LCD INTERFACE 4 LCD LINES
21. 4 LCD 0 DelayMS 500 ALL DIGITAL True PORTB PULLUPS On Dim key As Byte Dim cb 25c As Word Dim cb 1p As Word Dim cb 5p As Word Dim cb 10p As Word Dim coin totval As Word Dim bill val As Word Dim ctr As Byte Dim centavo As Word Dim onepeso As Word Dim fivepeso As Word Dim tenpeso As Word Dim Num As Byte Dim Number As Word Dim flag 25c As Bit Dim flag 1 As Bit Dim flag 5p As Bit Dim flag 10 As Bit Dim chk As Byte Dim portd cmp As Byte 57 flag 0 flag 5 0 flag 10p 0 flag 25 0 coin_totval 0 ctr 0 onepeso 0 fivepeso 0 tenpeso 0 centavo 0 bill val 0 cb 25c 300 cb 1 300 cb 5 300 cb 10 300 TRISA 010000 01110000 01000000 111 TRISD 11111111 0 PORTB 0 PORTC 0 DelayMS 100 menu_main PORTC 0 portd 0 chk 0 If cb 25 lt 80 Then chk chk 1 EndIf Ifcb 1p lt 20 Then chk chk 1 EndIf Ifcb 5p 4 Then chk chk 1 EndIf 58 Ifcb 10p 2 Then chk chk 1 EndIf If chk 4 Then msg errorcb Cls Print At 1 1 MAPUA Print At 2 1 School of EE ECE CoE Print At 3 1 Bill to Coin Print At 4 1 Changer DelayMS 2000 Cls Print At 1 1 INSERT BILL Print At 3 1 7 Test 9 Print At 4 1 Bank Enter DelayMS 250 menu_mainloop GoSub getkeys If key 6 Then show_prop If key 4 Then show_test If key
22. 4 1 to the Bill Value DelayMS 2000 coin totval 0 GoTo menu denom msg error25c Cls Print At 1 1 SORRY Print At2 1 Not Enough Print At3 1 25 CENTAVO COINS Print At 4 1 to dispense DelayMS 2000 GoTo menu denom msg errorlp Cls Print At 1 1 SORRY Print At2 1 Not Enough Print At3 1 ONE PESO COINS 66 Print At 4 1 to dispense DelayMS 2000 GoTo menu denom msg 5 Cls Print At 1 1 SORRY Print At2 1 Not Enough Print At3 1 FIVE PESO COINS Print At 4 1 to dispense DelayMS 2000 GoTo menu denom msg errorl0p Cls Print At 1 1 SORRY Print At2 1 Not Enough Print At3 1 TEN PESO COINS Print At 4 1 to dispense DelayMS 2000 GoTo menu denom msg errorcb High PORTB 7 Print At 1 1 Print At 2 1 SORRY Not Enough Print At 3 1 COINS to dispense Print At 4 1 DelayMS 2000 Low PORTB 7 Cls Print At 1 1 Out of Order Print At 2 1 SORRY Print At3 1 Coin Bank Print At4 1 IsEmpty DelayMS 5000 GoTo Exit2 msg success Cls Print At 1 1 lee Print At 2 1 Transaction Print At 3 1 Successful Print At4 1 67 DelayMS 2000 GoTo menu main show dispctr Cls Print At 1 1 25 Cents Zcentavo Print At 2 1 1 Zonepeso Print At 3 1 5 Peso fivepeso Print At 4 1 10 Peso tenpeso Return show cb
23. By connecting a diode in reverse bias mode this back EMF is dissipated without damaging the transistor f PIC Microcontroller Figure 3 Driving a Lamp using Transistor V er contacts Output non Port Microcontroller Figure 4 Driving an Inductive Load such as Relay Since we can drive a relay we can connect any load to the relay outputs as long as we do not exceed the contact ratings of the relay Figure 5 shows how a mains lamp can be operated from the microcontroller output port using a relay The relay could also be operated using a MOSFET power transistor In this circuit the main lamp will turn ON when the output port of the microcontroller is logic 1 5 i Mans Lamp gt Output Port PIC Microcontroller Figure 5 Driving a Lamp using Relay Analog to Digital Converters Analog devices usually consist of a sensor that will output a voltage that has a linear relationship with the unit that it is measuring For instance an analog type temperature probe will output a voltage that will correlate to temperature As the temperature increases so will its output voltage The measurable range of this temperature will be such that it has a linear relationship with this voltage output A linear relationship means that a given change in the quantity being measured such as a number of degrees of temperature will produce a given corresponding quantity of
24. DelayMS 500 Cls Print At 1 1 25 Cents cb_25c Pcs Print At 2 1 1 Zcb 1p Pcs Print At 3 1 5 Peso cb 5p Pcs Print At 4 1 10 Peso Zcb 10 Pcs DelayMS 2000 GoTo menu main show test Cls Print At 1 1 Print At2 1 CALIBRATION Print At3 1 Value Dec PORTD Print At 4 1 DelayMS 1000 GoTo menu main show prop Cls Print At 1 1 Proponents Print At 2 1 Caroline Sambaoa Print At 3 1 Jhune Bryan Reyes Print At 4 1 Jomer Bolo DelayMS 3000 Cls Print At 1 1 Proponents Print At 2 1 Billie Buenafe Print At 3 1 Lyndon Catalan Print At 4 1 B S CoE Students DelayMS 3000 GoTo menu main getkeys key 0 PORTB 00001110 If PORTB 4 0 Then key 1 GoTo Exit EndIf If PORTB 5 0 Then key 2 Exit EndIf If PORTB 6 0 Then key 3 GoTo Exit EndIf PORTB 00001101 If PORTB 4 0 Then key 4 Exit EndIf If PORTB 5 0 Then key 5 GoTo Exit EndIf If PORTB 6 0 Then key 6 GoTo Exit EndIf PORTB 00001011 If PORTB 4 0 Then key 7 GoTo Exit EndIf If PORTB 5 0 Then key 8 GoTo Exit EndIf 68 If PORTB 6 0 Then key 9 Exit EndIf PORTB 00000111 If PORTB 4 0 Then key 10 GoTo Exit EndIf If PORTB 5 0 Then key 11 GoTo Exit EndIf If PORTB 6 0 Then key 12 GoTo Exit EndIf Exit Return Loop Number
25. G1 to SEG40 LCD drive voltage selector Character generator ROM CGROM Parallel serial converter and attribute circuit V2 V3 V4 v5 HD44780U Pin Arrangement FP 80B FP 80B Top view HD44780U Pad Arrangement Chip size 4 90 4 90 mm Coordinate Pad center jum Origin Chip center Pad size 114 114 um gi 0000000000000000 08 HD44780U 000000 00000000000000 g OO00000000000000 OG 86 APPENDIX G PIC16F877 Microcontroller Data Sheet MICROCHIP PIC16F87X 28 40 Pin 8 Bit CMOS FLASH Microcontrollers Devices Included in this Data Sheet 16 873 PIC16F878 16 874 PIC16F877 Microcontroller Core Features High performance RISC CPU Only 35 single word instructions to leam All single cycle instructions except for program branches which are two cycle Operating speed DC 20 MHz clock input DC 200 ns instruction cycle Up to SK x 14 words of FLASH Program Memory Up to 365 x 8 bytes of Data Memory RAM Up to 256 x 8 bytes of EEPROM Data Memory Pinout compatible to the PIC16C73B 748 76 77 interrupt capability up to 14 sources Eight level deep hardware stack Direct indirect and relative addressing modes Power on Reset POR Power up Timer PWRT and Oscillator Start up Timer OST Watchdog Timer WDT with its own on chip RC oscillator for re able operation Pro
26. Microcontroller based Bill to Coin Changer with UV Light dependent Counterfeit Sensor By Jomer M Bolo Billie Nicolette B Buenafe Lyndon Jason M Catalan Jhune Bryan R Reyes Caroline Jane P Sambaoa A Design Documentation Submitted to the School of in Partial Fulfillment of the Requirements for the Program Bachelor of Science in Computer Engineering Mapua Institute of Technology March 2008 APPROVAL SHEET This is to certify that this design study entitled Microcontroller based Bill to Coin Changer with UV Light dependent Counterfeit Sensor prepared by Jomer M Bolo Billie Nicolette B Buenafe Lyndon Jason M Catalan Jhune Bryan R Reyes and Caroline Jane P Sambaoa in partial fulfillment of the requirements for the degree Bachelor of Science in Computer Engineering have been supervised the preparation of and read the design documentation and hereby recommended for final examination by the Oral Examination Committee Ms Filomena J Berenguela Engr Analyn N Yumang Reader Design Adviser As members of the Oral Examination Committee we hereby APPROVED this design study which was presented before a Panel of Examiners of the School of EE ECE CoE on March 8 2008 Engr Isagani V Villamor Engr John Louie A Ching Panel Member 1 Panel Member 2 Engr Gino Paolo Luis R Villanueva Panel Member 3 Accepted in partial fulfillment of the requirements for the degree Bachelor of Science
27. NTS TITLE PAGE APPROVAL SHEET ACKNOWLEDGEMENT TABLE OF CONTENTS LIST OF TABLES LIST OF FIGURES ABSTRACT Chapter 1 INTRODUCTION AND REVIEW OF RELATED LITERATURE Research Setting Review of Related Literature and Studies Conceptual Framework Statement of the Problem Objective of Study Significance of Study Scope and Delimitation Definition of Terms Chapter 2 METHODS AND PROCEDURES Research Design Design Procedure for Actual Design Hardware Design List of Materials Hardware Component Circuit Design Software Design Software Component System Flowchart Chapter 3 PRESENTATION AND INTERPRETATION OF DATA Chapter 4 CONCLUSION AND RECOMMENDATION BIBLIOGRAPHY ii iii iv vi vii viii 12 12 13 13 14 16 20 20 22 23 23 25 28 38 38 39 42 50 51 APPENDICES Appendix A Circuit Diagrams Appendix B Source Code Appendix C PCB Layouts Appendix D NPN General Purpose Amplifier Data Sheet Appendix E ADC0804 A D Converter Data Sheet Appendix F Liquid Crystal Display Data Sheet Appendix G PIC16F877 Microcontroller Data Sheet Appendix H SPDT Relay Data Sheet Appendix I Optical Sensor Data Sheet Appendix J User Manual 52 53 56 71 75 78 82 86 89 91 95 LIST OF TABLES Table 1 Electronic List of Materials Table 2 Mechanical List of Materials Table 3 Miscellaneous List of Materials Table 4 Bill Value Detection Test preliminary testing Table 5 Bill Value Detect
28. PSP 8 bits wide with external RD WR and TS controls 40 44 pin only Brown out detection crcuitry for Brown out Reset BOR 88 Key Features PiCmicro Mid Range Reference PIC16F873 PIC16F874 PIC16F876 PIC16F877 Manual 0533023 PWRT OST PWRT OST PWRT OST PWRT OST ae 39 39 128 255 256 1 124141 Seria Communications ParalelCommunicatons Fs 10 bit Analog to Digital Module 5 input channels 8 input channels 5 input channels 8 input channels Instruction Set 35 instructions 35 instructions 35 instructions TABLE 1 2 16 874 AND PIC16F877 PINOUT DESCRIPTION OSCUCLKN 13 14 30 1 STICMOS oscillator crystal inputiexternal clock source input OSC2 CLKOUT Oscillator crystal output Connects to crystal or resonator in crystal oscillator mode In RC mode OSC2 pin outputs CLKOUT which has 1 4 the frequency of OSC1 and denotes the instructon cycle rate v x s r This pin is an active low RESET to the device PORTA is bi directional port RAD ANO 2 18 TTL can also be analog inputD RAT AN1 TTL RAT can also be analog input RA2 AN2 VREF RA2 can also be analog input2 or negative analog reference voltage RA3 ANVVREF also be analog input3 or positive analog reference voltage RA4 TOCKI can also be the clock input to the Time
29. UV light lamp to check whether the bill inserted is counterfeit or not Coin Dispensing Apparatus Another study entitled Coin Dispensing Apparatus patented by Abe Hiroshi Tokyo JP last March 03 1992 is related to the design According to him his design is a coin dispensing apparatus for use in coin exchangers coin operated gaming machines or the like and more particularly to such a coin dispensing apparatus comprising a hopper for holding a supply of coins or tokens in bulk and a rotary disc which is rotated in the hopper to dispense coins one at a time and in predetermined quantities He continued that when the rotary disc is rotated a coin is transported from the bottom portion of the hopper to the outlet chute at the upper delivery portion by each of the transporting pins which project from the surface of the rotary disc and pass through the tunnel passage in the delivery guide The proponents used this idea to create a coin dispenser using PVC tubes for coin container and a rotating metal shaft coupled in a motor gear for kicking the coins to be dispensed Microcontroller Unit microcontroller unit or an MCU is computer on a chip It is type of microprocessor emphasizing self sufficiency cost effectiveness contrast to general purpose microprocessor used in a PC A typical microcontroller contains all the memory and interfaces needed for a simple application whereas a general purpose microprocessor
30. WM2 output RC2 CCP1 i RC2 can also be the Capture1 input Comparet output PWM1 output RC3 SCK SCL RC3 can also be the synchronous serial clock input output for both SPI and FC modes RC4 SDUSDA RCA can also be the SP Data SPI mode or data I O FC mode RC5 SDO can also be the SP Data Out SPI mode RC8 TX CK RCS can also be the USART Asynchronous Transmit or Synchronous Clock RCTIRXIDT i RC7 can also be the USART Asynchronous Receive or Synchronous Data is a bi directional port or parallel slave port when interfacing to a microprocessor bus RDOPSPO ST TTL RD1 PSP1 ST TTL RD2 PSP2 STITTL RD3 PSP3 RD4 PSP4 vo 5 5 5 ST TTL RD6 PSP8 vo STITTL PORTE is a bi directional port REO RDI ANS REO can also be read control for the parallel slave port or analog input5 RETWR ANG can also be write control for the parallel slave port or analog input6 2 2 can also be select contro for the parallel slave port or analog input Wes 29 33 6 1132 1235 728 MH 12 13 These pins are not intemally connected These pins 40 33 34 should be left unconnected Legend input output VO input output P power Not used TTL TTL input ST Schmitt Trigger input Note 1 This buffer is a Schmitt Trigger input when configured as an external interrupt 2 This buffer is a Schmitt Trigger
31. a more innovative and convenient way of having bills changed to coins The trouble of providing coins for early morning transportation is a common problem to most Filipino commuters With this device the hassle brought by paying in bills to the commuters as well as public utility vehicle drivers will be lesser for students this design has initiated the group members to apply their technical competence and creativity in creating an actual design that is relevant to the 14 modernization and advancement of the lifestyles of citizens This study also allows future researchers to come up with other methods on how to improve such device Scope and Delimitation The system design has a narrow range of functionalities because of limited resources and time The following are the capabilities covered by the design 1 The device changes inserted bills to coin denomination of choice 2 The device detects if the inserted bill is a fake money 3 The device identifies 20 50 and 100 Philippine peso bills 4 The device dispenses coins with denominations of 25 cents 10 5 and 1 Philippine peso coins 5 The device has an error detection functionality wherein an error message is displayed if a certain expression is false e g the total value of selected denomination is not equal to the value of the inserted bill 6 Inquired total number of remaining coins in the dispenser will reset to 300 if the system is restarted 7 The device has
32. ace The Grd port shout aways be wired to 1 Ged Mote 3 ane died dst fom to Gnd and has voltage of 7 Mote 4 2 hu digit cuted cate wil be 0000 0000 Two dodas are Dad So wach bak dag am which wil conduct fer input voltages ane died drop below grand er one dod dop grate tun tw supply during ting allow A S V m high analog inputs 9v cause ha in putdieds ei vatur Dunpatanes an se emn for Inputs The allows 50 mv forvand biaa cf either dioda Thi means am long the Wy dosi notes supply voltage by more han SD my output coda wii be corset To achieve am be 5 input wd tags range wil nuire a minimum supply voltage of 4950 over impetum valor initia baran and leading Mote 5 Accuracy li guranteed at 640 A higher fequens can degrada For lowe Gock feqiendea Tee duty ey imis can be mdai long thus minimam eek high ime or minimam dock iow me neva nolan han 275 Mote amp WED an ynehmonoon 1 up to 8 d k periods be required before the niama clock phis an proper 0o conversion room The nau ent in berry lache Fur 2 an
33. alue of the bill as P50 00 After testing the accuracy of the system with regards to the bill value the proponents tested the precision of the counterfeit sensor Printed bills on a bond paper are used to test it Table 7 shows the results of inserting the fake bills Bill Inserted Fake Message Output Result P20 00 Counterfeit Detected Successful P50 00 Counterfeit Detected Successful P100 00 Counterfeit Detected Successful Table 7 Counterfeit Sensor Precision Test No errors are found during the testing of the counterfeit sensor The next tests involve the accuracy of the coin dispenser with respect to the inputted number of denomination Each kind of bill P20 00 P50 00 and P100 00 is tested with 10 sets of denomination The denomination s row represents the type of coin tested the input row represents the number of pieces of each denomination and the output row represents the number of coins dispensed by the system In this the accuracy of the coin dispenser is tested by ensuring that the output is equal to the input Inserted Bill P20 00 45 Set Denomination s Input Output Result 1 25 80 pcs 78 pcs Failed 2 P1 00 20 pcs 19 pcs Failed 3 P5 00 4 pcs 4 pcs Successful 4 P10 00 2 pcs 2 pcs Successful P1 00 10 pcs 10 pcs 5 S ful P5 00 2 pcs 2 pcs 1 00 10 10 pcs ful i 10 00 1 pc 1 pc
34. and Contacts 3 000 1 2 Sous Initial Insulation Resistance Botween Mutually Insifatod Eloments 1 000M ohms min SOVDCM Reference Data Coil Temperature Rise mol cm ee i 1 0 of Suppl yimgi ottage to Coli Time irre 30 9 w 20 50 70 90 110 130 150 Arsbient Temp C Note Fine ciate cn e mar alicwabin temp for type os 115 C E relarerca purposes oriy ences 90 SRUDH series 12 Amp Miniature Power PC Board Relay Appliances HVAC Office Machines mA UL File No 82292 CSA File No LR48471 TUV File No R60271 Usas shoud thor review the tachrical data before salactng 2 rt number K ts recom Cut Leet abo seak out he parinentc fis cf the agencies and review arn to ensure the product masts the Feufements for guun Coll Data Voltage to 4 Nominal Power 350 mW except 48YDC cot 5 10m Temperature Rise 35 C max at atad cof vokage Max Power 120 of nominal Duty Cyclo Continuo s Coil Data 20 Operate Data Must Operate Voltage 75 cf nominal vokaga or iss Must Release Voltage 12 cf nominal voltage cc mora Operate 15 rns max Roloaso Time 5 ms mx Environmental Data Te aure R t ac to 60 C Vibration Mechanical 10 to 55 Hz 1 5mm double amplituda 1010 55 Hz 1 5mm double
35. ands for the number of pieces per denomination the total value row represents the total value of the input count and shows error row corresponds to whether the system displays an error message if the total value of the input count is not equal to the inserted bill value Inserted Bill P20 00 Set Denomination s Input Count Total Value Shows Error Result 1 256 300 pcs P75 00 Yes Successful 2 P1 00 21 pes P21 00 Yes Successful 3 P5 00 3 pes P15 00 Yes Successful 4 P10 00 100 pcs P1000 00 Yes Successful 5 rro Spes P45 00 Xen Successful P10 00 4 pcs Yes Table 11 20 peso Denomination Value Error Test Inserted Bill P50 00 Set Denomination s Input Count Total Value Shows Error Result 1 25 250 pcs 62 50 Yes Successful 2 P1 00 30 pcs P30 00 Yes Successful 3 P5 00 95 pcs P475 00 Yes Successful 4 P10 00 6 pcs P60 00 Yes Successful 5 Fd 80 00 ae Successful P10 00 3 pes Yes Table 12 50 peso Denomination Value Error Test Inserted Bill P100 00 49 Set Denomination s Input Count Total Value Shows Error Result 1 25 100 pcs P25 00 Yes Successful 2 P1 00 101 pcs P101 00 Yes Successful 3 P5 00 25 pcs P125 00 Yes Successful 4 P10 00 8 pcs P80 00 Yes Successful 5 236 25 00 Successful P10 00 2 pcs Yes Table 13 100 peso Denomination Val
36. change in its output such as a voltage over the device s entire measuring range When a sensor has a linear output such as this it can have a function or equation which represents a way to convert this voltage to temperature units An analog to digital converter will convert an input voltage to a reading that a computer can understand This converted reading is based on a binary counting system We all know a computer system understands bits which are a value of zero or one The binary counting system consists of a number of these bits whose various values represent a number The greater number of bits the higher the possible maximum number which can be counted For instance say we have a simple two bit system The maximum count will be two to the second power or four ranging from zero to three The first bit will represent a two to the zero power or one the second bit will represent a two to the first power or two PIC Microcontrollers and Minimum Support Components microcontroller even though it may have been programmed is not of much use unless it is supported by a number of components such as the timing components and the reset circuitry PIC microcontroller requires an external clock circuit some PIC microcontrollers have built in clock circuits to function accurately Resonators are more often used in microcontroller clock circuits because of their low cost simplicity and low component count The connection of a res
37. d as the output HMI of the system that displays the output such as instructions and messages to the user Specifications e 5x100r5 x 8 dot matrix 2 7 5 5V low power operation support e 80x8 bit display RAM e Low power consumption Numeric Keypad The keypad basically serves as an input HMI device that allows the user to interact with the system UV Lamp The UV lamp is used to help the counterfeit sensor circuit detect the fake bill When the bill is illuminated the light will reflect from it if it is fake money on the other hand real money will absorb the light illuminated by the UV lamp Buzzer The buzzer operates as a sound device that functions as a warning mechanism It is mounted to the counterfeit sensor and is activated when the microcontroller sends a high signal during counterfeit detection 28 Circuit Design In order to create the system hardware components and circuit connections must be visualized fundamental components include the microcontroller bill detector counterfeit sensor keypad LCD buzzer UV lamp coin sensors and motors for coin and feeder Figure 11 shows the hardware block diagram to illustrate the circuit modules and their I O PIC16F877 Microcontroller Relay Driver connection Bill Detector Counterfeit Sensor Coin Sensors Figure 11 Hardware Block Diagram PIC16F877 MCU is the primary point of reference because it is the main control unit of the syst
38. d sation 20 Mote The TBingut to bracket the arobe input and timing ii dependant o he WT pues with An arbitrary wida pubes width wil hokt thw converte in a ret mode and the alt d conversion by the Low to high manden cf the putes wee timing dagrar Mote 3 Nonw d aguna be adjust ee section 257 obtain penc ood al dhe anmieg input voltages section 25 and Fur 5 Mote 9 The Veer 2 Geis te cente port cf a tworesiior dividar sommer tad from Von So gound in af versions of fw 4000801 2 ADONIS ant ADCO ant ADOOROALCU auch stor in versions of the except ADORA CUL each typi ly 2 2 Mote 10 Human body modal 100 pF dachungid houp a 15 kil riso 81 82 TRI STATE Test Circuits and Waveforms tin CL7 10pF Timing Diagra ms At sming is measured from fw 50 voltage points START PATA 18 OUTPUT LATCHES 170 88 Vigne INTERNAL Tp TLAST DATA MAS AT AQ LAST DATA MAS WOT READ Output Enable and Reset INTA Note Fland strobe clock parody iem tion of bo guarantee et TNT TT APPENDIX F Liquid Crystal Display Data Sheet HD44780U LCD II Dot Matrix Liquid Crystal Display Controller Driver HITACHI ADE 207 272 Z 99 Rev 0 0 Description
39. delay time t fall tme t rise time tow t 1 turn of time ton ty t turn on time Figure 2 Switching times APPENDIX J User Manual Instructions for the Administrators 1 Open the rear door of the Bill to Coin Changer by unlocking it with the key included Refill each coin tube blue pipes for 25 cents 1 peso 5 peso and 10 peso coins with 300 pieces of each coin type Close the rear door and lock it Plug in the Bill to Coin Changer to a 220V socket Turn on the switch in the left bottom part in the rear When the welcome screen appears ensure that the calibration value is equal to 15 or 16 by pressing 7 Instructions for the Customers l Press to view the number of coins in the coin bank to check if your desired denomination is still obtainable Insert the bill P20 00 P50 00 or P100 00 in the feeder mouth properly Press to start the transaction process When the bill is fed and the amount of bill is displayed in the screen press again Select the desired denomination by pressing 1 for 25 cents 2 for 1 peso 3 for 5 peso or 4 for 10 peso coins Enter the number of pieces for the selected denomination then press to accept 96 97 7 Other denominations still be selected by following step 4 Note that the value of your desired denominations must be equal to the value of the bill 8 Press 7 to change the bill 9 Wa
40. des to power the whole system 9t B c u o EID CIN Eh 1241 AD JOAJUOIOAIIY 9 24n814 1N0 10 20S0 NDMO LOSO ET Ter WT 4 224 WLSAYS H3azz ua ral lt Josues 40 lt Jasuas Josues g lt Josuag 3623 6 4 wo eue n gt 103044 262 gt O3OJ 45 gt 030W da 0494 41 e n6 amp 4 37 Udd oF Figure 15 UT D1 m A uo Voc of Figures 6 13g D3 1N4 B 1 U1 Vit m From Figure 18 S QNA BATI BY I NF Figure 17 Backup Battery Circuit In Figure 17 D1 and D2 are the diodes that connect the power supply Vin and the batteries BAT1 in an OR wire connection When power line is available Vin has 12Vpc D1 is closed which allows the current to pass since its cathode has Simultaneously D2 is open because its cathode measures 12V from Vin In the event of power failure D2 is closed this allows the batteries to supply power to the system At the same time D1 is open since its anode has OV from Vin and its cathode has 8V from the batteries Voltage Regulator 7805 is connected in the cathodes of D1 and D2 to maintain a constant voltage of 5Vpc in the output The backup batteries are charged using Variable Voltage and Current Regulator L200 Chip
41. e Breakdown Voltage Ic 10 ic O oo Emilier Base Breakdown Voltage 10 pA 0 AE ERE Base Cutoff Current Vee 30 V Ven mo Collector Cutof Current Ver 30 V Ven W 0 1 mA 1 0 10 mA 10V S0 mA 1 0 V 100 MA Vee 12 V SMALL SIGNAL CHARACTERISTICS T 100 MHz 1 1 0 MHz f 1 0 MHz Noise Figure lc 100 pA V 5 0 V Rs 1 0 0 1 10 Hz to 15 7kHz SWITCHING CHARACTERISTICS Voo 3 0 V 0 5 V lc 10 mA ig 1 0 mA Veo 3 0 V lo 10MA lg las 1 0 MA P Putie Tare Pruise Visi 5320 Daty Caes 20 Spice Model NPN 15 5 734 Xt 3 Ege 11 Vaf 74 03 B e416 4 Ne 1 259 5 734 Ikf 56 78m Xib 1 5 7371 Nc 2 isc D 1 Cjc 3 636p 3085 75 5 Cje 4 493p 2593 75 239 5 301 2 4 Xt2 RD 10 7065 174 706519 06 2 TI NPN General Purpose Amplifier continued Test Circuits rt GERENS _ FIGURE 2 Storage Fall Time Equivalent Test Circuit 7065174 706519 v06 NZ 1 APPENDIX E ADC0804 A D Converter Data Sheet ational Semiconductor ADC0801 ADC0802 ADC0803 ADC0804 ADC0805 8 Bit uP Compatible A D Converters General Description The 2 0901 ADO00802 4 and A2C0805 CMOS Sbit successive approdmation A D converters fat use a differertial
42. e light level is low authentic bill or nothing the resistance of the LDR is high This prevents the current to flow in the base of Q7 transistor thus allowing the current to flow in the base of Q9 Because of this the collector emitter of 09 is shorted which allows the current to flow Consequently the D12 LED is lighted and the output is high However when light shines into the LDR fake bill its resistance falls thus allowing the current to flow in the base of Q7 which shorts the base of Q9 to the ground Because of this the collector emitter of Q9 is open preventing the current to flow This does not light up D12 and the output is low From Figure 17 RES BILL DETECTOR To Figure 16 D m OCUDH 00000000 LK DB7 IOMSB VIN From Figure 17 o o RV1 saa Figure 13 Bill Detector Circuit The bill detector identifies the value of the bill inserted to the feeder To make this possible the circuit requires an A D converter and LDR LDR is 31 used as the transducer where the A D converter receives analog input voltage range A D converter translates the measured analog voltage along the LDR to digital signal in 8 bit binary form In Figure 13 the converted 8 bit signal which is an input to the microcontroller can be obtained in the DB0 DB7 data output of the A D converter Moreover the potentiometer RV1 is used to vary the analog voltage meas
43. e the behavior of these two circuits You will also find out how to choose a sensible value for the fixed resistor in a voltage divider circuit Remember the formula for calculating Vour R Vour With the setting shown in Figure 2 the FSD or full scale deflection of the ohmmeter is 200 This means that the meter will measure resistances from zero up to a maximum of 200 With this setting you will be able to see how the resistance of an LDR changes with illumination ohmmeter 200 kilohme fed resistance may only be measured when components are removed from any circuit black lead red lead crocodile clip Figure 2 Measuring LDR Resistance using an Ohmmeter Relay Interface relay is an electrical switch that opens closes under the control of another electrical circuit In the original form the switch is operated by an electromagnet to open or close one or many sets of contacts Because a relay is able to control an output circuit of higher power than the input circuit it can be considered to be in a broad sense a form of an electrical amplifier When a current flows through the coil the resulting magnetic field attracts armature that is mechanically linked to a moving contact The movement either makes or breaks a connection with a fixed contact When the current to the coil is switched off the armature is returned by a force approximately half as strong as the magnetic force to its relaxed posit
44. eded The challenge was how to come up with a device that would satisfy the above listed objectives The proponents started gathering data by researching on technologies and studies that are in some way parallel to the requirements of the system Major components of the design through a block diagram were determined so as to know which of the available materials and technology in the market could be used in the design Materials are then selected based on the criteria and requirements of the problem Since this design made use of microcontroller to coordinate and manipulate the functions of different circuits a good programming language and skill is also necessary to complete the design Again consulting related books and knowledgeable persons are of help in designing and debugging the program To visualize the summary of the steps above Figure 9 shows the flowchart for the data gathering procedure Research for possible materials that could be used to solve the problem Determine major components to be used in designing the solution for the problem Select from the possible materials based on the criteria and requirements of the design Consult related studies and knowledgeable persons on how to improve the solution to the problem Finalize the list of materials to be used in the design and have the PCB layout for each circuit Verify if connections in the layout are done correctly 21 Integrate the mate
45. em The blocks with arrows pointing to the MCU represents the input devices and blocks with arrows pointing away from the MCU stands for output devices Input devices include the bill detector counterfeit sensor keypad and coin sensors output devices include the LCD buzzer and relay driver Coin motors the feeder motor and the UV lamp are also output devices but in order for them to trigger the MCU must first send a 29 signal to the relay driver With the given block diagram connecting I O devices to the MCU is made simple and easy The proponents subdivided the system into five circuits These are the microcontroller the counterfeit detector the bill detector the relay driver and the coin sensor Each of these parts schematic diagram are created using Proteus 7 a software tool that is used for schematic capture simulation and PCB layout This is to ensure that the system is feasible and operational through testing and simulation The counterfeit sensor is one of the inputs based on the block diagram Figure 11 thus the circuit s output is very important to the microcontroller This circuit detects whether the bill inserted is authentic or not Since UV light is used to check on the bill s validity LDR plays a major role in this process To Counterfeit Sensor of Vee From Figure 17 Figure 16 COUNTERFEIT SENSOR Figure 12 Counterfeit Sensor Circuit 30 Consider the circuit Figure 12 When th
46. eneral Purpose Amplifier Data Sheet 2N3904 MMBT3904 PZT3904 General Purpose Amplifier This device Is designed as a general purpose and switch The useful dynamic range extends to 100 mA as switch and to 100 MHz an amplifier Absolute Maximum Ratings 2 cerni nma CokcbrEmmeVoxe 22 59541 FE Swecsmewmxp 8 CsecerCumm Comum rab regi brang val oos above whet Se sari coat of arri ammi tray te Manes NOTES 1 These pilings ero Cue d on unden engelse of 150 degrees C 2 These vie y Brite Tha siio cid be con bee on appi cens pricing puiset or low duty cycle Thermal Characteristics 2sc usss sterise ets Characteristic MMBT3304 EET gla e Derate above 25 C 28 8 0 Themal Resstance vnefontocaee 93 TwmrmesEams zu 35 15 mosniedos PRA PCE 1 67 008 FP Orvice mented on FR 4 PCB 38 mm X 18 mm X 15 mm pisi o fe col sciet mis Fare Doqpenadoe Rev A 76 7065174 706519 7065 2 NPN General Purpose Amplifier continued Electrical Characteristics creme notes Symbot Parameter Test condone man unis OFF CHARACTERISTICS Collector Emitter Sreakcown 10 0 Esa Collector Bas
47. er and LDR since it is not capable of differentiating bills of same color intensity Another suggestion is to enable alternative device to support the acceptance of higher amounts or wider range of bills It is also advisable for the design not just to dispense coins but also bills This design could further be improved to support foreign currencies wherein one could change one form of money to their preferred currency using this device 51 BIBLIOGRAPHY Abe 1992 Coin dispensing apparatus United States ASAHI SEIKO CO LTD JP Patent US5092817 1 6 Cayne B S 1993 The New Lexicon Webster s Dictionary of the English Language Volume 1 2 Lexicon Publications Inc Danbury CT Kelly E C 1990 Bill money changer for slot machines United States LAMBA BETA EPSILON GROUP US Patent US4966304 1 11 Burkett R D 2007 Vending Machine The Columbia Encyclopedia Sixth edition Columbia University Press New York Yu C K and W Y Tsai 2006 Bill acceptor United States INTERNAT CURRENCY TECHNOLOGIES TW Patent US6994201 1 10 52 APPENDIX A Circuit Diagrams Voc From Circuit D V LMB4 4L OSC1 CLKIN OSC2 CLKOUT MCLR To CIrcuit 5 25C Motor UV Lamp 1P Sensor SP Sensor 108P Sensor PIC16F877 From Circuit D M FE DBS CLK R DB7 MSB gt COUNTERFEIT SENSOR 100nF 0
48. er dissipation Operating temperature range Tame 55 t 85 Storage temperature range 1 55 to 100 94 Electrical Characteristics Tam 25 C Input Emitter Parameter Symbol Forward voltage 60 mA w Junction capacitance Va 0 f 1 MHz Output Detector Test Conditions Symboli Min Typ Max Unit 1 Pep 14 0 1 28 Collector dark curent 25 0 0 710 Coupler Symbol Min Typ Max Unit Current transfer ratio TCST2103 TCST2202 TCST2300 CTR 5 CTR 1 25 Collector current TCST1103 2 TCST2103 1 Ic 0 25 2 3 gt 2 TCST2202 ES TCST2300 Collector emitter lp 20 mA saturation voltage 1 mA TCST2103 Ir 0 5 mA TCST2202 3 gt lt lr 20 mA TCST1300 Vczsa lc 0 1 mA TCST2300 Resolution path ofthe 10 to 90 TCST1103 shutter crossing the TCST2103 radiant sensitive zone TCST1202 TCST2202 TCST1300 Ee 1 TCST2300 lt 0 N e m 95 Switching Characteristics Vs 5V Io 2 mA 100 Q see figure 1 ie 100 p 80 5V 6 11638 lg 2 adjusted through nput amplitude Re 50 0 b T 0 01 50 us Channel Oscilloscope Channelll R 1 MO 500 C 20 pF 95 108901 Figure 1 Test circuit saturated operation t pulse duration t storage tme ts
49. grammable code protection Power saving SLEEP mode Selectable oscillator options Low power high speed CMOS FLASH EEPROM technology Fully static design In Circuit Serial Programming ICSP via two pins Single 5V in Circut Serial Programming capability In Circuit Debugging via two pins Processor read write access to program memory Wide operating voltage range 2 0V to 5 5V High Sink Source Current 25 mA Commercial Industrial and Extended temperature ranges Low power consumption lt 0 6 m typical 3V 4 MHz 20 pA typical 32 kHz 1 uA typical standby current 87 Pin Diagram 3 RAQIANZNFEF a 4 OSCICLEN is z eo 5 amp Root os Peripheral Features Timerd 8 21 timer counter with 8 bit prescaler Timert 16 54 timer counter wth prescaler can be ncremented during SLEEP via external crystal clock Timer2 8 54 timer counter with 8 bit period register prescaler and postsca er Two Capture Compare PWM modules Capture is 16 bit max resolution is 12 5 ns Compare is 16 bit max resolution is 200 ns PWM max resolution is 10 bit 10 bit multi channel amp nalog to Digita converter Synchronous Serial Port SSP with SPI Master mode and C Master Slave Universal Synchronous Asynchronous Receiver Transmitter USART SCI with 2 51 address detection Parallel Slave Port
50. in Computer Engineering Dr Felicito S Caluyo Dean School of EE ECE CoE ACKNOWLEDGEMENT The proponents would like to express their deepest gratitude and appreciation to Almighty God for giving them strength courage determination knowledge and blessings in making this whole design possible as well as lighting their path and guiding them all the way Secondly the group would like to thank their relatives and friends for providing information and assistance especially to their loving parents for giving them support and guidance in making this endeavor and sustaining education all throughout Moreover the proponents would like to express their appreciation to Mr William D Reyes for all the assistance to make everything possible The proponents would also like to thank their adviser Engr Analyn N Yumang for spending her precious time in sharing ideas and advice as well as enlightening and assisting them in every possible way The group as well would like to express thanks to Engr Isagani V Villamor Engr Gino Paolo Luis R Villanueva Engr John Louie A Ching and Ms Filomena J Berenguela Lastly the group would like to express their sincere gratitude to their beloved instructor Mr Noel Linsangan for providing valuable instructions and techniques used in creating this achievement Bolo Jomer M Buenafe Billie Nicolette B Catalan Lyndon Jason M Reyes Jhune Bryan R Sambaoa Caroline Jane P TABLE OF CONTE
51. input when used in Serial Programming mode 3 This buffer is a Schmitt Trigger input when configured as genera purpose I O and a TTL input when used in the Parallel Slave Port mode for interfacing to a microprocessor bus 4 This buffer is a Schmitt Trigger input when configured RC oscillator mode and CMOS input otherwise 442 APPENDIX H SPDT Relay Data Sheet Features Small package 12 Amp switching 1 Form and 1 Form C contact mmarsion sealed version avalabie Applications appliance HVAC securky system Garage opener control emergency barking Contact Data 20 C T Form A SPST NOI ard 1 Form SPDT Matorlal Ag Alloy Max Switching Rate 300 ops min no load 30 apis min rated Iced Expected Mechanical Life 10 milion operations Inc load Expected Electrical Life 100 002 operations rated load Minimum Load 10OmA Initial Contact Resistance 100 millichms 1A amp VOC Contact Ratings Ratings 12 120VAC resistive d 240VAC resistiva 10A d ZEYDC resistive 120VAC InductWe kos 24 AA 29VDC inducta LR msec Switchod Voltage 249v DC 28V Max Switched Current 12 Max Switched Powor 2 400VA 300W Initial Dielectric Strength Between Open Contacts TSOVAC 50 60 Hz 1 mirutel Between Coll and Contacts T SOOVAC 50W60 Hz 1 minuta Surge Voltage Between Coll
52. ion Usually this is a spring but gravity is also used commonly in industrial motor starters Most relays are manufactured to operate quickly In a low voltage application this is to reduce noise In a high voltage or high current application this is to reduce arcing If the coil is energized with DC a diode is frequently installed across the coil to dissipate the energy from the collapsing magnetic field at deactivation which would otherwise generate a spike of voltage and might cause damage to circuit components Some automotive relays already include that diode inside the relay case Alternatively a contact protection network consisting of a capacitor and resistor in series may absorb the surge If the coil is designed to be energized with AC a small copper ring can be crimped to the end of the solenoid This shading ring creates a small out of phase current which increases the minimum pull on the armature during the AC cycle By analogy with the functions of the original electromagnetic device a solid state relay is made with a thyristor or other solid state switching device To achieve electrical isolation an optocoupler can be used which is a light emitting diode LED coupled with a photo transistor When we want to switch inductive loads such as relays we have to use a diode in the circuit to prevent the transistor from being damaged see Figure 4 An inductive load can generate a back EMF which could easily damage a transistor
53. ion Test final testing Table 6 Bill Value Detection of Old Bills Test Table 7 Counterfeit Sensor Precision Test Table 8 20 peso Bill Output Test Table 9 50 peso Bill Output Test Table 10 100 peso Bill Output Test Table 11 20 peso Denomination Value Error Test Table 12 50 peso Denomination Value Error Test Table 13 100 peso Denomination Value Error Test Table 14 Coin Bank Error Test 23 24 24 42 42 43 43 44 45 46 47 47 48 48 Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 LIST OF FIGURES Constructing Voltage Divider Circuit using LDR Measuring LDR Resistance using an Ohmmeter Driving a Lamp using Transistor Driving an Inductive Load such as Relay Driving a Lamp using Relay Using a Resonator in PIC Microcontroller Connecting the Reset MCLR Input Conceptual Framework Diagram Data Gathering Procedure System Divisions Hardware Block Diagram Counterfeit Sensor Circuit Bill Detector Circuit Coin Sensor Circuit Relay Driver Circuit Microcontroller Circuit Backup Battery Circuit Power Supply Circuit System Flowchart Part 1 System Flowchart Part 2 10 12 21 22 28 29 30 32 33 35 36 37 39 40 ABSTRACT The bill to coin changer is a microcontroller based design tha
54. it for the Transaction Successful message 10 Open the coin cargo door to get the dispensed coins 11 Close the coin cargo door after getting the coins
55. itions Mn Ty Max Units ADC0801 Total Adjusted Error Note 8 Wet FulbSoale 14 138 See Sacton2 52 ADCOBO Tota Unadjusted Error Note 8 Vage 2 2 500 Ej mueve ees Eme wo See Sacton 2 52 ADCOBOA Total Unadjusted Error Note 8 2 2 500 Voc 1 20005 Total Unadjustad Error Note Vage 2NoComection J Vaer Input Resistance Pin 9 ADOO amp O 02 03 705 ADOG Note 9 Analog input Voltage Rang 614 005 0 05 age ee Range Power Supply Sensitivity Voc 75 Voc 10 Over Allowed Vig and Voltage Range Note 4 AC Electrical Characteristics The folowing sneciscatons apply for Voc 5 and 25 C unless specified Corwersion Tme Clock Frequency Clock Duty Oyde Corversion Fate Free Aunring Mods TS 0 Voo fa 640 kHz Width of WA input Sturt Pulse Wid fi CS 0 Voc Note 7 Acoass Time Delay form Falling Cy 100 pF Edge of 1710 Output Data Valid TALSTATE Conta ie 10 pF Ay 10k from Alsing Edge of AD to See TALSTATE Test State Crouits Delay fom Falling Edge of Wie AID to Reset of INTT input Capacitance of Loge Corntolinputs TALSTATE Data Bulfers Logical 17 input Voltage Exoagt 4 CLK IN AC Electrical Characteristics Tha following speciicatons apply for Ver 5 and Ty lt Ta lt Tuay unless otherwise spaci
56. l to the circuit the current will flow in the base of Q6 This will allow the current to flow in the collector emitter triggering an induction which creates a back EMF in the relay Simultaneously the switch becomes close which allows the motor to run and D11 to light up This is the same with the UV lamp circuit since it is identical to the feeder and coin circuit Furthermore notice that there is a diode connected to the relay in reverse biased mode This is necessary because a relay inductive load which creates a back EMF can damage the transistor The main part for the system is the microcontroller circuit where the control processing takes place The microcontroller circuit shown in Figure 16 illustrates all I O pin connections as depicted by the hardware block diagram in 35 Figure 11 Since the system dispenses four different kinds of coins requires one bill acceptor and uses a UV lamp for counterfeit detection six relay drivers are allocated to ports A0 A3 A5 and B7 Other connections comprise the following LCD to ports 0 5 keypad to ports BO B6 coin sensor to ports 4 and 0 2 counterfeit sensor to C6 buzzer to C7 and bill detector to all D ports During power failure the system must integrate a backup battery circuit to prevent data loss and to continue current transaction In order to do this four rechargeable 2V 1A Lead Acid batteries 8V total are OR wired with the AC to DC power supply using rectifier dio
57. n DelayMS 150 GoTo enter 5p EndIf If key 7 Then DelayMS 150 GoTo enter 10p EndIf If key 3 Then dispense coins If key 1 Then centavo 0 onepeso 0 fivepeso 0 tenpeso 0 coin_totval 0 GoTo menu_denom EndIf 62 GoTo menu denomloop enter 25c Cls Print At 1 1 ENTER PIECES Print At 4 1 Clear Enter DelayMS 250 flag 25c 1 GoSub Loop GoTo menu denom enter lp Cls Print At 1 1 ENTER PIECES Print At 4 1 Clear Enter DelayMS 250 flag Ip 1 GoSub Loop GoTo menu denom enter 5p Cls Print At 1 1 ENTER PIECES Print At 4 1 Clear Enter DelayMS 500 flag 5p 1 GoSub Loop GoTo menu denom enter lOp Cls Print At 1 1 ENTER PIECES Print At 4 1 Clear Enter DelayMS 500 flag 10p 1 GoSub Loop GoTo menu denom 63 dispense coins If centavo gt 0 Then If centavo 4 0 Then dispense here GoTo msg error EndIf dispense here coin totval centavo 4 onepeso 1 fivepeso 5 tenpeso 10 If coin totval gt bill val Then msg error If coin totval bill val Then msg error If cb 25c centavo Then msg error25c Ifcb 1p onepeso Then msg errorlp If cb 5p lt fivepeso Then msg error5p If cb 10 lt tenpeso Then msg 10 Cls Print At 1 1 25Cent centavo 1Peso onepeso Print At 2 1 5Peso fivepeso 10Peso tenpeso Print At 3 1 Print At 4 1 Bill Value
58. o determine how much coin the system should dispense The system will then provide the user with a menu in which he could choose the number of coins per denomination he wants his bill to be changed into Number 1 in the keypad would be for the centavo 2 for one peso coins and so on The system shall ensure that the total amount of coins to be dispensed will be the same as the amount of bill inserted The user will be asked to reenter the quantity of coins per denomination if in case the desired amount of coins is not equal to the inserted bill The whole process is started 1f the user entered a bill and then pressed the sign in the keypad The user could also view the content of the coin bank by pressing Proponents names are also available upon pressing 9 Chapter 3 PRESENTATION AND INTERPRETATION OF DATA Accuracy and Reliability of Design After implementing the hardware various tests are made in order to evaluate the system system s bill acceptor should detect the value of the bill accurately Table 4 and 5 shows Initially the bill acceptor s accuracy is tested It is very important that the the result of the test which are done twice to ensure consistency Bill Inserted Detected Value Result P20 00 P20 00 Successful P50 00 P50 00 Successful P100 00 P100 00 Successful P200 00 P50 00 Failed P500 00 P50 00 Failed P1000 00 P50 00 Failed
59. o the base of Q1 as well as in its collector emitter this connects D1 LED to the ground lighting it up and producing a high signal output On the other hand the current is not allowed to flow in the base of phototransistor if the light is blocked The collector emitter of Q1 is open when this happens so D1 is dimmed and the output is low The relay driver circuit is composed of motors and UV lamp each of these components is controlled by a relay The relay switches these hardware components with the microcontroller control In Figure 15 coin and feeder motor circuit left is identical with the UV lamp circuit right Take note that the relay driver circuit is an output based on the block diagram in Figure 11 34 Vdd from Figure 17 Vdd Figure 17 R19 R16 An eeu eeu 01152 09 eae 3 Ve ____ 11 5 1 5 1 R17 Motor UV Lamp I 05 L1 From Figure 16 1k From Figure 16 1k ZN 3 1eV B Ultraviolet Figure 15 Relay Driver Circuit Considering the figure in the left without the microcontroller s high signal output to the circuit no current will flow in the base of transistor Q6 Because of this the collector to emitter is open thus making the relay switch open allowing the motor off and D11 LED dim If the microcontroller sends a high signa
60. oc 2 Connection No Adjustments No Adjustments aow esasa _ E 2 21 s hme 71 21 TR STAT EY trackers at of Patiora Sendomnduc r Corp Z9 b a regiam radarus of Tho Corp Ser konducter Corponition TLAW GF RFO RSONT 1 Printed In U 8 79 s19119Au02 9eIqneduio 118 8 508020 08020 808020 208020 108020 80 Absolute Maximum Ratings 60514 2 if specified devices are required Storage Temperature Fange 65 C to 150 C please contact the National Semiconductor Sales Package Dissipation at T 25 C 875 mw Office Distributors for availability and specifications ESD Susceptbility Note 10 800v Supply Voltage Vog Note 3 5 E cni a Lm Operating Ratings ces 12 2 Temperature Range s Ta oY Less Tanp MAT ADCOA01 02LJ 212 883 59 5 5 12 be esis ADCOBO 02 03 041C J A C amp TA amp 85 Mine E 1 02 03 051CN amp C T IC sias lc ROS ADCOBOSLON d MM 0 0802 03 041 O CsTA s PC 220 C ACCRA ORIN Range of 4 5 63 Electrical Characteristics The following specicatons apply for 5 s TAS and 640 kHz unless otherwise spaciied Parameter Cond
61. om Britannica Online Encyclopedia 19 Relay is an electrical switch that opens and closes under the control of another electrical circuit the switch is operated by an electromagnet to open or close one or many sets of contacts Britannica Online Encyclopedia Transistor is a semiconductor device commonly used as an amplifier or an electrically controlled switch Answers Online Dictionary and Encyclopedia Ultraviolet Light UV is an electromagnetic radiation with a wavelength shorter than that of visible light but longer than soft X rays the spectrum consists of electromagnetic waves with frequencies higher than those that humans identify as the color violet or purple The American Heritage Dictionary of English Language 20 Chapter 2 METHODOLOGY Research Design The proponents used both descriptive research and experimental research to give solution to the main problem Descriptive approach was used during the information gathering The information gathered has led them to the solution on some of the specific problems stated in Chapter 1 Experimental research on the other hand was done in this design in order to implement what was researched for and to be able to do some testing This has to be done in order to conclude whether or not the design was able to meet the objectives and if it is efficient enough for the application that it is intended for To begin solving the problem the proponents started with the data ne
62. onator to a PIC microcontroller is shown in Figure 6 The centre pin is connected to ground and the two pins at either sides of the resonator are connected to the 1 and OSC2 oscillator inputs of the PIC microcontroller PIC microcontroller Resonator Figure 6 Using a Resonator in PIC Microcontroller 10 microcontroller starts executing the user program from address 0 of the program memory when power is applied to the chip As shown in Figure 7 the reset input MCLR of the microcontroller is usually connected to the supply voltage through a 4 7K resistor microcontroller Figure 7 Connecting the Reset MCLR Input Liquid Crystal Display LCD In many microcontroller based applications it is required to display a message or the value of a variable For example in a temperature control application it may be required to display the value of the temperature dynamically Basically three types of displays can be used in practice These are video displays 7 segment LED displays and LCD displays Standard video displays require complex interfaces and their cost is relatively high 7 segment LED displays are made up of LEDs Although the 7 segment LEDs are bright their disadvantage is the high power consumption which makes them unsuitable in many battery operated portable applications LCDs are alphanumeric displays which are frequently used in microcontroller based applications Some of the advantages of
63. ons such as the microcontroller counterfeit sensor bill detector coin sensor and relay driver circuits BILL ACCEPTOR COIN DISPENSER CONTROL SYSTEM Counterfeit Coin Sensor Microcontroller Sensor Circuit Circuit Circuit Bill Detector Circuit Relay Driver Circuit Figure 10 System Divisions 23 Hardware Design List of Materials Electronic List of Materials UNIT ITEM PART NAME 4 Pc Optocoupler 4 Pc 10k 4w Resistor 5 Pc 1k sw Resistor 4 Pc 220k sw Resistor 1 Pc 10k Trimmer Resistor 15 Pc 4 7k Yaw Resistor 5 Pc LED Red 4 Pc PN100 Transistor 1 Pc 4 MHZ Resonator 1 Pc Tack Switch 2 Pc 7805 IC Regulator 2 Pc 1N4001 Rectifier Diode 5 Pc 0 01 Capacitor 2 Pc 8 Pin M F Connector 2 Pc 6 Pin M F Connector 2 Pc 3 Pin M F Connector 2 Pc 2 Pin M F Connector 1 Pc PIC16F877 IC Microcontroller 1 Pc ADC0804 A D Converter 1 Set UV Light 1 Power Supply 1 Pc 4x20 LCD w Backlight 2 Pc LDR 2 Pc Super Brite LED 1 Pc Pre sensitized PCB 12x18 1 Transformer 12 0 12 1A 2 Pc 1N5404 Rectifier Diode 1 2200uF 50V Capacitor 6 Pc Single Pole Double Throw Relay 1 Pc Piezo Buzzer 1 Pc Numeric Keypad Table 1 Electronic List of Materials 24 Mechanical List of Materials UNIT ITEM PART NAME 5 Pc DC Gear Motor 2 Pc Rubbe
64. or ROM for a total of 240 character fonts 208 character fonts 5 x 8 dot 32 character fonts 5 10 dot 83 HD44780U e 64 8 bit character generator 8 character fonts 5 x 8 dot 4 character fonts 5 x 10 dot 16 common x 40 sezment liquid crystal display driver Programmable duty cycles 1 8 for one line of 5 x 8 dots with cursor 84 1 11 for one line of 5 x 10 dots with cursor 1 16 for two lines of 5 x 8 dots with cursor Wide range of instruction functions Display clear cursor home display on off cursor on off display character blink cursor shift display shift Pin function compatibility with HD44780S Automatic reset circuit that initializes the controller driver after power on Intemal oscillator with external resistors Low power consumption Ordering Information Type No HD44780UADOFS HCD44780UAD0 HD44780UACOTF HD44780UAD2FS HCD44780UA02 HD44780UAC2TF HD44780UBxxFS HCD44780UBxx HD44780UBxxTF Note xx ROM code No Package FP 80B Chip TFP 80F 80 Chip TFP 80F FP 80B Chip TFP 80F CGROM Japanese standard font European standard font Custom font HD44780U Block Diagram 85 OSC1 05 2 Instruction register IR Instruction decoder Address 7 counter 8 Character generator 7 Data register DR v1 Timing generator 7 Display data RAM DDRAM 80 x 8 bits SE
65. r Roller 1 Pc Threaded Rod 2 Pc Plastic Gear Table 2 Mechanical List of Materials Miscellaneous List of Materials UNIT ITEM PART NAME 1 Bag Ferric Chloride 2 Pack DP 20 Developer 2 Sheet Inkjet Acetate Foil 1 Bottle Acetone 1 Pack Masking Tape 2 L Lacquer Paint 1 G Lacquer Paint 2 Pc Brush 2 Pc Paint Roller 1 Sheet x4 x 8 Plywood 1 Sheet x 4 x 8 Plywood Va K 1 Nail 1 1 8 x x Angular Aluminum 1 1 8 x 4x 1 Angular Aluminum 1 1 8 x 1 1 Angular Aluminum 1 1 PVC 1 34 PVC 1 PVC 1 Sheet Polyglass 100 Pc 3 16 x Screw 100 Pc 3 16 x Screw 100 Pc 3 16 x 1 Screw 1 Pack Cable Tie 1 Set Drawer Lock 2 Set Hinges Table 3 Miscellaneous List of Materials 25 Hardware Component Microcontroller PIC16F877 The microcontroller is the brain of the system It is a 40 pin 8 bit CMOS FLASH microcontroller that functions as the main control unit by driving all input and output devices interfaced in the system It is used to control the output levels of the DC motors the UV lamp the buzzer and the LCD it is also used to read the inputs from the keypad coin sensor counterfeit and bill detector circuits and directs what each circuit component should do Specifications 2 5 5V DC operating voltage e 8 bit CMOS FLASH program memor
66. rd timer counter Output is open drain type RASISSIANS RAS can also be analog input4 or the slave select for the synchronous serial port is a bi directional port PORTB can be soft ware programmed for internal weak pull up on all inputs RBO can also be the external interrupt pin TTL TTL TTL RB3 can also be the low voltage programming input TTL Interrupt on change pin TTL Interrupt on change pin TTUST Interrupt on change pin In Circuit Debugger pin Seria programming clock TTLIST 2 Interrupt on change pin or In Circuit Debugger pin Seria programming data O 7 output input cutput P power Not used TTL TTL input ST Schmitt Trigger input Note 1 This buffer is a Schmitt Trigger input when configured as an external interrupt 2 This buffer is a Schmitt Trigger input when used in Serial Programming mode 3 This buffer is a Schmitt Trigger input when configured as general purpose VO and a TTL input when used in the Parallel Slave Port mode for interfacing to microprocessor bus 4 This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise 89 TABLE 1 2 16 874 AND PIC16F877 PINOUT DESCRIPTION CONTINUED PORTC is a bi directional port RCO T10SO T1CKI RCO can also be the Timer oscillator output or a Timer clock input RCT T1OSI CCP2 RC1 can also be the oscillator input or Capture2 input Compare2 output P
67. rgy per unit electric charge that is imparted by an energy source such as an electric generator or a battery wherein energy is converted from one form to another Britannica Online Encyclopedia Flash memory is a non volatile computer memory that can be electrically erased and reprogrammed Wikipedia the Free Encyclopedia Human Machine Interface HMI or user interface is the aggregate of means by which people the users interact with a particular machine device computer program or other complex tool the system Wikipedia the Free Encyclopedia Integrated Circuit IC is a device made of interconnected electronic components such as transistors and resistors that are etched or imprinted onto a tiny slice of a semiconducting material such as silicon or germanium The American Heritage Science Dictionary Keypad is an input device sometimes part of a standard computer keyboard consisting of a separate grid of numerical and function keys arranged for efficient data entry The American Heritage Dictionary of English Language Light Dependent Resistor LDR or photoresistor is an electronic component whose resistance decreases with increasing incident light intensity Wikipedia the Free Encyclopedia Light Emitting Diode LED is a semiconductor diode that emits incoherent narrow spectrum light when electrically biased in the forward direction of the p n junction as in the common LED circuit Wikipedia the Free Encyclopedia
68. rials and components in the PCB re components properly rendered Determine progaramming language to be used in preparing the microcontroller Consult experts on how should the microcontroller be programed Burn the code and test if it is functioning properly Figure 9 Data Gathering Procedure 22 Design Procedure for Actual Design Based on the data gathered the system must have 3 major parts see Figure 10 These include the Bill Acceptor Control System and Coin Dispenser The bill acceptor is the one responsible for detecting whether the inserted bill is authentic or not for accepting the bill and for identifying the value of the bill The control system is the central brain of the system which typically is the microcontroller It controls all the input and output devices and directs the system what operations to be done On the other hand the coin dispenser is the one responsible for dispensing coins as the name implied For the actual design each of the major parts is divided into circuits The bill acceptor is divided to counterfeit sensor bill detector buzzer UV lamp and feeder motor circuits The control system is just the microcontroller circuit where the keypad and LCD are integrated The coin dispenser consists of coin sensor and coin motor circuits Since the feeder motor UV lamp and coin motor are driven by a relay these are grouped under relay driver circuit All in all there are five circuit divisi
69. rm Subsequently the microcontroller will compare this data to the reference values Since the reference value of P20 00 as 2 matches the data obtained the microcontroller will identify the bill as 20 pesos The bill will be fed to the system and the transaction will begin In contrary to this if the bill detector has obtained a value less than 2 or greater than 5 the system will not accept the bill the system will return to the main menu and wait for another input from the user coin sensor circuit is another fundamental part of the system It is used to detect if a coin is dispensed properly The detection depends on the signal that is sent by the circuit to the microcontroller The circuit is partnered to a motor with a metal shaft or kicker that is placed between the gap of an optical sensor During the rotation of the metal shaft there is an instance where the metal shaft blocks the gap of the optical sensor At this moment the optical sensor s phototransistor is not activated because the light coming from the optical sensor s LED is blocked 33 Papua Sensor of Fiqure 16 D1 WLED YELLOW Q1 2N3 904 TCST110 Figure 14 Coin Sensor Circuit Consider the coin sensor circuit in Figure 14 When the light from the optical sensor U1 s LED is not blocked the U1 s phototransistor allows current to flow in its base making its collector emitter shorted Because of this the current will flow t
70. roponents No fake t bill ccept bi Yes Show coin Show calibration test Ring buzzer denominations menu Show message Counterfeit detected Remove Bill Yes Yes EJ Figure 19 System Flowchart Part 1 41 Show entered number Clear entered Accept entered numbers numbers Is the bill value Show error same as the Total value of total value of denominations is not denominations equal to bill value Does the coin bank have Show error Not enough coins enough coins d to dispense to dispense Dispense Coins Figure 20 System Flowchart Part 2 42 Figure 17 18 show the design s system flowchart The main process of the system starts when the user enters a bill This will serve as input to the counterfeit sensor For the counterfeit sensor to be activated it will have to wait for another input from the keypad which is It will then return a value of either 1 or 0 to the microcontroller depending if it is fake or not An input of 0 meaning the money is fake to the microcontroller from the counterfeit sensor would make the microcontroller send a signal to the buzzer for it to be activated and the whole process will be terminated Otherwise the microcontroller will send a high signal to the relay for the feeder to work and to the bill detector The bill detector will send the binary value of the inserted bill as read by the LDR to the microcontroller for it t
71. s 40 pcs 6 S ful P10 00 1 pc I pc 5 00 6 pcs 6 pcs 7 S ful P10 00 2 pcs 2 pcs NOSE 256 80 pcs 79 pcs 8 P1 00 5 pcs 5 pcs Failed P5 00 5 pcs 5 pcs P1 00 30 pcs 30 pcs 9 P5 00 2 pcs 2 pcs Successful P10 00 pc pc 256 40 pcs 40 pcs P1 00 10 pcs 10 pcs 10 S ful P5 00 2 pcs 2 pcs 10 00 2 pcs 2 pcs Table 9 50 peso Bill Output Test Note Failed incorrect number of coins was dispensed Successful correct number of coins is dispensed For the 50 peso bill output test in Table 9 only set 8 failed the test because the output is only 79 pieces 25 cents which is contrary to the 80 pieces input of the user It has 1 input output difference which is still tolerable because the error is minimal The cause of error is the absence of guide from the dispenser to the cargo of 25 cents 47 Inserted Bill P100 00 Set Denomination s Input Output Result 1 256 400 pcs None Not Possible 2 P1 00 100 pcs 100 pcs Successful 3 P5 00 20 pcs 20 pcs Successful 4 P10 00 10 pcs 10 pcs Successful P1 00 50 pcs 50 pcs 3 P5 00 10 pcs 10 pcs 1 00 40 pcs 40 pcs 10 00 6 pc 6 pc Lauda 7 P5 00 6 pcs 6 pcs Successful P10 00 7 pcs 7 pes 25c 300 pcs 300 pcs 8 P1 00 5 pcs 5 pcs Successful P5 00 4 pcs 4 pcs P1 00 10 pcs 10 pcs 9 P5 00 8 pcs 8 pcs Successful P10 00 5 pc 5 pc 25c 300 pcs 298
72. t changes peso bills inserted by the user to peso coins of choice It is capable of changing 20 peso 50 peso and 100 peso bills only with coin denominations of 25 cents 1 peso 5 peso and 10 peso coins The system consists of vital parts such as the counterfeit sensor device paired with an Ultraviolet light to detect the authenticity of bill bill detector to identify the amount of money inserted coin sensor as dispensing counter relay driver circuit as switching device for gear motors and lamp and the microcontroller circuit paired with a keypad and LCD for control and I O processes The research instrument used is descriptive for information gathering experimental research for design implementation and testing Schematic capture and testing is used to ensure that actual design is feasible The software used to program PIC16F877 is Proton IDE which uses PICBASIC programming for flexibility and easy error debugging capability Keywords counterfeit sensor ultraviolet light bill detector coin sensor relay driver microcontroller Chapter 1 INTRODUCTION AND REVIEW OF RELATED LITERATURE AND STUDIES Research Setting Technological evolution is evidently visible nowadays It can be seen through the different machines and devices that are used from the past to the present Manual operations are gradually omitted by technological means Bill to coin changer is a device innovated from the idea used on vending machines and change machines Bu
73. t neither of the existing devices and or machines provides the means to which people could exchange their bill s to coins without having to pay for something first Most people take public transportation to reach their destination Coins are essential in this scenario Because it is inconvenient to pay a hundred peso bill for the seven peso and 25 cents minimum fare especially in the morning trips most people are forced to buy something just to have their money changed into smaller bills Convenient stores and retail stores are likewise known to be in need of coins especially in the morning for their customer s change With this the proponents came up with an innovation which is derived from the concept used on existing slot machines The proposed machine would be capable of identifying and changing 100 50 and 20 peso bill to 25 cents 1 5 and or 10 peso coin The inserted bill will first be tested using UV light technology to check if it is authentic or counterfeit The UV light technology was chosen over other technologies because it 1s the most commonly used bill authenticity detector Also studies show that the ultraviolet light can scan fluorescent fibers of the bill enabling the user to verify the authenticity of the bill accurately After which the user will be able to choose the combination of coin denomination he wants the machine to dispense Review of Related Literature and Studies Bill Money Changer for Slot Machines One of
74. ted Symbol Parameter min Typ Max Units CONTROL INPUTS CLK IN Pini 4 5 the a Schmitt tigge ciut and is ferefore specised separately Logica put Voltage 4 75 Voc Exoagt 4CLK IN Logica 1 input Current Vin 5 ADC inputs Logica 707 input Currert 0 005 Aoc inputs CLK IN Pin 4 Positive Going Theashold Voltage CLK IN Pin 4 Nagafve 15 Gong Threshold Voltage CLK IN Pin 4 Hysteresis 13 Vr Logica O CLK 8 Output lo 360 pA 04 Voltage Veo 4 75 Voc Logica T CLK A Output Voltage 4 75 Voc DATA OUTPUTS AND NTA Logica 707 Output Voltage Data Outputs lout 1 6 mA 4 75 04 INTA Output lout 1 0 4 75 Voc 04 Logical 4 4 24 Leges t Output Voltage 4 as J m Leakage Data Suffers 5 Voc koce 45 6 iw 5 rr Shortt 20 9o POWER SUPPLY Supply Current Includes Laddar Curran ADCO801 2 03 041CJ 05 ADCOBOSLCN LCV LCWM Mote amp Absolute Mad mam Plating indicatis amies wich dum o Pus de OC and AC electrical ons de not apply when opining device beyond is spe copending Mote 2 are manuod with repu ths Gril unies dhewi ap
75. the circuits are created using Proteus 7 software see Appendix A for the complete circuit diagrams each are tested simulated and properly 39 considered Since all simulations are successful and the desired data are generated by the simulation output hardware can now be implemented Software Design Software Component The software used in programming the code to integrate with PIC16F877 microcontroller is Proton IDE Proton IDE is a professional and powerful visual Integrated Development Environment IDE which has been designed specifically for the Proton Plus compiler Proton IDE accelerates product development in a comfortable user environment without compromising performance flexibility or control It has the following features Code Explorer Compiler Results Programmer Integration Integrated Boot loader Real Time Simulation Support Serial Communicator Online Updating and Plug in Architecture The PROTON compiler takes full advantage of each type of PIC microcontroller available and offers a friendly and intuitive language that allows very complex operations to be carried out with a minimum of fuss and provides a flexibility and functionality that is unparalleled in the world of PIC programming It is functionally compatible with the language of PICBASIC Pro Compiler which offers the beginner a comfortable and familiar environment 40 System Flowchart Insert Bill No No No Yes Show coin Show bank p
76. the studies done by Bruce Edward C Kelly Blue Bell PA in October 30 1990 entitled Bill Money Changer for Slot Machines is very related to the system the proponents are trying to create The author stated that the present invention broadly relates to dispensing devices and more particularly to a coin dispenser for use with gaming devices such as slot machines He also added that the dispenser changes paper bills into coinage which is what the design is all about Moreover his studies contribute much of the information and data on how to create the design One of this information includes the main parts of his design such as the bill activated coin dispenser cabinet enclosing the bill money changer a plurality of separate coin storage cartridges and shoe for receiving coins from each of said cartridges which the proponents referenced and partially imitated Bill Acceptor The study completed by Cheng kang Yu Taipei TW and Wen yuan Tsai Taipei TW in February 7 2006 comprises the design the proponents are creating One important quote the inventors said is that the present invention relates to bill acceptors and more particularly to such a bill acceptor which uses infrared light to fetch the image of inks of the bill to be examined and ultraviolet light to scan fluorescent fibers of the bill enabling the user to verify the authenticity of the bill accurately This line has given the proponents the idea to implement a
77. ue Error Test Note Failed the system shows no error message Successful the systems shows an error message All tests are successful in different kinds of denomination since all sets show an error saying that the denominations total value is not equal to the bill value Another test must be executed which checks the coin bank remaining coins The results are shown in Table14 Bill Denomination s Count Coin Bank Shows Error Result P20 00 P1 00 20 pcs 15 pes Yes Successful P50 00 P5 00 10 pcs 5 pcs Yes Successful P100 00 P10 00 10 pcs 9 pcs Yes Successful P20 00 25c 80 pcs 4 pcs Yes Successful P1 00 20 pcs 0 P100 00 P5 00 6 pcs 2 pcs Yes Successful P10 00 5 pcs 0 Table 14 Coin Bank Error Test Note Failed the system shows no error message Successful the systems shows an error message The test checks the system if it shows an error whenever the coin bank s remaining coins is less than the desired number of denominations Since all sets show an error the results are successful After this the proponents tried to empty all the remaining coins of the coin bank to 0 When the last transaction ended an error message is 50 displayed saying that the coin bank is depleted and can no longer dispense any coins This particular test means that system is operational and functioning well In summary the design is accurate and reliable in terms of program
78. ure in LDR1 for calibration The process on how the counterfeit sensor and bill detector works is described in the following When bill is inserted in the system and the sign is pressed the microcontroller will turn on the UV lamp as well as it will wait for the counterfeit sensor to send a low signal at a certain duration by default the counterfeit sensor sends a high signal to the microcontroller When an authentic bill is inserted the bill will just absorb the light making the resistance of LDR at the counterfeit sensor high The counterfeit sensor will still send a high signal to the microcontroller As the time expires and there is still no change of signal high to low sent by the counterfeit sensor to the MCU the microcontroller will identify the bill as authentic and it will detect the value of the bill by comparing the data obtained from the bill detector to the reference values of P20 00 as 2 P50 00 as 4 and P100 00 as 5 00000010 00000011 00000100 in binary form respectively By default the bill detector reads a converted value of 00001111 and 00010000 15 and 16 in decimal form respectively when there is no bill inserted If any bill is inserted whether fake or not the bill detector will produce a digital converted value For instance if the color value lightness or darkness of color of the inserted bill is light such 32 as 20 pesos the bill detector will obtain a binary value of 00000010 2 in decimal fo
79. y e 368 bytes of data memory RAM e 256 bytes of EEPROM data memory Low power consumption lt 0 6mA typical at 4MHz A D Converter ADC0804 ADC0804 is an 8 bit A D converter used to translate analog signals into digital signals It is easy to interface with all microprocessors and it operates as stand alone This IC is used to convert analog signals from the light radiated by the color of the bill through the LDR to a digital 8 bit binary code Specifications 8 bits resolution 4 5 6 3VDC supply voltage 26 100 45 conversion time 65 C to 150 C temperature range SPDT Relay SRUDH series SRUDH SPDT Relay is a 12 Amp Miniature Power PC Board Relay that is used as a switch that opens and closes under the control of another electrical circuit It is used to control the motors and UV light which are separated from the main circuit the said components require higher voltage than the normal 5VDC supply that is why these are separated Specifications e 12 Amp switching capacity e 6 48VDC 360mW except 48 VDC 510mW 359 Motor RB 35 The motor is used in the coin dispenser which limits the number of coins going out The number of turns is dependent on the inputted number of coin denomination Specifications e 12V 6000RPM Output 120RPM lt 80mA w no load e 100RPM 250mA w 1 2kgf cm 27 4x20 line Dot Matrix Liquid Crystal Display HD44780U The LCD is primarily use
Download Pdf Manuals
Related Search
Related Contents
UM10204 I2C-bus specification and user manual User's Manual Instruction Manual D2 3340 X-Plane 10 manual City Manual Manual de Instalação do DUO SS210 125KHz IC Intracom 503631 network switch Copyright © All rights reserved.
Failed to retrieve file