View previous topic :: View next topic |
Author |
Message |
smart.roboard
Joined: 05 Nov 2008 Posts: 3
|
UVTron flame sensor |
Posted: Wed Nov 05, 2008 6:28 am |
|
|
Hi..... i have a uvtron flame sensor to detect the flame / fire. I set this sensor to RB0 as a input. The problem is the PIC16F877A detect on of. After check datasheet, this sensor send a pulse when fire present, else off. So, anybody can help me how to program this sensor. |
|
|
smart.roboard
Joined: 05 Nov 2008 Posts: 3
|
|
Posted: Wed Nov 05, 2008 10:24 am |
|
|
Below is my reference.
http://www.oopic.com/ouvtronhm.htm
Operation:
The oUVTronHM Object handles all the necessary I/O timing requirements to read the UV photon level from a Hamamatsu UVTron Flame Detector (UVTron). It is expecting that a Hamamatsu UVTron Flame Detector is attached to the I/O line specified by the IOLine property and will read the photon count from the UVTron.
The oUVTronHM Object monitors the I/O line specified by IOLine property. As long as the Operate property is 1, the oUVTronHM Object will continually update its Level property with the UV photon reading. This photon count is then converted into a value and stored in the Level property. The Level property is updated with the UV photon reading each time a new pulse is received from the UVTron.
When photons are being received, the Level property is set to a value from 1 to 255 which indicates the level of photon activity. As photon activity increases, the Level property increases. When the UVTron is not receiving UV photons, the Level property will be set to 0.
The Timer property is an instance of the oCycleTimeL object which is created when the oUVTronHM Object is. The oUVTronHM Object uses the timer object to read the signal generated by the UVTron. Modifying any of the properties of the oCycleTimeL instance will affect the oUVTronHM Object's operation. See the oCycleTimeL Help for more detail on how the oUVTronHM reads the UVTron's signal.
In the following example from OOPIC, the oUVTronHM Object is used (In VB language).
Code: | 'This program reads the intensity
'of a flame with an oUVTronHM
'Object and outputs the value
'on I/O lines 8 - 15.
Dim A As New oUVTronHM
Dim B As New oDIO8
Dim C As New oDIO1
Sub Main()
A.IOLine = 1
A.Operate = cvTrue
B.IOGroup = 1
B.Direction = cvOutput
C.IOLine = 23
C.Direction = cvOutput
Do
B.State = A.Level
C.State = A.Detected
Loop
End Sub |
Anybody can translate into CCS C coding. |
|
|
Guest
|
|
Posted: Wed Nov 05, 2008 11:08 am |
|
|
Hi,
You are totally mixing apples and oranges here, and confusing yourself to boot! If you look at the "connections" diagram on the URL you posted, the sensor only has three connections: Gnd, +V, and an active low sensor out. To code this, you would only need to look at one input bit (that is connected to the sensor), and determine if it's high (no flame detected), or low (flame detected). You could do something simple like this:
Code: |
main()
{
while(1) {
output_high(detected_LED); //LED connected to +V thru resistor
while (input(sensor)) {}
output_low(detected_LED);
while (!input(sensor)) {}
} //while
} //main
|
Hope this helps!
Dave |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Nov 05, 2008 4:25 pm |
|
|
The oUVTronHM code can't be simply translated to CCS cause the code is shown at all (it implies e. g. a pulse frequency counter, if I understand the design right). Only the VB interface is shown. You have to design a similar signal processing on your own, if you want similar properties.
@Dave: I think you didn't understand the UV sensor operation. The basic sensor device has a current pulse output, that can either be counted as pulse frequency or filter to an analog current. The interface board generates the sensor HV supply and apparently has a logic compatible pulse output, that is intended to be counted. |
|
|
smart.roboard
Joined: 05 Nov 2008 Posts: 3
|
|
Posted: Wed Nov 05, 2008 6:36 pm |
|
|
Yes FvM. You are correct. The UVTron send the pulse to PIC when the fire are detected. If no fire, the pulse also gone. Maybe you have any ideas how to developed a program using CCS to count the frequency of pulses. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Nov 06, 2008 12:22 am |
|
|
Quote: | Maybe you have any ideas how to developed a program using CCS to count the frequency of pulses | I think, this is an every-days programming problem and you can find many examples that solve similar problems for other applications. CCS C built-in timer related functions and programming examples should be helpful in this regard. |
|
|
|