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.

Why is single channel voltage data-logging so expensive? (£96)?

Status
Not open for further replies.
T

treez

Guest
Newbie level 1
Hi,
We wish to monitor our factory’s mains voltage with a voltage reading data-logged every second for 10 hours each day.

We will feed the isolated , rectified and divided down mains voltage into a datalogger…the EL-0EM-3…

EL-OEM-3 (£25.95)
https://www.lascarelectronics.com/easylog-data-logger-el-oem-3/

(We will isolate the mains voltage with a cheap £2 mains transformer).

After the EL-OEM-3 has collected the readings, we will connect it to a PC and interrogate the readings….
To do this we need to also buy the USB interface board, the EL-0EM-TEST
EL-0EM-TEST (£69.95)
https://www.lascarelectronics.com/easylog-data-logger-el-oem-test/

This in total will cost us £96. Are there any cheaper ways to do this?
 

Hi,

You know that I have an advanced meter especially designed for mains measurement.
High speed, high resolution, high precision. It's about 400Euro.
So i think £96 is not very expensive.

Btw: Average of rectified is not the same as RMS. Any noise, or distortion will corrupt your measurement result.

Klaus
 

Thanks, Klaus, i know that your kit is very high quality and we may be looking toward you for it in due course.
At the moment our boss only wants to spend pennys.
Thanks, yes you are right, if we filter a divided down mains voltage then it will filter out short term deviations.
I think we need to just have a 10:1 (say) step down mains transformer, then rectify the output of this.......then divide it down and feed the half sines into a PIC ADC which will take a adc reading every 200us and store the maximum one every second.....then we will see the mains peak every second, which will suffice for us....this PIC will put out a voltage representative of the ADC measured voltage out of its DAC into the above named data logger. (though we wish we could find a cheaper one).
So now we are going to need a PIC with an ADC and a DAC too..but that should be cheap
 

Check whether 'measurement computing' model usb-1208fs , a usb daq satisfy your requirement.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
I'm not sure exactly what you are trying to record in the log but 'reading every 200uS and store the maximum one every second' after passing through a transformer and attenuator suggests you are just trying to measure peak voltages of each half cycle. If that is the case, it would be easier to use a zero crossing detector and delay one quarter cycle (at peak of the cycle) then take a single measurement.

Almost all PICs have ability to produce analog output if you really have to convert to analog for logging. Just use the PWM output and an RC network, it is as accurate as the ADC resolution so you lose nothing and it's free!

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Thanks, yes i take your point. (and yes you are right we are trying to measure peak...continuously) This is just a rough test jig though and we do not want the extra zx detector.
If we read it every 200us, then the worst case means its be a few 100mV less than the peak really is which is ok for our needs at present.
I appreciate your way is more efficient coding but to be honest this is the way we know how to do it quickest, us not being software engineers and not having the time to get into it.

To be honest we arent software people and just need to whack off the software as soon as we can...and the quickest way we personally can do it is repeatedly read the adc every 200us...then keep storing the maximum one...and spit it out to the data logger every second or so....this kind of software crudeness suits are grunting, caveman-like approach to software on the few occasions that we have time to devote to it.

Yes we do need to get into how to get a PWM out of a PIC though at some time in future........i remember a PIC years ago that had a simple PWM register (one for period and one for on time) that i used..but those dont seem to be around any more and it seems to want a repetitive ramp to be set up, and a timer to time the ramp or something, then somehow get the pwm like that.
 

I appreciate your honesty about the software but it really is VERY easy.

1. configure the registers including setting the PWM rate.
2. detect zero crossing
3. delay. This would be 5mS for 50Hz mains.
4. read ADC.
5. Set PWM width.
6. go back to step 2.

Simplest zero crossing is a high value resistor between rectified (but not filtered) AC and one of the PIC pins.
Provided you don't use a silly frequency, the PWM resolution is 10-bit so you from a 5V supply you can produce an analog output in ~4.8mV steps.

That would be easier and probably more accurate than taking ADC readings at 5KHz rate and then sorting the results. Bear in mind you still have to work out when the peak has passed to know when to stop sampling and do the sorting/reporting.

I'm picturing an 8-pin PIC 12F683 which has ADC, PWM and an internal clock.

Brian.

- - - Updated - - -

Just to see how easy it is, I wrote the code below and simulated it. The integrated (10ms) PWM output was on GP2, the rectified AC is on pin GP0 and the ZCD input is on GP4. As an aid to check timing, a positive going pulse is produced on GP1 at peak AC cycle. Written in 'C' for 12F683 is uses in total 265 bytes! It could be much smaller if written in assembler.
Code:
#include "Y:\\projects\\VillaCon\\ACPeakToPWM\\ACPeakToPWM_Auto.h"
#include <Delays.h>

void UserInterrupt()
{
}

void UserInitialise()
{
    PeakDetected = 0;    // initial state
}

//*******************************************************************************
void UserLoop()
{
}

void ZCDetected()   
{
    Wait(5);
    PeakDetected = 1;
    PeakDetected = 0;
    ADCON0 |= 1 << GO;
}

void ADCFinished()
{
    unsigned int ADCResult;
    
    ADCResult = (unsigned int) ADRESH << 8;
    ADCResult += (unsigned int) ADRESL;
    SetPWM1Volts(ADCResult);
}

Note that this is not 'stand alone' code, it uses libraries in the compiler and the 'Wait()' time may need some tweaking as it starts from the rising edge of the ZCD input signal, if you feed it with rectified AC you need to take into account the time for the voltage to cross the logic threshold. It will still be representative of the peak but not exactly at the peak.

Should add that the compiler is a UK written and marketed product!

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Thanks Betwixt, this looks great.
I believe that we will want to do it like this, though in the first place, we dont have that compiler and our place will insist that we use the free one available from microchip.
The thing is that we would have to write the code behind those functions and it would end up being quicker for us to just do it using our "cave-man" method for this first unit.

I see your point about calibrating the zx detect (the delay after which the peak is said to occur).
As you know, when the mains value changes, it would de-calibrate it slightly, but probably not enough to worry about i would confess.
 

There is a free version of the compiler I use but the full 'PRO' version only costs £50 and it has full debugging and simulation (digital and analog) built in.
I think the free version can compile up to 2K of code so it would easily handle that program.
Look at http://www.fored.co.uk . I have no connection with the company but find their product very easy and efficient to use.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top