Hi,
I am trying to measure and log energy consumption of a house appliance as well as temperatures off 2 thermocouples and 3 DS18B20.
I have gone down the route of:
1) Buying a second hand energy meter (the ones used by the electricity board). The meter flashes a LED 1000 per kWh, at a frequency of 0 to 4 Hz.
2) Building a sensing circuit as described in http://ciseco.co.uk/forum/viewtopic.php?f=15&t=59 After some calibration of the variable potentiometer I got the pulse long enough to be catchable by a listening Picaxe through an interrupt. I don't know how long the inpulse from the meter lasts, but I know I could potentially miss it if I was in the process of writing to a LCD screen.
This means that a Picaxe could not do anything else but listen for the pulse. Instead I need it to read the temperatures, read the time from an AXE033, write to the EEPROM and display on the LCD.
Apart from listening to the pulses all other activities are not time critical as the logging frequency is once every 15 minutes. Nevertheless if the Picaxe is busy with any of them it will miss a beat.
I am caught in a vicious circle.
Is there a clever way of counting the pulses, maybe with a different chip (a counter? is there such a thing?) or something else and then read it with the Picaxe (say a 28X1)?
METHOD 1:
I thought of this, but please suggest something else if you think it would work better:
1) Use an 8M to count the pulses and increase by one the duty cycle of a PWMOUT command. Also listen for a "dute cycle" reset (a pin held high?) from the main Picaxe
2) convert the PWM signal into a voltage signal in some ways (resistors, capacitors, inductance?)
3) use readac10 on the mainPicaxe to read the integrated signal.
I don't particularly like this method for various reasons:
a) it seems complicated
b) the resolution of the PWM and of the readadc10 are the same and this calls for the need for great accuracy (and linearity)of the integration device
c) by listening for the duty cycle reaset on with the countig 8M I could still miss a bit
METHOD 2:
I could increase the value of the 4k7 resistor to increase the charge time of the 1uF capacitor in the circuit http://ciseco.co.uk/forum/viewtopic.php?f=15&t=59, therefore making the pulse longer and allowing some extra time to do other things. Still that would not solve the problem as the readtemp12 takes up to 750 ms to execute.
I think I a m stuck here. I would welcome suggestions or pointers
Thanks
Riccardo
I am trying to measure and log energy consumption of a house appliance as well as temperatures off 2 thermocouples and 3 DS18B20.
I have gone down the route of:
1) Buying a second hand energy meter (the ones used by the electricity board). The meter flashes a LED 1000 per kWh, at a frequency of 0 to 4 Hz.
2) Building a sensing circuit as described in http://ciseco.co.uk/forum/viewtopic.php?f=15&t=59 After some calibration of the variable potentiometer I got the pulse long enough to be catchable by a listening Picaxe through an interrupt. I don't know how long the inpulse from the meter lasts, but I know I could potentially miss it if I was in the process of writing to a LCD screen.
This means that a Picaxe could not do anything else but listen for the pulse. Instead I need it to read the temperatures, read the time from an AXE033, write to the EEPROM and display on the LCD.
Apart from listening to the pulses all other activities are not time critical as the logging frequency is once every 15 minutes. Nevertheless if the Picaxe is busy with any of them it will miss a beat.
I am caught in a vicious circle.
Is there a clever way of counting the pulses, maybe with a different chip (a counter? is there such a thing?) or something else and then read it with the Picaxe (say a 28X1)?
METHOD 1:
I thought of this, but please suggest something else if you think it would work better:
1) Use an 8M to count the pulses and increase by one the duty cycle of a PWMOUT command. Also listen for a "dute cycle" reset (a pin held high?) from the main Picaxe
2) convert the PWM signal into a voltage signal in some ways (resistors, capacitors, inductance?)
3) use readac10 on the mainPicaxe to read the integrated signal.
I don't particularly like this method for various reasons:
a) it seems complicated
b) the resolution of the PWM and of the readadc10 are the same and this calls for the need for great accuracy (and linearity)of the integration device
c) by listening for the duty cycle reaset on with the countig 8M I could still miss a bit
METHOD 2:
I could increase the value of the 4k7 resistor to increase the charge time of the 1uF capacitor in the circuit http://ciseco.co.uk/forum/viewtopic.php?f=15&t=59, therefore making the pulse longer and allowing some extra time to do other things. Still that would not solve the problem as the readtemp12 takes up to 750 ms to execute.
I think I a m stuck here. I would welcome suggestions or pointers
Thanks
Riccardo