I'm trying to add a pressure switch to CR800 and CR1000 loggers. I want them to take data when the pressure of the irrigation drip tape reaches 10 psi. How do I add this into the scenario/program? Also, how do I make sure that the logger will continue to take data even if the pressure goes above 10 psi? Any advice would be greatly appreciated.
This should give you an example of how to accomplish this. The Test table will only write data when the Variable RecData is True.
'CR1000 Series Datalogger
'Declare Public Variables
Public Pressure
Public PTemp
Public RecData As Boolean
'Define Data Tables
DataTable (Test,RecData,1000)
Sample (1,PTemp,FP2)
EndTable
'Main Program
BeginProg
RecData = False
Scan (1,Sec,0,0)
PanelTemp (PTemp,250)
'Measure the Pressure Sensor
VoltSe (Pressure,1,mV5000,1,1,0,250,1.0,0)
If Pressure >= 10 Then
RecData = True
Else
RecData = False
EndIf
CallTable Test
NextScan
EndProg
This would also be a good time to use the "DataInterval" table modifier.
Public PTemp
Public Pressure
DataTable (Test,1,1000)
DataInterval (0,5,Sec,10) 'can use to control write interval
DataEvent (5,Pressure>=10,Pressure<10,5) 'will record 5 records (in this case 25 seconds of data) prior to Pressure>=10 and 5 records after Pressure falls below 10. Makes "bookending" event easy.
Sample (1,PTemp,FP2)
EndTable
BeginProg
Scan (1,Sec,0,0)
PanelTemp (PTemp,250)
'Measure the Pressure Sensor
VoltSe (Pressure,1,mV5000,1,1,0,250,1.0,0)
CallTable Test
NextScan
EndProg
I learn something new every day reading this forum. Thanks Sam
Thanks so much for the help!Now here's my next question. How would I physically wire the pressure switch into the data logger? The pressure switch is an Irrometer that reads up to 15 psi and the data loggers I am using are CR800 and CR1000. I am very new at this so the more specific you can get the better. Thanks again.
Can you be a little more specific with a mfg and model number of the Irrometer so I can look up the manual?
The gauge is made by Irrometer, it is a 0-15 psi sealed gauge w/DC switch closed past setting #22. The item number is 1-7-15-ADS.
I couldn't find anything very specific about the switch but I'm assuming the DC means it switches a DC load vs AC.
I would connect one side of the switch to C1 on the logger and the other side to the 5V terminal. Use this program and see if it gives you a 0 (zero) when the switch is open and a 1 (one) when the switch is closed in the Irrometer variable.
Public PTemp
Public Pressure
Public Irrometer
DataTable (Test,1,1000)
DataInterval (0,5,Sec,10) 'can use to control write interval
DataEvent (5,Pressure>=10,Pressure<10,5) 'will record 5 records (in this case 25 seconds of data) prior to Pressure>=10 and 5 records after Pressure falls below 10. Makes "bookending" event easy.
Sample (1,PTemp,FP2)
EndTable
BeginProg
Scan (1,Sec,0,0)
PanelTemp (PTemp,250)
****************************************
'Measure the Pressure Sensor
PortGet (Irrometer,1 )
****************************************
CallTable Test
NextScan
EndProg
Thanks alot. I'll give that a try and let you know what I find. I was also wondering if I set the pressure switch to collect data at 10 psi, would it collect one point of data and then stop or would it continuously collect data until the pressure reaches below 10 psi? I want it to continuously collect, is there a specific way to make it do this or will it continuously collect already?
If you changed my program to this it would record as long as the Irrometer value = 1:
Scan (1,Sec,0,0)
PanelTemp (PTemp,250)
'Measure the Pressure Sensor
PortGet (Irrometer,1 )
If Irrometer = 1 Then
RecData = True
ElseIf Irrometer = 0
RecData = False
EndIf
CallTable Test
NextScan
EndProg
If you change this line in Sam's program it will work the same way:
DataEvent (5,Irrometer=1,Irrometer=0,5) 'will record 5 records (in this case 25 seconds of data) prior to Pressure>=10 and 5 records after Pressure falls below 10. Makes "bookending" event easy.
Thanks for all of your help. So far the pressure switch is working fine. I appreciate the program examples, they helped out a ton.