??? 03/09/12 09:14 Read: times |
#186517 - People responding to specific questions Responding to: ???'s previous message |
Have you added a DC component - or do you have an ADC that can measure negative values?
If all you see is the positive half-cycle, then it depends on how well you did your previous steps if you have introduced a DC error somewhere. But it will be interesting to detect the zero crossing if your ADC don't see samples on both sides of that zero-crossing. Another thing - you have a step where you attenuate to 0.5V? Or attenuate to 5-0.5 = 4.5V? Third thing - how can you calibrate your device? On scale and offset errors? Fourth thing - if your ADC has a reasonably fast conversion rate, you can convert and pick up values in an interrupt routine while leaving the rest of the time for the main program. Sorry but people don't just get excited about someones measurement issues unless you post specific questions. We don't want to write complete programs for other people when we can instead make money by writing complete programs for customers. Do you have any specific questions? For now, you haven't even clearly indicated exactly what kind of wave the ADC would be able to pick up. Note that the top value of a sine wave has quality issues if there is noise in the measurements. Next thing is if you want true RMS or just guestimate RMS based on the peak voltage. For true RMS, you need to measure the energy, i.e. sample for the full cycle of the sine wave. |