Solar water heater controller, heliostat tracker controller, and data logger.
Project5k
Posts: 58
Ok, i know this is a long list of things to get done, but here’s the basic story, I'm building a tracking solar water heater, and i need to build the controller.
·
The requirements of the system are as follows:
read the output temperature of each of 2 collectors
control a solenoid valve to divert fluid to one or the other of the collectors
control a second solenoid valve to divert fluid to 1 of 2 holding tanks
read the temperature of each of the 2 tanks
read the temperature of the input and output of each heat exchanger(1 per tank)
control 3 pumps, 1 on the collector loop, and 1 on each tank
measure where the sun is in the sky relative to the collector(ie left, center, right)
drive a linear actuator to move the collector array to follow the sun.
display the temperatures of the sensors(perhaps just 1 at a time with a pushbutton to roll through all the selections, or maybe 2 displays that each change to another reading with a pushbutton)
create and store a data log with time stamps and all of the data, that can be opened and graphed in excel.
·
so by my count, i need to read 8 temperatures
operate 2 valves, (these should be simple power on/off)
control 3 pumps(on or off)
read·2 photo resistors(will be measured to tell if the collector is aimed at the sun)
·
a few other details.. the u-controller can be anywhere, preferably in the house.· the photo resistors, some of the temp sensors, the 2 solenoids, and linear actuator will all be around 100 feet from the house.
·
The displays will be with the controller, along with any supporting electronics (relays, power supplies, and so on)
·
What i need to know is how to do it.· and which chip i should go with.·
·
Can i use all 1 wire temp sensors? can they all be on one pin of the stamp? if so then that’s 1 I/O line,· the 2 valves each use a line, so thats 3 so far, 1 each for the pumps, 6, the linear actuator can be controlled in both directions with 2 relays, 8, 2 photo resistors, 10.
·
now, do i add to my I/O pin count for the display(s)? if so how many for each?
·
As of right now, I’m thinking that the bs2p24 is looking like its gonna do everything.· Am I thinking correctly?
I also know I need the temp sensors, and the data logger to usb thing, I would really like to have it dump the data file to a usb thumb drive.
·
The data logging is one of the biggest mysteries to me, but I’m sure I’ll learn.
·
Also, what do I do about timing?· What I mean is as far as getting the time stamp on the measurements.· This is very important.· I would like to be able to set the interval for taking the measurements, and for the data logging.
·
Also, at night, the unit will need to go to a “park” position, basically all the way to the east, so its ready for the following morning. so i'm thinking that this might require one more input, a "park" sensor switch
·
I would also like to consider somewhere in my programming to have it set up so that if the temperatures go too high, that it will un-aim the collector off the sun.· What I was thinking was to have each of the photo resistors output a value, some numeric representation of their output, and then for every degree that the system is over temp, it could add to that numeric representation, and then move to equalize the numbers.
·
IF the whole cycle, taking measurements, updating position, updating pump outputs, and data logging, took say 30 seconds, that should be way fast enough, faster of course would be fine, but I don’t think I would want it to take any more than a minute.
·
As of right now the system is fairly smaller than all of this, but this is the ultimate goal, so, I would like to start out and then be able to add parts, and update the programming as the system grows..
·
So… what’s everyone’s input?· Particular part #’s I should look at?· Places to get parts cheap?(I have lots of descrete parts, resistors, relays and things like that)
·
·
The requirements of the system are as follows:
read the output temperature of each of 2 collectors
control a solenoid valve to divert fluid to one or the other of the collectors
control a second solenoid valve to divert fluid to 1 of 2 holding tanks
read the temperature of each of the 2 tanks
read the temperature of the input and output of each heat exchanger(1 per tank)
control 3 pumps, 1 on the collector loop, and 1 on each tank
measure where the sun is in the sky relative to the collector(ie left, center, right)
drive a linear actuator to move the collector array to follow the sun.
display the temperatures of the sensors(perhaps just 1 at a time with a pushbutton to roll through all the selections, or maybe 2 displays that each change to another reading with a pushbutton)
create and store a data log with time stamps and all of the data, that can be opened and graphed in excel.
·
so by my count, i need to read 8 temperatures
operate 2 valves, (these should be simple power on/off)
control 3 pumps(on or off)
read·2 photo resistors(will be measured to tell if the collector is aimed at the sun)
·
a few other details.. the u-controller can be anywhere, preferably in the house.· the photo resistors, some of the temp sensors, the 2 solenoids, and linear actuator will all be around 100 feet from the house.
·
The displays will be with the controller, along with any supporting electronics (relays, power supplies, and so on)
·
What i need to know is how to do it.· and which chip i should go with.·
·
Can i use all 1 wire temp sensors? can they all be on one pin of the stamp? if so then that’s 1 I/O line,· the 2 valves each use a line, so thats 3 so far, 1 each for the pumps, 6, the linear actuator can be controlled in both directions with 2 relays, 8, 2 photo resistors, 10.
·
now, do i add to my I/O pin count for the display(s)? if so how many for each?
·
As of right now, I’m thinking that the bs2p24 is looking like its gonna do everything.· Am I thinking correctly?
I also know I need the temp sensors, and the data logger to usb thing, I would really like to have it dump the data file to a usb thumb drive.
·
The data logging is one of the biggest mysteries to me, but I’m sure I’ll learn.
·
Also, what do I do about timing?· What I mean is as far as getting the time stamp on the measurements.· This is very important.· I would like to be able to set the interval for taking the measurements, and for the data logging.
·
Also, at night, the unit will need to go to a “park” position, basically all the way to the east, so its ready for the following morning. so i'm thinking that this might require one more input, a "park" sensor switch
·
I would also like to consider somewhere in my programming to have it set up so that if the temperatures go too high, that it will un-aim the collector off the sun.· What I was thinking was to have each of the photo resistors output a value, some numeric representation of their output, and then for every degree that the system is over temp, it could add to that numeric representation, and then move to equalize the numbers.
·
IF the whole cycle, taking measurements, updating position, updating pump outputs, and data logging, took say 30 seconds, that should be way fast enough, faster of course would be fine, but I don’t think I would want it to take any more than a minute.
·
As of right now the system is fairly smaller than all of this, but this is the ultimate goal, so, I would like to start out and then be able to add parts, and update the programming as the system grows..
·
So… what’s everyone’s input?· Particular part #’s I should look at?· Places to get parts cheap?(I have lots of descrete parts, resistors, relays and things like that)
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
(1) Parking the sun-tracker at night. You don't need separate photocells to detect nighttime. Simply detect the light levels on the two you need for tracking. If it's dark out according to these, park pointing east.
(2) Sun-tracker. You really don't need a computer for this, although you could use one, perhaps for the fun of it. Point one sensor left of center (perhaps 30 degrees), the other right of center. If they differ by more than some set amount (determined by experiment, probably not worth moving when the difference indicates an aiming error less than ten degrees or so) -- if they differ by more than a set amount, crank the thing towards the brighter one until they're more equal (within that set amount). Close enough is close enough, for you don't want the thing constantly hunting. Compare the two to see which way to steer. Subtract the two and take the absolute value of the difference to see whether you need to do any steering. Look at either one to see whether it's dark out and time to park. I'd call the parking position "Lovers' Lane", but that's just me.
(3) If you add enough electronics, you can use the generated heat to heat the water when the sun's not out. An aluminum radiator from a Corvette, placed in a chimney over the electronics, will work well for this without poisoning the water. [noparse][[/noparse]Joke].
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
i had considered using sepperated units, but in the long run i thought it'd be cheaper to use the one.
I do remember some basic, and thats what this stuff looks like to me, so that shouldnt be too hard to make a run at, but i will definately take a look at the propeller...
Carl -
1, understood, and was already part of the plan.
2, i would prefer to use computing power to do this, for a couple reasons, 1 data tracking, i can use the readings from the sensors, and if i'm understanding what your telling me, this thing will drag along on the following sensor, almost like hunting, cause you'll only move enough to satisfy your "happy range" and then stop moving, my thought would be to have it move from behind the sun to infront of it the distance that corrisponds with your happy range, does that make sence? Lover's lane, funny...
3, you'd have to really wash out the radiator well, if its in the potable loop, ethaline glycol... hehehe
ok, heres the list of parts i've had time to put together thus far...
1 LCD 27979 (i can easily get 4 to 8 sensor readings on this display)
1 stamp either bs2p24 or bs2px, (need to research the propeller)
8 lm34 temp sensors(already calibrated for F) this does increase the # of I/O lines i need.(i can start with 4 and mux them later if i run outta lines)
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
One other consideration, once you have an accurate clock on the system, you can use a data table to determine the position of the sun and use that to aim the collectors (keeps it from potentially chasing a cloud).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
zone valves, ok, on the list to look at. good point on using power vs not using...
do i really need an adc, i thought that the stamp and or propeller could do that intermally
real time clock, ok, do i need a RTC with the propeller chip?
predictive aiming is something that i had considered.. but that would require some pretty complex math to work year round.. thats kinda why i was looking at active sensor traking.
now, i saw something that would work for data logging on the stamps, but i need to go find it again and see if it will work with the propeller...
looks like the display i had picked out will still work with the prop
if i did go with sepperated controllers, say one for tracking, and then the main brain, how would they communicate, or would they need to? well, yes, they do need to communicate, i want the data from the tracking sensors... how does that work with something like 100' of cable between them?
I'm not cheaper, i'm not better, i'm just have less money to spend.
part # how many price each total
propeller chip P8X32A-D40 1 12.99 12.99
Memory Stick Datalogger 27937 1 $34.99 34.99
32KB I²C EEPROM 602-00032 1 1.99 1.99
3.3V Regulator 601-00513 1 1.99 1.99
Parallax 4x20 Serial LCD (Backlit) 27979 0 39.99 0 out of stock
Parallax 2x16 Serial LCD (Backlit) 27977 1 29.99 29.99
LM34 Temperature Sensor 604-00011 8 3.99 31.92
Photoresistor - VT935G-B 350-00009 4 1.99 7.96
DS1302 Timekeeping Chip 604-00005 1 4.98 4.98
Parallax USB to Serial (RS-232) Adapter 28030 1 14.99 14.99
Total 141.8
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
I'd also get a precision 2.5V reference voltage regulator to use with the ADC, like the LM336. This will improve stability and increase resolution. Make sure to get an ADC with a VREF pin. As I said before, I think the TLC2543 is a good choice. There is sample code both in PBASIC and Spin.
The Prop can do a reasonable RTC. I was just looking at a thread talking about losing 18 minutes a year without correction. Prolly just fine for a solar system, especially if you have to change for DST twice a year anyway. You could fine tune it to less with a software correction.
You don't *need* a Prop for this project. I'd use one for sure, I love 'em. You will have to learn Spin and wrap your head around multicores, but even I manage to kludge stuff together, so I am sure you can too. [noparse]:)[/noparse] And yes, the Spin editor is free.
If you do go Prop, look at the proto board. Has regulators, eeprom and so on already built in. It's a good deal, I often use them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
I'm leaning towards the propeller due to its price by comparison to the stamps. do you see a realistic reason where a stamp would actually perform my tasks better than a propeller? I dont know enough yet to even head down this path, but i was thinking that i could use one cog to handle data logging duties, one to handle tracking, one to handle temp measurements, one to run the display, and so on, deviding up the duties between the cogs, seems logical to me, and spreading the load out should help things run more smoothly and faster. But like i said, i dont even know if i can do it that way, or if maybe its better not to devide it up like that.
ADC, ok you convinced me, better accuracy, and tenths are good things, i'll add it to the list, along with the vref regulator.
if i loose 18 hours over the course of a year it wouldnt be that big of a deal, cause i'm gonna be messn with this thing resetting it, rewriting code and everything else. My question is, how does it loos time if your using an external rtc that has better accuracy than that?
I'll take a look at the proto board, is there only one, or is there a particular one that you suggest?
for now, i'm looking at 4 temp sensors, but i can see that # growing to 8 as this project grows...
I just looked up from posting above, and I saw that my solar hot tub controller was reading a way off temp. I investigated and found it was the VERY SAME LM336 vref I mentioned above had a poor solder joint. It had been working fine for 6 months. How weird is that?
There is nothing a Prop can't do that a Stamp can. Basically, the Prop is more powerful but not as easy to use as the Stamp. What Chris said above is very true, a BS2p would do the job just fine. Since water heating systems heat slowly in terms of a uC, you have oodles of time to do what needs to be done, so the slower speed of the Stamp isn't really an issue. What I like about the prop is how easy it makes splitting up tasks. My controller is reading data from the sensors, getting the time via RF from my locally broadcast atomic time, logging data and driving an LCD display and a Nixie tube display. The prop makes it easy beans to intergrate all these functions. There were some times of pulling out hair getting it working, but I am a poor programmer. I'd say if you are comfy with programming consider the prop, but if the idea makes you feel worried, go with the Stamp. You can't really go wrong.
The Stamps memory is in slots of 2k. Look up the RUN command. While there are some limitations in multi-slot programming, you can still get done anything you would need to get done.
And its 18 *minutes* a year, not hours. And there is only one protoboard that I know of.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
I apologize for throwing confusion into your choices. I got the impression you had selected the BASIC Stamp initially and I was basically supporting that it would work. The Propeller is of course more powerful and certainly less expensive. Since you mentioned the BASIC Stamp first I thought you chose a microcontroller you were familiar with. While the Propeller is relatively easy to learn, I wasn’t sure if you wanted to start with a new language.
Sometimes the inclination is to recommend the Propeller for everything…but if you’re trying to read a button, blink an LED and tell the time, the BASIC Stamps are perfectly capable. Multiple program slots on the BASIC Stamp 2p allow you to store multiple programs which could handle different aspects of your project. You can also store data there for logging or user-defined program routines.
P.S. - If this project is going to be Propeller related I will move it to the Propeller forum once you confirm.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
ok, so your pulling the broadcast atomic time? like my alarm clock does? oh baby, i gotta do that. If for no other reason than thats WAY COOL! You gotta give me the details on how you did that. Not to mention that i dont have to worrie about the local time getting off... oh and did i mention how cool that is!
Chris, I had originally thought about going with the stamp, only cause its basic, and its what i know, or well, knew, its been so long since i've looked at any language, i'm basically starting from scratch anyway, so if the propeller will do what i wanna do, and i can do it cheaper, then learning the language will just be part of the fun of learning and building the system. Besides, i can allways get on here and ask questions if i get stumped. I say move it, i think i'm sold on the prop.
Furthermore, it really sounds like the propeller is the way to go on another project i've been wanting to work on.. a dyno cell for my rc boat engines.. I originally thought about just using a off the shelf data logger, but with the propeller, i can have it do displays, log the data, and all sorts of stuff... and its cheaper, i'll already know how to program for it(by then i hope)
so in looking at the proto boards, i found one that has the usb already built in.· My question is this... can that be used for data logging in any way? or is that strictly for programming the prop, and then thats about it?· (wondering if i can save some more $$ using that rather than having to get the usb data logger for 30 something bucks..
Post Edited (Project5k) : 1/22/2009 9:19:57 PM GMT
Cheers
Mike2545
You can log data to a PC using the programming cable, no extra parts. You can use a terminal program for a dumb type data dump into a .txt file, or write a PC program to do whatever you want with the data.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
i guess i could just use one of the many low end pc's i have laying around to act as the data logger.. It would save me some $$ for now, and then later on as i get better at all of this, start working on a better solution. all i need out of the data logging is for it to come out with good time stamps and be in some format that will let me open it in excell to graph it. other than that, for now i'm not gonna be too picky on how i get it done.
http://www.parallax.com/Portals/0/Downloads/sw/plx_daq_install.zip
It allows the stamp to write data directly into an Excel spreadsheet. The only limitation is that you can only move 65535 observations before you need to start a new spreadsheet. I have used this with a Bluetooth connection (any rf based link that can emulate a serial port will work) to transmit weather data from a shelter directly into Excel.
There is also a command in the protocol that the stamp can request a time stamp from the host PC. The resolution of the time stamp is the nearest second and is based on the PC clock. So if you can keep the clock on the PC accurate, the time stamps will be accurate. The command from a Basic Stamp looks like:
SEROUT BT_TX,84,[noparse][[/noparse]"DATA,", "DATE,TIME,",DEC VoltSol DIG 3 .other data points...]
The DATE,TIME entries add the computer clock readings as the first two columns in the speadsheet.
Post Edited (MSDTech) : 1/23/2009 3:41:59 PM GMT
the 65535 lines are an excell limitation, right? i would want data points like every 2 seconds, so thats 43,200 data points per day. so then all i'd need to do is figure out how to make it start a new file, or a new sheet inside that workbook for each day.
Realistically, i think i would prefer a seperate comma delimited file for each day, and then just name the file the date. then that way i can manipulate the data any way i want to and i'm not limited to excell line counts. not to mention that i would have to have excell open the whole time, and i think that if i'm gonna skip using the usb stick data loger, that i would rather have it transmit to a computer on my network so that i can pull up the files as i need to, and not rely on excel to stay open all the time.
Chris - were you going to move this thread to the propeller section? I've started reading the propellor programming book, and started absorbing "SPIN".. i'm thinking seriously that i will place my order for at least the chip and board today so i can start playing and practicing my code, and then order more parts as i learn how to use the ones i have.
man shipping has gotten expensive.. anyway, it should all be here bout the middle of next week...
now. where do i DL the software so i can start learning that?
C:\Program Files\AtomTime Pro\Doc\index.html
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
www.577foundation.org/
Mike2545
Post Edited (Mike2545) : 1/25/2009 11:15:17 PM GMT
Mike, you have to tell me how your doing the live data feeds, thats something i've allways wanted to do.
Post Edited (Project5k) : 1/24/2009 1:41:42 PM GMT
that program is all done in Flash. It goes out and reads data files created by the devices, interprets the data and displays it in a nice easy to read format. The PV array is handled by a Sunny-Web box, which is networked on our system. The solar water heating, outdoor weather conditions and dome statistics are handled by some hardware made by Solar Wave. We use a wireless connection for part of the system and have had no problems. Of course the files are very small so speed is not a factor.
Mike2545
anyway, so i've been reading the propeller book, trying to absorb as much as i can, really trying to get SPIN. Its a faint candle at the end of a very long tunnel.
Does anyone have a good resource that i can take a look at to try and get as much of this stuff in my head between now and when the parts get here?
I figure i'll probably start out just following the examples, making lights blink, and then making mods to that working example code to see what the changes i make do...
Does anyone have a good system for when they are starting out writing code for something like this?
should i start with a blank page of paper and start laying out all of the "blocks" that will go into my code? at least that way i can start getting an idea of what order to do things in?
i'm open to ideas and suggestions on how best to try and tackle something like all of this...