In this project i will expalin :
- how to measure dc current. using 16f877 microcontroller
- how to convert current into voltage from using shunt resistor?
- how to design low resistance shunt resistor using simple wire?
- How to display current value on LCD?
Circuit Diagram :
In this circuit diagram, 24 volt dc source is applied to 40ohm load
Current passing through this load is measured with the help of shunt resistor
Now the question is why we need shunt resistor to measure current?
Shunt resistor value is known and voltage is measured with pic microcontroller. So current can be easily calculated by using above Ohm’s law formula.
1N4733A zener diode is used to protect microcontroller from over voltage appearing across it. Because voltage more than 5 volt may damage microcontroller permanently
Complete code of digital Ammeter circuit using pic microcontroller is given below. In this code TRISA is used to define port A as input because voltage is measured with pin number AN0 of port A. TRISB instructions defines PORTB as an output PORT. It is used to send data to LCD. LCD_Init() funtion initialize LCD libraries and ADC_Init() initialized ADC libraries functions.
""cur = read_adc();"" statement used to read voltage across shunt resistor and ""cur=(cur*4.89)/0.50 ; ""statement converts voltage back into current according to ohms law formula. Rest all the lines in below given code is self explanatory, but if you still need any help. You are welcome to comment on this post
Vidéo :