Actaris ACE3000 + S0 output + counter

Forum about 1-Wire devices.
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Jfn »

Today it was also time to experiment with the 1-wire counter from Hobby-Boards. Just recently I had a new electricity-meter installed (I went from a 1-phase to a 3-phase installation).

This electricity meter, an Actaris ACE3000 type 260, offers an S0 output and today I had the opportunity to connect the two together. I could not find any examples of how to connect both together, so with the information I could find I did some experimenting, put things together and now I have a working read-out of my electricity meter.

I thought I would share my experiments with the readers of this forum, maybe someone may benefit from this.

A picture of the experiment:
Image

But how did I connect things together?

The master-hub has 6 channels, each channel having the same connector-layout.

The counter:

Pin 1: (GND) --------> Pin 1 master-hub (GND)
Pin 2: (DATA) -------> Pin 4 master-hub (DATA)
Pin 3: (+5V) --------> Pin 2 master-hub (+5V)
Pin 4: (Counter A) --> S0(-) from the electricity meter

The +15V (I use a 15V power-supply) on pin 7 from the masterhub is connected to the S0(+) terminal of the electricity meter.

To conclude with, here is a picture of the electricity meter with the wire to the S0 output. As you can see it is fitted behind a sealed compartment, so make sure to ask the engineer placing the meter to also connect a wire to the S0 output.
Image

Als het niet gerepareerd kan worden dan is het niet kapot!
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Jfn »

I installed owfs which takes care of reading the counter. Next step is to store the output in a database:

Code: Select all

debian:/1wire/1F.46E803000000/main/1D.071B0D000000# a=`cat counters.A`
debian:/1wire/1F.46E803000000/main/1D.071B0D000000# echo $a
252
debian:/1wire/1F.46E803000000/main/1D.071B0D000000#
I used 0.25 KWh of electricity sofar.

I am also working on 'redecorating' the cupboard. As you may have noticed the current setup of the electricity counter is not ideal [:)]

I need to do some paintwork, fit an CAT5e patchpanel, run CAT5e cabling to every room in the house and when this is finished the metering-setup will go from experimental to a more definitive configuration.


Als het niet gerepareerd kan worden dan is het niet kapot!
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Jfn »

I have a simple perl script running now that inserts the current counter value into the database every 15 minutes.

I was wondering at what interval others are storing their electricity consumption in a database. Do you also use 15 minute intervals, or something different?

My choice for 15 minutes is just a random choice.


Als het niet gerepareerd kan worden dan is het niet kapot!
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Digit »

I store power usage per hour. But since you're in full control, you can choose the interval *you* want or need; just don't let other opinions lead you in that...[:)]
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Digit »

BTW, forgot to add this: good job!... so, when can we expect the first charts?
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Bwired »

Nice Job!
I store the Energy, gas and water counter every minute but one record per hour. So I update the (hour) record every minute. I think Digit means the same.
http://www.domoticaforum.eu/topic.asp?TOPIC_ID=179
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Jfn »

One record per hour and a per minute update of that record is a good one. I think I will implement that. That way I have historical data on an hourly basis and still have up-to-date info on the current energy-consumption.

Do you have seperate energy measuring devices for particular equipment (I have airconditioning installed in my home and I intend to fit a seperate energy-monitor just to measure its energy consumption), or do you just measure the total usage?

(Furthermore, I am still waiting for the arrival of the CNY70 so I can start measuring gas usage. Conrad has them on back-order, they should be available again in the second week of april.)

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Bwired</i>
<br />Nice Job!
I store the Energy, gas and water counter every minute but one record per hour. So I update the (hour) record every minute. I think Digit means the same.
http://www.domoticaforum.eu/topic.asp?TOPIC_ID=179
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">Als het niet gerepareerd kan worden dan is het niet kapot!
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Bwired »

In the record I have stored:
- Date Time
- Hour (every hour 1 record, hour record is updated every minute)
- Counter_begin (begin of the hour)
- Counter_end (counter sended by RFXmeter of 1-Wire device)
- Watt (counter_end - counter_begin)
- Daily usage (Every hour SUM field Watt for that day, easy for website and charts)
- Meter_low (actual meter)
- Meter_high (actual meter) Day night rate
- Actual_usage (The usage at that moment can be calculated if you read every minute /60)

For now only total energy. I want some separate energy measuring devices as well for some heavy devices. Conrad has some FS.. stuff which are sending at 868Mhz.
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Jfn »

I changed my setup a little. Every hour now I update the database with the current counter-value (I do not need a per minute look at my energy consumption).

I used to store the following fields in the database:
- recordtime (type DATETIME)
- counter (type INT(5))

These records contain all the information I needed. The difference betwee two counter-values is the amount of energy consumed during that hour.

If I want to know how much energy I consumed during the day, I sum the difference between the last 25 records.

The Dallas DS2423 counter can only count up to 65535 before starting over at 0. There is a slight chance that in any sql selection the following situation occurs:

The counter reaches 65535 and the next measurement gives a 0 or higher value.
This can be dealt with easily. When the result of subtracting the last record from a previous one gives a negative value, I add 65536 to compensate. So: 0-65535+65536=1

But what when in any selection the roll-over from 65535 to 0 happens more than once? This means that within that period I used at least 65 KWh.
Because I cannot detect this from happening in an easy way (other then storing all measurements in an array and checking each entry one-by-one), I decided to add an third column to the electricity table that holds the amount of KWh used between to measurements.
Although this information is already in the database (Kwh=difference between two counter values), storing KWh usage as a seperate field makes retreiving information from the database far more easy. I can just do a SUM over several KWh records and I have instant read-out of energy consumption within that period.

So now the table 'electricity' contains three fields:
- recordtime (type DATETIME)
- counter (type INT(5))
- kwh (type INT(5))

I am working on graphics of the energy consumption. When finished, I will provide an URL.


Als het niet gerepareerd kan worden dan is het niet kapot!
Mhwlng
Member
Member
Posts: 172
Joined: Sun Aug 26, 2007 4:16 pm
Location: Netherlands

Actaris ACE3000 + S0 output + counter

Post by Mhwlng »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
The Dallas DS2423 counter can only count up to 65535 before starting over at 0<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">The DS2423 have 32 bit counters....

Marcel
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Bwired »

I had the same thoughts you have but changed along the way :-)
In certain situation I want to know the exact energy usage. I have now this event running: If the alarm is on and there is no one at home I get a signal on my Cellphone when the power usage is above X KWh. I can run a statuscheck on my powerline to see what is going on and which devices are switched on.
Agree, sometimes its better to store some redundant data in a record (like I do) resulting also in quick queries.
If the Bwired webpage is opened more the 50 queries are fired up.
Regards.Pieter
Mhwlng
Member
Member
Posts: 172
Joined: Sun Aug 26, 2007 4:16 pm
Location: Netherlands

Actaris ACE3000 + S0 output + counter

Post by Mhwlng »

I have a common database for all different (analog) values

for power, I show 7 charts :

power [W] value every 30 min for the last 3 days
power [W] average+min+max per day for the last 64 days
power [W] average+min+max per month

energy usage [kWh] total value per day for the last 64 days
energy usage [kWh] total value per month

energy usage [Euro] total value per day for the last 64 days
energy usage [Euro] total value per month

older data is automatically compressed or deleted if older than above date ranges.

that way, I don't end up with a huge database (that my poor passively cooled 1Ghz VIA processor must handle)

Marcel
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Jfn »

If it is 32 bits, that means the counter can count up to (2^32)/1000 = 4,294,967 KWh.

If I look at the KWh consumption during the past year, I used < 3000 KWh.

Simple math tells me that I do not have to worry about the counter resetting to 0 for at least the next 1400+ years .... Nice!

My domotica systems runs on an Intel GLY2 with 1GB of memory. Currently I have 42 entries in the database, occupying 2.7KB of space. Every new record adds 66 bytes of information. Let's say the system runs for another 50 years. This means the size of the database will grow to roughly 50*365*24*66 bytes = 27MBytes. I think my server should be capable of handling that amount of data very easily.

Maybe I will change the way data is logged in the future, but for now storing an entry every hour is sufficient. In the near future I will fit some equipment (airconditioning, washing-machine) with a seperate energy measuring device.

And if I do need up-to-date info about current energy-consumption (For a dynamically generated webpage), I just read the current counter-value directly from the DS2423 and subtract from it the last value in the database. This way I always have real-time info on energy-consumption on a hourly basis.



Als het niet gerepareerd kan worden dan is het niet kapot!
Jfn
Member
Member
Posts: 332
Joined: Tue Feb 26, 2008 2:01 pm
Location: Netherlands
Contact:

Actaris ACE3000 + S0 output + counter

Post by Jfn »

A graphical representation of today's energy consumption. Created using the (unregistered) version of ChartDirector.

The image is generated real-time from data that is fetched from a MySQL database. Twelve o'clock at night will show an very small graph, but as time passes it will grow ...

Image

Edit: Added the php code that generates the graphic


Als het niet gerepareerd kan worden dan is het niet kapot!


<b>Download Attachment:</b> Image electricity.php.txt<br />2.67 KB
DJF3
Advanced Member
Advanced Member
Posts: 895
Joined: Thu Jul 12, 2007 9:28 am
Contact:

Actaris ACE3000 + S0 output + counter

Post by DJF3 »

Thanks for the code. It's always good to see examples of php/asp/vb code that you can use to create your own code..

Cheers
DJ
Post Reply

Return to “1-Wire Forum”