

Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!
|
mattch1
Monseur

Registered: 05/16/03
Posts: 126
Loc: WV
Last seen: 7 years, 5 months
|
Re: Terrarium control system [Re: jorneyer]
#1588885 - 05/29/03 12:29 PM (8 years, 8 months ago) |
|
|
Ive also made a similar-automated system. I simplified mine alot by using Parallax BASIC Stamps. I can control 2 terrariums (all monitored and automated seperately) and it works perfectly. It only cost me about $100 to get all the parts and the programming was incredibly simple (for people not as versed in computers/programming). If anyone is looking in to making one of these, I would suggest using the BASIC stamps, they simplify the process greatly, with minimal cost.
-------------------- Everything I ask is for informational purposes only. There is no truth to what i say. I am lying.
|
Anno
Experimenter


 Registered: 06/17/99
Posts: 24,062
Loc: my room
Last seen: 1 day, 19 hours
|
Re: Terrarium control system [Re: mattch1]
#1589072 - 05/29/03 01:20 PM (8 years, 8 months ago) |
|
|
any links?
|
shroomologist
member
Registered: 09/29/02
Posts: 161
Loc: SouthEastern US
Last seen: 6 years, 4 months
|
Re: Terrarium control system [Re: Anno]
#1589977 - 05/29/03 04:37 PM (8 years, 8 months ago) |
|
|
|
poke smot!
cognitive consonance


 Registered: 01/08/03
Posts: 4,634
|
|
Nice. That's a good idea to toy around with for PC-less control.
The test run has many dynamics to it... Let me brief you: It's a large area, with circulation fans. A heater is in the bottom. The general theory is, the hot air rises to the top. This causes a larger capacity for moisture, thus lower RH. So, when it falls below 90%, the humidifier switches on.
Now, the way it's designed, a sort of buffer keeps the relays from switching too fast. The humidity must be 90% or above, for 15 seconds straight, before the "Else" will be triggered, which is typically the command to turn off the humidifier.
The heater works similarly. One difference, though, is that instead of the relay being a simple "on" switch, it is regulated to not heat up too much before the sensors register. When under 76 deg F, the heater will run a cycle of 12 seconds on and 48 seconds off. This will continue until the temp is right.
Also, the USHes in question have variable settings on them. On the small tent, the sensor responds quick enough that it wouldn't be a problem to set it on full blast. In a larger tent, a circulation fan loop tends to incorporate a T where the humidity is added. This way, the air leaving this PVC pipe is a mixture of ultrasonic, and surrounding air.
When humidity is added, it is from the air outside the tent which is usually colder. Only thing is, the larger tent has the luxury of a heater, while the smaller one lacks. Still, this colder humid air goes to the bottom, where it may go back to the top after being heated, or also by being circulated back to the top.
Ok, some logfiles. This shot is of a short period of about 1.5 hours. The vertical gray blips indicate a relay was switching. The clusters of blips usually indicate humidity refueling.
--------------------
Edited by poke smot! (05/29/03 08:57 PM)
|
shroomologist
member
Registered: 09/29/02
Posts: 161
Loc: SouthEastern US
Last seen: 6 years, 4 months
|
Re: Terrarium control system [Re: poke smot!]
#1592318 - 05/30/03 05:58 AM (8 years, 8 months ago) |
|
|
I think i'm going to mess around with the pic tonight and try some code.
basically: (AD1 is pot setpoint, and AD2 is sensor) start setpt = AD1
If AD2 less than setpt, turn on else, turn off
goto start
similar for humidifier
LCD subroutines are everywhere, serial subroutines are everywhere
so i could have a standalone unit, or a tethered unit easily
I scored some Graphic LCD's from work  *yoink* and some character (2*16) LCDs too!
I even *yoinked* an SBC to play with, not sure if it works tho.
what RH sensor works best for high humidity without saturating/failing in 100% RH?
|
poke smot!
cognitive consonance


 Registered: 01/08/03
Posts: 4,634
|
|
I like the HM1500. Just for fuck's sake, once in a while I pull out the sensor and put it in a sealed thing of damprid. This prevents residual saturation around the sensor, causing it to read higher than normal due to internal evaporation.
I recall seeing some awesome deals on LCD's at this supplier called MPJA - marlin p jones & assoc, or something like that. Great deals on every LCD size.
If you use a simple routine as above, you probably will run into troubles. Often times the temperature will hover over that threshhold, and due to quirks in resistor ladder A to D, each successive reading may be above/below that threshhold.
So, if you continually cycle reading the ADC and evaluating, your device might rapidly turn on and off when over that threshhold.
I find that the humidity sensors are even more prone to this problem. They will fluctuate somewhat, but when fluctuating above/below the threshhold, your humidifier will go crazy.
To solve this, you must devise either two threshholds (on and off), so you can say On at 74 degrees, Off at 76. Again though, if you have anything for a heater and you're heating any enclosure smaller than a whole room, you may find that by the time the temperature registers and the heater turns off, the temperature will keep going up.
Perhaps to solve this, you could have each device have an "On" program, with POTs to adjust the cycle time (for example, 1 minute), and the on time (for example, 15 seconds). Thus, while the temp is below the threshhold, the device will be turned on for 15 seconds every minute. The 45 seconds of "off" time allows the air to circulate, and the sensor to read more accurately.
Back to the other problem (rapid switching), if you didn't want a high and a low threshhold, just implement a buffer. Say, the condition must evaluate for 10 straight seconds to trigger.
Hope that helps.
--------------------
|
shroomologist
member
Registered: 09/29/02
Posts: 161
Loc: SouthEastern US
Last seen: 6 years, 4 months
|
Re: Terrarium control system [Re: poke smot!]
#1594519 - 05/30/03 06:10 PM (8 years, 8 months ago) |
|
|
oh, sorry
i already have A/D subroutines that "sample" over a given period (maybe 10 seconds, but can be adjusted) then averages them, and does something acording to THAT value.
Kinda like a switch debounce, but more delay. It worked pretty good with the IR distance sensors in the robot i built. They were really shaky especially at the speed we went, so you had to quickly sense and average and adjust.
I was just saying, thats the basic program. thats the big picture of what we really want to do.
the subroutines for calculating the actual input value include thresholds, like somewhat of a hysteresis curve. Its not hard to implement, i actually have all the code i need, i'm just too bitch lazy to do it
|
poke smot!
cognitive consonance


 Registered: 01/08/03
Posts: 4,634
|
|
I've recently built a compilation of classes in Visual Basic 6.0 that allow me to dynamically interface to a number of devices. This allows any set of devices or subsets of devices to be attached to the parallel port. This "interface" dll will take your pin assignments, and give you access to high-level functions for your device.
Instead of having all the background code in every app I make, I can use this DLL coupled with a small user class to make an interface object that allows instant access. This also allows me to separate my more complex code from the base interface code, so I can offer you this library for free.
To use the library, you will need to create a reference to it in visual basic (on the Project menu). You will also have to create an interface module for your device, to tell the DLL how the pins are hooked up.
Then, in your program in a module that is always loaded at run-time, you need to create the interface object. For example:
Module mdlMain Dim DCI as clsDCInterface
Sub Main() Set DCI = New clsDCInterface End sub
The purpose of the DC object is to have simple high-level commands. In your DC class you find two functions:
Public Function GetAnalogValue(vMux As Integer) As Integer Public Sub SetRelay(vRelay As Integer, vState As Boolean)
This means, that from within your program all you need to do is say byte = DCI.GetAnalogValue(0)
to grab the byte (0 to 255) value at sensor 0. And, just type DCI.SetRelay 0, True
to turn on the relay attached to pin 2.
Fairly simple! If you peek inside those two subroutines, you will see the surface of the underneath interface code: Code:
Public Function GetAnalogValue(vMux As Integer) As Integer 'return byte value ADC.CalcAnalogReading vMux Dim n As Integer, nn As Integer n = ADCReadIn.sGetByte GetAnalogValue = n End Function
Public Sub SetRelay(vRelay As Integer, vState As Boolean) Dim v As Integer If vState Then v = 1 Else v = 0 If GetSetting(App.Title, "general", "userck0", "0") = 1 Then v = 1 - v Dim b As Integer b = LPT1.pdata.psbyte If vRelay < 0 Or vRelay > 5 Then LPT1.pdata.psbyte = b: Exit Sub b = b And (64 - 2 ^ vRelay) b = b + v * 2 ^ vRelay LPT1.pdata.psbyte = b End Sub
A number of objects are utilized here, which I'll comment on later. They are created in your interface class's initialization procedure. That's where you set up pinout configuration.
In the above code, note the Analog retrieval code referencing two main objects: ADC, and ADCReadIn. These are two classes to represent the Analog to Digital converter by national semiconductor, and the 74HC165 that it's outputs are attached to.
Since these two devices are bussed together, it's just a matter of telling the ADC handler to calculate a value on the chosen input, and then grab the byte that is sitting on the shift register's inputs.
In the setrelay routine, the data port's byte is retrieved and recalculated. By setting the byte (LPT1.pData.psByte = #), you change the states of the relay.
Now, lastly, is an overview of what the class initialization does: Code:
Private Sub Class_Initialize() Set LPT1 = New clsParallelPort 'create interface to pins Set ADCReadIn = New cls74HC165 'input ADC value Set ADC = New clsADC0817 'equivalent to 0808, just don't use AddD LPT1.BasePort = g_DestPort With ADC Set .pClock = LPT1.pControl.psPinVal(2) Set .sEOCSrc = LPT1.pStatus.psPinVal(3) 'read the eoc Set .pStart = LPT1.pControl.psPinVal(0) Set .pALE = LPT1.pdata.psPinVal(7) Set .pAddA = LPT1.pControl.psPinVal(1) 'address pins Set .pAddB = LPT1.pControl.psPinVal(2) Set .pAddC = LPT1.pControl.psPinVal(3) Set .pAddD = New clsPin 'need to set it to something, so set it to nothing! Set .pOE = New clsPin 'this is also fixed to high. End With With ADCReadIn Set .pClock = LPT1.pControl.psPinVal(2) 'also clock! Set .pShiftNLock = LPT1.pControl.psPinVal(1) 'shift/-load Set .sQHSrc = LPT1.pStatus.psPinVal(4) 'data source End With ADC.pClock.PinState = 1 ADC.pClock.PinState = 0 End Sub
This interface code is tailored for the schematic at the noted site, with the mentioned revisions. This seems to work well for some people.
Basically, here is the place where all of the objects are created. A parallel port class is created, and you give it a base port. In your class I called it LPT1, although ControlSys allows you to modify g_DestPort so this may vary.
The LPT1 object (of class clsParallelPort) has a property for it's base port, as well as three interfaces to the Data, Control, and Status pins. They can be referenced as any "pin set", ie you can set the whole byte or change just one pin.
The miracle of object-oriented programming, allows a single pin object on one of those ports to be assigned (or "Set") to a device requiring an output pin. So: Set ADC.pALE = LPT1.pdata.psPinVal(7)
essentially means that the analog to digital converter's Address Latch Enable pin is accessible via. the parallel port data pin 9 (bit 2^7 or 128). The analog to digital converter class doesn't have to worry about which pin is connected to what, it just does it's thing using the pins you give it.
An expansion breakthrough, accordingly, is the ability to add more shift registers. For my current device, I use two 74HC164's. Both, to my program, are just 8-bit output busses - All I need to do is tell the software which of the 164's logic pins are connected to which parallel port pins. Instantly, I have programmatic access to a digital value on the other end - a simple "Q" output pin being a variable. Instead of using parallel port pins for controlling my relays and sending commands to the ADC, I do this with those output busses.
Check out my initialization routine Like I said, the analog to digital converter's logic (input) pins are tied to outputs on one of the 74hc164's. My program is quickly and easily instructed to use these devices in that configuration, so you can piece together pieces logically not conforming to any sort of pinout or schematic.
Code:
Private Sub Class_Initialize() Set LPT1 = New clsParallelPort Set ADCOutputs = New cls74HC164 Set ADCReadIn = New cls74HC165 Set DeviceOutputs = New cls74HC164 Set ADC = New clsADC0817 With LPT1 .BasePort = &H378 Set ADCOutputs.pDS = .pData.psPinVal(1) 'data pin 1 Set ADCOutputs.pCP = .pData.psPinVal(2) 'data pin 2... Set ADCOutputs.pLT = .pData.psPinVal(3) Set DeviceOutputs.pCP = .pData.psPinVal(4) Set DeviceOutputs.pDS = .pData.psPinVal(5) Set DeviceOutputs.pLT = .pData.psPinVal(6) Set ADCReadIn.pClock = .pData.psPinVal(0) Set ADCReadIn.pShiftNLock = New clsPin Set ADC.pClock = .pData.psPinVal(2) Set ADC.sEOCSrc = .pStatus.psPinVal(3) Set ADCReadIn.sQHSrc = .pStatus.psPinVal(4) End With With ADC Set .pStart = ADCOutputs.pQBus.psPinVal(0) '74HC164 Q0 Set .pALE = ADCOutputs.pQBus.psPinVal(1) ' Q1 Set .pAddA = ADCOutputs.pQBus.psPinVal(2) Set .pAddB = ADCOutputs.pQBus.psPinVal(3) Set .pAddC = ADCOutputs.pQBus.psPinVal(4) Set .pAddD = ADCOutputs.pQBus.psPinVal(5) End With ADC.pClock.pinstate = 1 ADC.pClock.pinstate = 0 End Sub
PM me for more information.
I believe this is a very good addition because it allows me to design a library that some programmers can use, in order to interface to boxes similar to my design. Really, any arrangement of devices and pins would work - Theoretically, one could daisy-chain the 164's or have sub-164's, to add as many digital outputs as one would need. This also goes with digital inputs.
Through these expandable digital I/O pins, one can interface to analog to digital converters, digital to analog converters, relays, and whatever other devices may be needed. This library is just the puzzle piece that ties it all together, linking the various electronic hardwares to simple high-level commands.
--------------------
Edited by SheetRooms (08/31/07 10:06 AM)
|
YidakiMan
Stranger

Registered: 09/28/02
Posts: 2,023
|
Re: Terrarium control system [Re: poke smot!]
#1820773 - 08/16/03 05:21 PM (8 years, 5 months ago) |
|
|
*Bizump*
A lot of this has been way over my head, in fact most is. I would like to express my interest in a unit that can control humidity. I am fortunate enough that my climate allows my house to remain at the appropriate temperature without any regulation.
|
Mr_Mead
Overlord
Registered: 08/19/03
Posts: 1
Loc: Calgary, Canada
Last seen: 5 years, 7 months
|
Re: Terrarium control system [Re: poke smot!]
#1829623 - 08/19/03 11:23 AM (8 years, 5 months ago) |
|
|
Has anyone worked on web accessible control software, most likely written in Java or modPerl. Just curious cuz I've been thinking about remote control systems with logging capability, and it looks like most of the work has already been done. Also if anyone has snippets of open domain code or the like I'd really like to take a look at whats been done.
Mr. MEad
--------------------
-- Mead - Official drink of the 2005 Barbarian Games --
|
GoodOlBattonAss
Stranger

Registered: 03/31/03
Posts: 333
Last seen: 8 years, 25 days
|
Re: Terrarium control system [Re: Mr_Mead]
#1846843 - 08/24/03 09:03 PM (8 years, 5 months ago) |
|
|
Something everyone who is interested in terrarium controll should check out.

It is a new product from Green Air due to come out in two weeks. I contacted a hydro supplier and I have one on preorder. Can't wait.
--------------------
|
iorixxx
Stranger
Registered: 08/25/05
Posts: 5
Last seen: 5 years, 2 months
|
|
I am going to build a grow chamber. And i am going to use ultrasonic humidifier. I am going to use parallel port to use it as a timer. I am going to find the best timer intervals to keep humidity and the air exchange indide the chamber. I will use computer to learn these values. Then i may be get timers. Becasue it is troublesome to a compuer to be open 24 hours. (7/24)
|
Dragonaut
Hot Dog

Registered: 06/23/04
Posts: 5,368
Loc: Gun Show
|
Re: Terrarium control system [Re: iorixxx]
#4611270 - 09/02/05 12:12 AM (6 years, 5 months ago) |
|
|
good luck with that.
Hey, whatever happened with this thread/experiment anyways? Has anyone come up with more ways to automate a fruiting chamber via computer? It's kind of a neat idea, however I think G.A.P. has the market cornered as far as environmental control systems goes. You don't even need a computer to use their products, and they are professionally designed. The only downside...EXPENSIVE.
--------------------
See all my Favorite Threads (lots of info)
ATTENTION NOOBS: ASK ALL YOUR CULTIVATION QUESTIONS HERE
buy my impulse and vacuum sealers
"Yo mama can eat me" --Mitt Romney
Edited by WI_Shroomer_Skater (09/02/05 12:32 AM)
| |
|
|
You cannot start new topics / You cannot reply to topics HTML is disabled / BBCode is enabled
Moderator: Prisoner#1, RogerRabbit 14,185 topic views. 2 members, 7 guests and 0 web crawlers are browsing this forum.
[ Toggle Favorite | Print Topic ]
| | |
|
|
|