CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to calculate the units consumed by electricity

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

How to calculate the units consumed by electricity
PostPosted: Wed Jul 20, 2011 11:53 pm     Reply with quote

Hi,
I want to know how I calculate the numbers of unit consumed by electricity.
I am reading voltage and current in microcontroller. What should be the next step (what calculations/formula I should use to calculate the numbers of units).
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Thu Jul 21, 2011 1:56 am     Reply with quote

Power, is current*voltage*_time_.
This is the difference between a KW, and a KWHr.
A heater (say) draws 1KW. But the total power used, depends how long it is turned on for. If it is only on for 30mins, then 0.5KWHr, but leave it on for a day, and you have 24KWHr.
A 'unit', is normally 1KWHr.

Best Wishes
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Thu Jul 21, 2011 10:59 am     Reply with quote

If you are working with AC, then you also need to consider "power factor" - if the load is NOT pure resistive (inductive etc), then the voltage and current are phase shifted and your measurements will not be correct unless you consider the phase shift as well (this can be a significant number for a big inductive type load for example). For a DC load, then the simple Voltage*Current=watts and if you multiply that by time, you get "watt hours" as was indicated in the previous post.

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

PostPosted: Thu Jul 21, 2011 11:56 pm     Reply with quote

Thanks guys for your replies.
Yes I am working on AC voltages. My load is (2 enery savers each of 25W and 1 fan of 40W). How to handle the phase shift in software and what about power factor?

What i do for calculating kwh?
Can i do something like that, calculate the total power first, then whenever load increases start timer and when load decreases stop the timer. In between according to that value of timer calculate kwh.
Is this scenario right?
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 22, 2011 6:54 am     Reply with quote

Ok.. first , forget about the 'power factor' correction as you can add that later after you get your program 'up and running'.

As 'T' says energy used = volts * amps * time device is on.
Depending on the PIC used and it's speed, you probably should only use integer math NOT floating point. FP math takes a LOT of processor time to compute answers.

Some 'energy meters' set a flag for 'device on' and 'device off' in an ISR,allowing the main program to compute the time the device was powered in a 1 hr period.Simple math of V x A will get you KWhr.

On the hardware side be very careful with wiring and testing !! 120 Volts can be lethal !!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group