Home power consumption measuring unit

From CaveLab
This page is kept for historical interest. It may document projects or methods that are obsolete and/or no longer relevant. The information here is not kept up-to-date.

This module was given to a friend many years ago.
Home power consumption measuring unit complete and connected

You need a light sensor that registers LED flashes from your house power consumption unit. In Norway we have a unit that emits a LED flash every X kW. This sensor connects to the module. The consumption is measured in kW and calculated by counting the number of pulses and divide by 500 (500 pulses pr. kW). The registration will continue as long as the module receives a signal from the light sensor, the used amount can then be read using serial communication from the computer.

Two values are stored, current and present usage. By sending a command to the module the current value can be moved to the previous, thus making it possible to compare periods. Current usage value is deleted when moved to previous. These values are stored in EEPROM every hour, and is used when the module start up from e.g. a power loss. That means that you could lose one hour of monitoring. You can also enter a desired start usage value.

Before any EEPROM values are stored the module will display -1 kW current and previous usage. There can be reset by moving current to previous two times (command 4). Correct EEPROM values will then be stored one hour after first received signal.

Video

Connectors

Power connector

2,5 mm, 9-12V=, positive center.

9-pin Sensor

  • 6 : 5V + out
  • 7 : 5V - out
  • 8 : 5V + sensor in
  • 9 : 5V - sensor in

9-pin RS-232

  • 2 : Transmit
  • 3 : Receive
  • 5 : GND

Communication

Forbruksmaaler v.1.0                                                           
JensenCorp 0704001                                                             
                                                                               
Press 0 for help                                                               
                                                                               
1 - Current usage                                                              
2 - Previous usage                                                             
3 - Enter starting point                                                       
4 - Move current to previous                                                   
                                                                               
Current usage will be deleted! (0 to cancel)                                   
Enter starting point in kW : 100                                               
100 kW saved                                                                   
100 kW current usage (50000 pulses)                                            
100 kW moved to previous                                                       
100 kW previous usage                                                          
0 kW current usage (0 pulses)

Serial settings

Baud
9600
Data bits
8
Parity
None
Stop bits
1

Source code

Git-alt-brands.svg
Bascom-AVR source is available in a git repository:
https://github.com/thomasjsn/AVR-Home-power-consumption

Gallery

Schematic drawing

Home-power-consumption-measuring-unit-circuit-2qek9q.png

Parts list

Sensor not included.
Qty. Part
1 × AVR ATtiny2313-20PU, DIL-20, 20 MHz, 18 I/Os
5 × Capacitor, aluminium electrolytic, 1 µF, 50V
1 × Capacitor, aluminium electrolytic, 10 µF, 25V
2 × Capacitor, aluminium electrolytic, 47 µF, 25V
2 × Capacitor, ceramic, 1 nF, 100V
2 × Capacitor, metallized polyester foil, 10 nF, (0.01 µF)
1 × D-sub cable, pin-to-pin 5m, 9-pin male-female
2 × D-sub soldering cups, 9 pin female
1 × D-sub soldering cups, 9 pin male
1 × DIL socket, 16-pin, 7.62mm
1 × DIL socket, 20-pin, 7.62mm
1 × DIL socket, 6-pin, 7.62mm
1 × Diode, rectifier, 1 A, 400V, 1N4004
1 × Enclosure, plastic (1591 FL), 112x62x31mm, flange
1 × Fuse 5x20 mm, 400 mA, fast-acting
1 × Fuse holder, open, PCB, 5x20mm
1 × Fuse holder, open, PCB, Protective cover
1 × Heatsink, 27.3K/W, 19mm, attachable, TO220
1 × LED 3mm, Green, 2.1V, 20mA, 3.5mcd, 38°
1 × LED 3mm, Yellow, 2.0V, 20mA, 2.5mcd, 38°
2 × LED holder 3mm, Black plastic
1 × Optocoupler, single, CNY17F-3, DIL-6
32 cm2 PCB, stripboard, 100x160mm, 160cm2
1 × Power jack, panel, 2.5mm, plastic housing
1 × Power jack, plug-in, 2.5mm
4 × Resistor, carbon film, 0.25W, 330 Ω, 5%
1 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
1 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
1 × RS232 interface, MAX232CPE, dual
2 × Spacer, round unthreaded, 3mm, Ø6mm, Delrin
6 × Straight pin header, female, Dual row, 2.54mm
9 × Straight pin header, female, Single row, 2.54mm
2 × Straight pin header, male, Dual row, 2.54mm
17 × Straight pin header, male, Single row, 2.54mm
1 × Voltage regulator +5V, 2 A, L78S05CV