I'd like to control ventilation and some other household functions with some kind of home automation. I'd like to be able to track temp and humidity in various parts of the house also. I have some knowledge of programming, electronics and making circuit boards for that matter (not that I want to make any circuit boards)!
Not knowing much about this, here is what I'm thinking and please feel free to tell me what is crap!
I've seen these one wire sensors. That would seem to me the way to go but I'm unsure how this interfaces with the automation. How does this work? Can this be interfaced with any of the STAMP modules that are available?
The way I picture this is that one wire sensors feed the STAMP (or other automation control) and that is interfaced to a home PC. Is that about right or are these things best done otherwise?
How is the programming handled? I've seen mention of Ada and C on the STAMP level.
I'd be wary of _depending_ on Dallas / Maxim 1-wire for new applications.
The Applications Engineer for the 1-Wire and iButton Groups wrote me : " It is correct that the DS2890 was recently assigned a NRFND status. Our customer base on this product is very small and ongoing R&D investment is large and prohibitive to convert the 6" wafer based design to an 8" wafer equivalent that is necessary to continue production in our wafer fabs. Our EOL strategy for this device is to build a supply of product that will provide a 5yr to 7yr supply to existing customers. "
Nonetheless, I've developed a family of pcboards that provide signal conditioning, power supply and analog, digital, and 1-wire connectivity for what I call THOL (Temperature, Humidity, Occupancy and Lighting). They are designed to fit in single gang switch box for wall or ceiling mounting, are connected to a multiplexor at one or more central locations for logging via DMX, 1-wire and PC-PCI 16-bit AD converters. I expect the first boards back in a week or so. If I like the prototypes, I may put together a large order.
Most HA systems are not very good at data logging (checking, interpreting, representing, and storing data). This system is designed to address that need in a robust and redundant way.
I suppose that if you put the logic near the sensor then you are less needing of the capability of one wire.
That sounds pretty nice.
Have you done anything with picaxe?
It looks like that should handle the DMX also. Thanks for the tips.
I'm trying to go solar here. I've got a fairly large solar air heater on the south wall and am working on 120 ft2 of solar water. When I have some more time I'd like to run a dessicant solar AC. All of that needs some logic, some logging and some adjusting! Probably lots of adjusting.
I'm thinking now of a picaxe for each device and a DMX cable back to another picaxe for logging and master control:
but I'm not crazy about that idea!
Wonder what it would take to write to a USB memory stick as I see that picaxe can read to USB, but I don't know about the reverse. Could import the data to a PC later and sort it all out later, though I see that timestamping is not trivial.
I expect the first boards back
From the little I've looked into it, I can see that's a big complex problem. I suppose it would be easier to dump it off to a PC to process and store but that negates the whole high availabilty, low power concept. This gets hard fast!
I thought my 1920 house was old (I peeked through your site!)!
No. PICAxe is Microchip PIC. I've been using Atmel AVR with BASCOM
Much more scalable than PICaxe.
DMX is more demanding of the MCU than it seems at first blush. For a few inputs/outputs, it would not be worth the effort in my opinion and standard
8-bit data resolution is often insufficient for data collection.
As I understand it, you want both real time control and logging. This is trickier than it may seem at first. What happens to the logging, for example, while you are reprogramming?
This is one reason that I've decided to go with separate logging and control systems using parallel connections to the sensors. Hence the PCBs that I am making. They will also permit some backup sensors via Dallas 1-wire.
It is simpler if you don't try to a) measure, supervise, and control and b) log with the same MCU/CPU. And there are some tricks to maintaining integrity and usefulness of the data base of logged values.
For example, if one connects the output of the power-to-frequency sensor used to monitor AC line loads I show here:
to a Dallas 1-wire 32-bit counter (2^32), you can read whenever you want to get instantaneous value of power because the output is about 1000hz (counts/sec) full-scale. But the 32-bit capacity also lets you go a month without reading the data without losing the total for the month.. If you were measuring voltage, and you read only once a month, you'd have next to no data. And when (not if ;-) you lose some of the data, you have to figure out how to guess ('bridge') what it was in order to estimate monthly total. And so on.
So some forethought in how you will deal with the data in the PC ahead of time will save you problems later that may be insurmountable.
Then perhaps HomeSeer should rename itself "HomeStake" ? -- and risk the deprecative "HomeMistake'? ;-)
The HSM100 Z-Wave Multi-Sensor is a $99 battery-operated occupancy + temperature + light level sensor that supposedly begins shipping this week (never-ending battery replacement not included ...).
HA may be a hobby for me, but decades of trying to keep battery-operated scientific environmental instrumentation working reliably in the field with batteries has caused me to develop an aversion to battery operation and replacement. Even with checklists, schedules, good field technicians and the best of intentions, IME they are/were the single most frequent cause of instrument failure. YMMV.
Power supplies matter a lot IMO. And so Dallas / Maxim "1-wire" is best implemented as a 4-wire system when used on long leads. One twisted pair is used for Vcc and power ground and a second twisted pair for 1-wire signal and signal ground. The 1-wire signal ground can be shared as the ground conductor for analog DC signals. So 4-pair CAT5 can provide power w/ ground, reliable
1-wire communication and four un-multiplexed analog signals with a low-offset voltage signal return ground. Leastwise that's my design.
Have you thought of any way someone can datalog power consumption of each branch breaker at a home's breaker box? IOW it would be interesting to see what the branch circuits are drawing one by one. I suppose a small coil could be slipped over each wire that enters a breaker in the main panel, and the leads all taken into the data logger to measure the amperage of each branch circuit over time? I dont know what electrical code would allow inside a breaker box? Or maybe the sensing coils can be sticky taped to each breaker on the outside under the access door, and cabled to a data buss installable by the user?
(sorry to hijack the thread but datalogging of both temperature and power usage would seem to me be popular these days with living green trends and all)
Excitement around this aspect of HA co-varies with energy prices ;-)
I've explored 4-5 different approaches to power measurement and monitoring and am circling around one in particular that fits well with the other monitoring and control functions I have developed.
The first approach was the commercial granddaddy, namely the "Cutler-Hammer Advanced Power Center panel" the others are DIY. See:
" SAVOY AUTOMATION AND CUTLER-HAMMER POISED TO REVOLUTIONIZE ENERGY MANAGEMENT. Savoy and Cutler-Hammer Team Up to Provide Innovative Intelligent Load Center ..."
the company that developed the CyberHouse HA software that I used for years, engaged in extensive real-world trials of residential and commercial energy management during ~1999-2001.
Hardware was provided by Cutler-Hammer Advanced Power Center. See:
It was/is a subpanel that met UL requirements and could accurately measure and control 120 and 240 VAC loads and communicate with home automation software over a variety of protocols including, depending on configuration, INCOM, Cebus, RS-232 and X-10.
I have a hardly used (it was a demo) Advanced Power Center panel with nine sensors, nine controllable breakers and controller with INCOM and Cebus interface and RS-232-->INCOM converters that I have put up for sale in my personal Photo-HA-Electronics Porch Sale. Cutler Hammer/Eaton has some free software available to download. (I have no experience with it.)
I'll post more on methods 2-4 time permitting. Two are extensions of the method presented with a very dated explanation on my web site here:
but use AVR MCUs instead of proprietary single-purpose IC's.
Later ... Marc Marc_F_Hult
Visit my personal Porch Sale of used-but-useful Home Automation and Electronics gear at
fabs. Our EOL strategy for this device is to build a supply of product
Presumably YES for the older, more buggy versions and NO for the newer ones. They or their functional successors will presumably migrate to the larger wafer.
I note that supplies of the 1-wire potentiometers have dried up completely even in the secondary/tertiary supply chain.
I note too based on an article in the most recent hardcopy of the Maxim Engineering Journal that the "1-wire" system has grown to 5 wires by the addition of EN and DONE pins to complement the existing Data, Vcc and GND pins.
These two new pins are used to "Regain Location Information by Leveraging the
1-wire Chain Function" which is "A Simple Signaling and Protocol Method [that] Determines Device Physical Location".
Of course it doesn't do that either ;-) but it does establish the order of the devices on the string. Folks with experience with one-wire devices may have experienced the problem of not knowing which devices are where once they've been installed.
This helps, but now most of the conductors (five) in a common (eight-wire) CAT-5 cable are used rather than just "1-wire". That's three more wires than are needed by plain ol RS-485 half-duplex with remote power and one more than RS-485 with buss-supplied power.
Would your circuit/concept require the homeowner to physically connect each branch circuit (breaker) sensor directly to the powerline?
I was thinking more in terms of sensing coils classed by wire gauge (10, 14, 12 etc) and type (solid stranded) and power range (rating of breaker), that the user would simply "clamp" around each wire after identifying the gauge, type of wire and breaker amps. Sort of like a little clamping ampmeters hooked to each branch circuit, each coil would have either a hardwire or RF link back to the microcontroller unit that times the samples and accumulates/sends a data package back to the software. I've seen the C/H panels installed here at work, pretty impressive. But I was thinking more in terms of a system that a homeowner can install without violating electrical codes. The microcontroller would calculate out any irregularities in the induced current curve of the sensing coil, and provide a linear measurement of amperage for logging.
Marc_F_Hult wrote in news: firstname.lastname@example.org:
Unfortunately, there is only one such device available. It reports temperature and has two I/O pins. However, the I/O pins share with the string order function. Use them for string order, and you lose them for I/O, leaving you with just a temperature sensor.
[To be fair, you can share the I/O pins for both string order and I/O as long as you don't care what the I/O does during string order finding. I think that this eliminates these parts for most applications, including mine. I want string order and I/O, and temperature is just a nice bonus. I know how to do this trick with I2C parts but it takes more wires.]
Yes. That's what I'm working on but it will take a few words for me to begin to explain my trajectory and rationale. Bear with me ...
It seems to me that the Cutler Hammer panels might be most useful, say, where decisions need to be made as to which circuits to power from a standby genset during a power outage, with the transfer switch providing power to CH panel and not the main entrance panel. Available power might be allocated to different circuits to stay with in the genset output capabilities.
But the CH panel limitation of only eight branch sensors (+ one main) immediately raises the question of _which_ eight circuits to monitor. We'd like to monitor all in the house. Hence a less expensive way is desirable that doesn't need to provide the largely superfluous (for most situations) ability to power the circuit on and off as the CH also provides.
In my house, I have been installing hard-wired lighting with circuits going to two centralized locations (basement and the second floor). Adding up the lighting circuits and the individual branches, and power to three separate load centers (basement shop, kitchen and 2nd/3rd floor), there are/will be in excess of 120 or candidates for monitoring. So the approach(es) has/ve to 'moderately' priced.
The accurate way to measure power (watts) is to independently measure current (I) and voltage (V) simultaneously and in real time multiply the result (V*I) many times during each half-cycle (eg several thousand times per second) and average the value over one or more 50 or 60hz cycles.
This is what the circuit based on the SAMES sa2002x IC that I describe here
\\power_measurement.htm do. I have a dozen of these ICs but could accomplish the same thing with some programming effort with (eg) AVR MCUs.
One can readily measure the current (I) in a wire by using a current transformer. Here's a picture of seven different ones with a US Quarter Dollar for scale that illustrates several basic types. The frequency response for all except the one on the bottom right includes the fundamental of the frequency range of interest (50-60hz).
The large one on the left is a "split core" rated at 400 amps. I have two of these in the entrance panel, one for each phase. The fact that these are "split core" meant that I could install them without pulling the meter or otherwise disconnecting power to the house in order to pass the conductors through the whole in the transformer. It has an internal "load" resistor that is calibrated so that 400 amps (full scale output) is 0.33 VAC. The device is RU/UL-listed. But whether it would pass inspection would depend on the discretion of the Authority Having Jurisdiction (aka AHJ; aka The Inspector) of the US National Electrical Code (NEC) in one's particular jurisdiction.
The donut-shaped (toroidal) transformer to its right is also RU/UL-listed and rated at maximum of 100 amps with a 300:1 current ratio, meaning that with a
20 amp load, the output is 20/300 = 67 milliamps. With a "load" resistor (a resistor across the output leads) of 100 ohms, the output voltage is 6.7 VAC I have about 15 of these. I plan to use these at the branch circuits. AC compressors and ovens. Note that they waste 1/300th of the power consumed by the circuit.
The smaller blue rectangle is a current transformer that uses a Hall-Effect sensor. It has better efficiency (1:2000), accuracy and linearity than the simple toroidal transformers but requires +/- 15vdc supply to operate. I have about 30 of these.
What one needs to do with the AC current signal to make it useful depends both on the load and the use.
If the waveforms were pure sine waves, and the loads purely resistive so that current and voltage were in phase, we could multiply the Root-Mean-Squared (RMS) 'average current measured in this way by a measured average (RMS) voltage, and compute the RMS power in watts at each transformer. Alas, the waveform is not perfect and current and voltage are out of phase for inductive and(or) capacitive loads, so this calculation is but an approximation in many cases.
But for some loads and uses, this approach is plenty good enough. For example, the power used by an electric oven can be accurately assessed by converting the voltage from a current transformer or shunt into a DC signal using a single OP amp configured with diodes as an active rectifier because the load is resistive and rectified peak voltage is proportional to current. Even if one assumed 110VAC instead of measuring actual voltage at the load, the calculated wattage would typically be within 10% or so depending on voltage sag. Plenty good enough to remind one to turn off an unused oven, IMO.
Another way to measure current is by measuring the voltage drop across a shunt resistor ( a small-valued resistor). This approach has at least two distinct disadvantages: lack of intrinsic galvanic (electrical) isolation and the fact that the conductor must be 'cut' so that the resistance inserted. But high wattage resistors of appropriate value are less expensive and easier to come by than appropriate current transformers. I recently bought 230+ 25 watt, 0.23 ohm resistors (a convenient value for a 20 amp circuit) for ~twenty cents each on eBay from Don Lancaster
. (Many electronic DIYers will recognize that name from Lancaster's innumerable books and articles over the decades.) They also provide the right location to measure voltage which is also needed for the V*I calculation.
My plan is to use the resistors where I am currently using solid state relays for control because the conductor is already 'cut' for insertion of the relay and there are convenient places to mount and heat-sink these aluminum-cased, screw-mount resistors. My AHJ-approved solid state relay dimmer panel is here:
The resistors will go in the top part near the solid-state relays; the auxiliary circuits will be in the low-voltage compartment at the bottom.
Gotta go. More later as time permits ... Marc Marc_F_Hult
shows a conventional Fluke True RMS clamp meter and various current-clamp heads other attachments obtained on eBay. When equipment changes, these accessories tend to get stranded and sometimes get dumped for pennies on the dollar.
shows the pcb and close up of the Analog Devices AD736 RMS-to_DC converter IC of one of a batch of new, unused LEM instruments THDA-1 AC millivolt to True RMS converters for I purchased on ebay for a few dollars each.
Combined with one of the current transformers I posted previously at
one can provide a DC signal suitable for conventional data loggers and HA controllers. Typically a simple op amp configured to adjust the gain to the span of the ADC on the measuring device is also helpful/needed.
Of course one could build these devices from scratch, but the price of the AD736 converter IC alone ($7.50 from
Well, the first word of this sentence is also "history" , but you read it ;-)
No doubt there will continue to be 1-wire products and I didn't mean to imply otherwise. What I meant to convey was that one should not assume that all the
1-wire products would continue to be available because some, including at least one that Maxim continues to promote through its application notes, is no longer available even on the secondary market and the Applications Engineer for 1-wire offered no hope for a replacement.
The conventional crystal ball typically has tantalizing images of nano-power devices using RF communication meshes that are inexpensive and widely available. Some will harvest / scavenge energy for operation from vibrations and light temperature differentials and so will be mostly independent of external power. See for example,
And systems that became 'history' a long time ago will continue to be useful. I recently purchased a new Comtrol Ethernet to 32-port serial converter on eBay for ~$5/port in which each of the 32 ports is independently configurable with software to be RS-232, RS-422, or RS-485. These 'legacy' last-leg hardware links make 'legacy' RS-xxx devices in my home accessible from anywhere in the world where an Internet connection is available. It uses RJ45 connectors so in combination with Power Over Cat5, and the extensive CAT5 wiring in my house, I can control RS-xxx devices in different place in the house as easily as plugging into a CAT5 jack. I do need to remember not to plug them into an ethernet router ;-)
One might note that the new INSTEON 2412S 'modem' is available only in a RS-232/TTL version and not USB. IMO, and apparently that of SmartLabs, RS-232 is more flexible for this role than USB (see paragraph above).
I understand your comments but I have learned the hard way that when "last call" is made in regards to components, one needs to recognize that any new design using the obselete part is limited and you do it at your own risk.
I am really bummed to learn that they are obseleting this part...there is nothing to replace it as far as I know.