CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

UVTron flame sensor

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
smart.roboard



Joined: 05 Nov 2008
Posts: 3

View user's profile Send private message

UVTron flame sensor
PostPosted: Wed Nov 05, 2008 6:28 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 05, 2008 10:24 am     Reply with quote

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








PostPosted: Wed Nov 05, 2008 11:08 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 05, 2008 4:25 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 05, 2008 6:36 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 06, 2008 12:22 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group