Elenco Snap Circuits SnapMicro ® I Standard User Manual

Page 68

Advertising
background image

67

Project 19, Green Power Meter or An Energy Cost Data Logger.

A data logger can be used to store data on how much electricity is being used by a device. For example,
the light sensor is placed by a lamp in a room. When the lamp is turned on the micro-controller records
the time. When the light is turned off, the time elapsed is calculated and stored. The time on is then used
to calculate the kilowatt hours of energy used and the cost based on the current price of electricity. Total
cost per day is then stored for displaying when requested. PICAXE

®

timing is pretty approximate & can

vary by ±1%. Consider the flow chart below.

This section gathers and stores data.

This section calculates and displays cost.

Since the flow chart editor will not allow a decimal, write the word “decimal” instead and convert it to a
decimal poin

t after transforming the flow chart to a basic program. The ‘¢’ symbol can be entered by

holding down the <alt> key and entering 0162 on the number pad. Open the program editor and enter
the flowchart as shown above. Be sure to save it before converting to basic. After converting to basic
your program should be similar to the one shown on the next page.

Advertising