View Single Post
Old 11-17-14, 07:15 PM   #278
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,428
Thanks: 431
Thanked 619 Times in 517 Posts
Send a message via Yahoo to jeff5may
Default

The problem I am having is dealing with the situations a fellow ecorenovator brought up:

How will the unit know what sensor is what? Initially, sensors will need to be assigned. How painless can this process be? Maybe the unit can run a "test mode" and find its own sensors. But what happens if a sensor or three goes bad in a few years? How will the plumber hook them back up when the (mystery part) is replaced? Will the unit glitch or hang? What if we want to swap the controller quickly between separate devices? Then what?

Finding sensor addresses and data values is not the problem. Recording, logging, manipulating, spitting out, etc. data is not the problem. Making something that runs reliably and is easy to program is the problem.

I believe for the critical sensors (defrost, ambient) I will use 10k thermistors in the first real version. There are 3 more analog pins left open, so that should be enough for the old-school type of hookup. If they were multiplexed, you could hook up over a dozen sensors with 4 pins. That's gotta be enough sensors.

The rough alpha version I put up on github will read all the sensors on pin D13 and throw them into an index. With that version, I played around with dallas sensors and as long as they were connected correctly, it read them all.

I goofed around with the serial monitor, and they assign to the same place in the index every time the unit is reset. The problem with the index approach lies in the way the onewire or dallas libraries interpret and assign the sensors. They work in reverse polish mode, reading and sorting the sensors least significant bit first. So you can't easily predict by address where each sensor will end up in the index, instead, major bit-banging and translating would be necessary to figure this out.

I believe the controller will need to use the EEPROM to store addresses and assignments so it will know what to do when it is reset and restarted. I have found some resources where people have done one thing or the other, but putting all these pieces together will be a challenge.

Multiple (dynamic #) DallasTemperature sensors

DS1822: How does the program assign the sensor's index?

Please help, I am not a software engineer by trade. I got my fill of pascal and c in college a long time ago. I can make this work eventually, but a veteran code warrior could snap this stuff together in five minutes.
jeff5may is offline   Reply With Quote