Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Meassuring Energy consumption using PIC

Status
Not open for further replies.

ADGAN

Full Member level 5
Joined
Oct 9, 2013
Messages
295
Helped
4
Reputation
8
Reaction score
4
Trophy points
18
Activity points
1,837
Hi! I tried to build an energy meter using MCP3901 IC but failed to do due to some unidentified error in the source code. I had to use a resistor divider for voltage measurements and a 200 micro ohm shunt for current measurements. Since I had failed to do this I thought of going to an alternative which measures the energy consumption of a conventional energy meter using an IR sensor. I was wandering whether I could use the A/D converter of the PIC for this task and placing zener diodes for protection. I wanted to know whether it is possible and whether some one has done this before? I would really appreciate if you could give a source code too. I have less than 7 days to finish the project. Pls help.
 

What failed in your first attempt?
The most straightforward way to measure current is to use a voltage divider and a shunt resistor - you should protect the inputs with diodes.
 

...I thought of going to an alternative which measures the energy consumption of a conventional energy meter using an IR sensor...

IR sensors may be used to indirectly measure temperature of a theoretical black body, and thus I presume it is not a good approach to reach the task. There are other ICs nice to this task such as ADE7755.


+++
 

I know using an IR sensor is not a good is method, since I have only couple of weeks to finish the project I have no other options. I have purchased MCP3901 IC from the US and no time to purchase other ICs such as ADE7755. I don't know whether the error is with the hardware connection or with the software. I made it by referring to MCP3901 PIC18F65J90 Shunt Meter Reference Design ( **broken link removed** ) I think I burnt my MCP2200 which means I can't calibrate the meter. The program doesn't run after a while loop which uses to initialize the MCP3901. Also the energy variable has been defined as an integer in KWh, but I want to display it with couple of decimal places. I have post the source code.

View attachment AEBS - Copy.rar
 

I think if you r going with microcontroller then you don't need any ir sensor you just use voltage divider for voltage measurements and use shunt resister for current measurement and do mathematical procedure using PIC microcontroller and the best PIC for this purpose is PIC18f452 as I have used this for same task...
 
  • Like
Reactions: ADGAN

    ADGAN

    Points: 2
    Helpful Answer Positive Rating
I think if you r going with microcontroller then you don't need any ir sensor you just use voltage divider for voltage measurements and use shunt resister for current measurement and do mathematical procedure...

I agree that´s in essence the core of task to measure energy consumption, however it is intricate due he must be able to deal with real time RMS calculations. Anyway this can solve his problem without need to acquire some dedicated IC.


+++
 
  • Like
Reactions: ADGAN

    ADGAN

    Points: 2
    Helpful Answer Positive Rating
I think if you r going with microcontroller then you don't need any ir sensor you just use voltage divider for voltage measurements and use shunt resister for current measurement and do mathematical procedure using PIC microcontroller and the best PIC for this purpose is PIC18f452 as I have used this for same task...

Pls sir will you be kind enough to share your source code.
Is there any speciality in PIC18F452 ? Im using PIC18F45K22
 
Last edited:

Pls sir I'm waiting for a favorable reply from you
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top