Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Programming a radiation fan and quantum sensor


KWood Jan 6, 2017 09:39 PM

Hi I am attemping to use CRBasic to program a radiation fan and quantum sensor. The fan is an Apogee TS100 with pulse width modulation capabilities. The quantum sensor is a Apogee LSQ1202S and the datalogger is a CR300. I am primarily using the quantum sensor as a comparison point to either turn the fan on/off. Below is the program I have written. I have copied and pasted the lines of code for the quantum sensor only into a new progam and when run, the program runs flawlessly and accurately. However, when I add in lines of code for the fan and quantum sensor, the program does not work. I am unsure if my wiring is incorrect or if there is another aspect that I am missing. I am very new to using CRBasic and would appreciate the help.

thanks 

'Wiring for CR300

'TS100 ventilated enclosure wires outdoor
'CR300 P_LL ----- LQS120 White wire         'tachometer output from fan under rowcover
'CR300 SE3  ----- LQS120  Green wire  'PWM control for fan
'CR300 SW12V ---- LQS120 Red Wire & Blue wire  'fan 12V power, tachometer power)
'CR300 G ----- LQS120 Clear 
'CR300 power ground  ----------  Black
    
'LSQ120 quantum sensor
'CR300 SE1----LQS120 Red wire
'CR300 SE2---LQS120 Black wire
'CR300 G----LQS120 Clear wire
'CR300 G----Jumper wire
'CR300 SE2---Jumper wire




'Declare Variables and Units
Public BattV
Public PTemp_C
Public DiffVolt
Public RPM 
Public duty_cycle   


Units BattV=Volts
Units DiffVolt=mV
Units PTemp_C=Deg C

'Define Data Tables
DataTable(Table1,True,-1)
	DataInterval(0,5,Sec,10)
	Average(1,DiffVolt,FP2,False)
	Average(1,duty_cycle,IEEE4,False)
	Average(1,RPM,IEEE4,False)
EndTable

DataTable(Table2,True,-1)
	DataInterval(0,5,Sec,10)
	Minimum(1,BattV,FP2,False,False)
EndTable

'Main Program
BeginProg
	'Main Scan
	Scan(1,Sec,1,0)
		'Default CR300 Datalogger Battery Voltage measurement 'BattV'
		Battery(BattV)
		'Default CR300 Datalogger Wiring Panel Temperature measurement 'PTemp_C'
		PanelTemp(PTemp_C,60)
		'Generic Differential Voltage measurements 'DiffVolt'
		VoltDiff(DiffVolt,1,mV2500,1,True,500,60,9.43,0)
		'Set PWM based on incoming data from quantum sensor
		If DiffVolt > 300 Then 
		duty_cycle = 1
		Else
		  duty_cycle = 0
		EndIf
		PWM(duty_cycle,3,50,uSec)
    'Measure RPM with Tachometer
    PulseCount(RPM,1,P_LL,0,1,30,0)
		'Call Data Tables and Store Data
		CallTable Table1
		CallTable Table2
	NextScan
EndProg   

 


smh Jan 9, 2017 01:57 PM

When you say "the program does not work" what exactly do you mean? Assuming it compiled and runs, does it just not turn the fan on? Can you monitor the values of DiffVolt and duty_cycle?


KWood Jan 9, 2017 04:20 PM

The program compiles and is sent to the datalogger just fine but, when I monitor the program there is no data being recorded in the Tables...DiffVolt, duty_cycle, RPM etc.


Jackson.Lopes Jan 9, 2017 05:09 PM

Hey! I'm trying to seek any document about the quantum sensor of yours,but theres nothing on web I can find out. Maybe I'm missing something. Can you send me any llink of its manual or anyother  documantation? Thanks


Jackson.Lopes Jan 9, 2017 05:17 PM

Hey It's me again.

Forgett about it I found the website .


KWood Jan 10, 2017 04:42 PM

 Here is the link to the manual I was using. The code for the quantum sensor compiles and runs fine; it is when I add code for the fan that then none of the instruments record data. Thanks

Log in or register to post/reply in the forum.