HOME > >
SENSING AND CONTROL MAIN PAGE > >
DS025 MAIN PAGE > >
Software for monitoring "On / Off" events with a Dallas DS2423 counter chip on a MicroLan.
This page explains a detail of my shareware MicroLan monitoring application.
That application watches over a network of sensors, checking for the latest reading in each from time to time, saving the answer to a data file, and drawing a graph of what it has seen.
That's fine, for something like temperature. It doesn't work so well, in any simple form, for something like watching to see if a door has been opened. Why not? The simple answer is to put a sensor on the door. But! What happens if the door opens, and closes again during a period when the application is looking at other sensors on the net? In that case, the application won't "see" that the door was open. (I'll discuss uses other than door monitoring later.)
My solution is as follows.
I started by putting a reed switch on the door frame, and a magnet on the door. This would be part of the "simple solution", or of any burglar alarm. (Reed switch: It switches "on" when a magnet is near, off otherwise.)
Instead of wiring the reed switch directly to a 1-Wire device, I use it to connect and disconnect a series of "on"s and "off"s (from a small circuit producing them at about 5 a second) to a 1-Wire counter. When the door is closed, the stream of pulses is connected to the counter, when it is shut, the stream is disconnected, and the number in the counter of "counts seen" doesn't rise. (Actually, in practice, for door monitoring, it is best to add a further tiny bit of circuit to invert the signal from the reed switch... but ignore that, for the moment.
Once that's in place, DS025 (my shareware MicroLan monitoring software) is able to "watch" the door for you. Even if the door isn't open at the moment DS025 looks at the latest value in the counter chip's "counts seen" register, DS025 can tell if the door has been open or not recently from changes (or the lack of changes) in the register.
DS025 displays the result as a line across the display. If there have been no changes in the value in the counter, the line is at one vertical level. If there have been changes, the line is higher. In other words, it plots a square wave.
Other uses for this monitoring of binary (two state, e.g. "on/off") phenomena....
A friend has a weekend cottage. It gets its water from a well, with an electric pump. DS025, plus FarWatch, allows him to see if the pump has been running. Why does he care? Why would the pump be running if he wasn't there? Ever had a water leak in your house? You will know that if that leak had run for, say, three days, before you were aware of it, you would be unhappy. How do you check if there are any leaks at a weekend home without visiting? DS025 + FarWatch! (He also monitors the house's temperature.... the house is far enough north that if the heating fails he can get frozen pipes... which then split, thaw and... we're back to flooding!! Water... can't live with it, can't live without it!)
You may want to record when an alarm system has been turned on, when it is off. Nothing easier for DS025's "on/off"... and remember that not only do you have a display of the past week or so's activity, but that data has been recorded in a machine readable file.
Do you have a greenhouse? How often is the heater switching on? When do the roof vents open?
Willing to turn your TV fully off when not using it? Then you can monitor how much you use it.
Dieting? How often do you open the fridge door?
Feed the birds? Put a sensor on the feeder... how often are birds on it? And when? Do flying squirrels (or other) visit the feeder in the night?
Let me return to why I inverted the signal from the door. For something that is always on or off for extended periods, more than about 5 minutes, you don't have to worry about the following.
At the moment, the system, in detail, works as follows:
When DS025 looks at the number in the counter, it asks "is this different from last time?"... and if so, it concludes that the monitored device has been on. ("On" defined as "in whatever state causes the stream of pulses from the supply to pass through to the counter.")
Thus, the system is very good at noticing things that have been mostly off, but on for even a brief time. It is not good at noticing brief "offs" in something that is mostly "on".
It may even be too good at noticing brief "on"s, in fact. In some cases, your circuits might be guilty of the occasional "spike", which looks to the counter as if the stream of pulses is being passed to it.
So... where does the stream of pulses come from? I have a simple little circuit based on a 555 timer. What I don't have is the time to write that up just now... I hope you can make your own arrangements, or find what you need elsewhere on the net... but if you are really serious about using the "on/off" monitoring channels of DS025, and can't manage otherwise, do get in touch.
Click this to search this site without using forms, or just use......
The search engine merely looks for the words you type, so....
* Spell them properly.
* Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....
Please also note that I have another site, and that this search will not include them. It has its own search button.
My site at Arunet.
Ad from page's editor: Yes.. I do enjoy compiling these things for you...
hope they are helpful. However.. this doesn't pay my bills!!! If you find
this stuff useful, (and you run an MS-DOS or Windows PC please visit my
freeware and shareware page, download something, and circulate it for me?
At least (please) send an 'I liked the parallel port use page, and I'm
from (country/ state)' email? (No... I don't do spam)
Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.
Looking for email, domain registration, or web site hosting? If you visit 1&1's site from here, it helps me. They host my website, and I wouldn't put this link up for them if I wasn't happy with their service. They offer things for the beginner and the corporation.
By the way.... I am interested in buying any second hand Dallas Rain Gauge or Wind sensor (any version). It must be in reasonable condition mechanically- no cracks or broken bits, but I'm hoping you have one with "dead" electronics, which you are willing to sell for a price that reflects the fact. The "no broken bits" requirement doesn't extend to the electronics. Shipping: It can be to the US or the UK. If you have something for me, please click here for my eddress?
This is part of just one of my websites. Please visit any of the following....
Pascal programming tutorials
Electronics for hobbyists and schools
Main Home Page... various topics, not all computery.
You can email this page's editor, Tom Boyd. Click here for details.
Index of sensing and control pages (From there you can also go to other help from the editor of this page.)
Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org
-- Page ends --