> Here, let me outline two possibilities for a system: > > I'm going to assume 12 temp sensors, 12 controlled devices for this > example, you can scale that to what ever you want. > > 1) > Output: > 12 I/O lines from the PIC go to NPN transistors, which drive relays > for the fans and pumps, unless the current requirement is under > 100mA, in chich case, the transistor itself drives the devices. > Software PWM is used to control the voltages on the fans and pumps. 100mA for a fan or pump is a bit optimistic i think :D Would the NPN transistors also work for AC pumps? (don't think so) Hmm, maybe i should check if the pumps i plan to use are AC or DC... > Input: > All 8 A/D lines are used for reading 8 current based temp sensors. > The PIC takes its analog input between the temp sensor and a 10K > resistor. This takes only 1 PIC pin per sensor. > I2C is used to interface to a 4 channel A/D converter for the > remaining 4 temp sensors > > 2) > Output: > Several I2C DACs are used to interface to small power transistors, > which feed the required current to the fans and pumps at 0.7V less > than the DAC output. > Input: > SMBus temperature sensors are fed through an I2C hub to allow for > more than 8 of them, and to convert the SMBus voltage levels to I2C > levels. Each temperature sensor requires a connection to +5V, 0V, > SCL, and SDA. Several PIC control pins are used to change the > selected channel, thereby preventing bus contention. > > Conclusions: > Mix this up as much as you want. Remember that with I2C, you have to > be careful about bus capacitance. You may need to use special I2C > trancievers to handle any long runs. I don't think there are going to be any really long runs... the distances will be pretty short (haven't really measured yet) :) > My recommendation? Use the input from 1) and the output from 2) > Here's what I'd do: Use some kind of analogue output temperature > sensor, and connect it however you were going to, then read those > ouputs with I2C A/D converters. From those outputs, calculate what > you need to, then run the outputs to I2C D/A converters, which run > their ouptuts into power transistors. Connect the power transistors > thusly: Base to DAC collector to 15V(12V maybe), emitter to > fan/pump. Hmm, yea, that looks like the easiest... And with multichannel A/D and D/A chips this should be pretty easy & clean. And if I would use thermistors, then I could keep the I2C bus pretty short to avoid problems (although longer wires to the thermistors will give a worse accuracy afaik). > And you still have all your PIC inputs left except for the 2 for the > I2C interface. With that, you can use a small PIC, just as long as > it supports I2C. Though, you *could* use software based I2C on a > smaller PIC, but it's a bit trickier. But you said you were thinking > of an 18F PIC, I think, and I think that most of them support I2C. Yea, I basicly wanted to save a few pins so that I have some spare ones for some buttons/a keypad and a LCD... Now I still have to find a nice, small, 18F PIC (28 pin DIP or something like that was what I originaly wanted to use...) > Another protocol to consider is SPI. Hmm, i don't really know that much about I2C (just the basic theory, haven't actualy used it yet), but i know even less about SPI, IIRC it's a 3 wire interface... Going to think it over one more time, select the components to use, find me a decent PIC programmer (which i can use from linux... Wouter's programmer looks nice, maybe I should ask him if i'm allowed to port his software to linux) and lets get busy! Be sure to expect me back with some more questions/problems soon :) Thanks, you (and others on this list of course) have been very helpful :) -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.