QG8 - ACMP to compare LDR voltage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QG8 - ACMP to compare LDR voltage

1,586 Views
KAMATH_innovato
Contributor I
hi,
I want to use the analog comparator on the qg8 chip to compare 2 voltage levels from the LDR .I have the input from the LDR's ready as 2 different input .I tried the code available with the development kit(as i am a newbie)but i have not yet got any result.The program i used is the one given in the quickstart module.
It would be very useful if u can send a sample code where the ACMP is used ,which can make it work.
please mail me at ashwinbhat008@gmail.com
thank you
regards
ashwin

--
Alban Edit: subject clarified.


Message Edited by Alban on 2007-10-07 09:56 PM
Labels (1)
0 Kudos
Reply
2 Replies

468 Views
bigmac
Specialist III
Hello Ashwin,
 
You have not explained the exact nature of your problem, and it would be a good idea to post the relevant portion of your code here, so as to avoid any ambiguity.
 
I assume you wish to compare the light intensity from two different sources, to determine which is the stronger source.  Do you have one LDR circuit connected to one input of the comparator, and the second LDR connected to the other input?  Do you bias each LDR with a resistor connected to Vdd?
 
Since the LDR devices may have a wide unit-to-unit tolerance, you will likely need to provide adjustment of the bias current to compensate for this tolerance.  You will also need to check that the resistor values you have chosen provide sufficient dynamic range over the range of lignt levels of interest.  The comparison is unlikely to be satisfactory if the voltage levels applied to the comparator inputs are quite close to zero or to Vdd, since a large change of light level would produce a very small change of voltage.
 
A final thought - you might also consider the use of the ATD module for this application.  Simply measure the output from each LDR circuit, and compare the values in firmware.  This has the advantage that you can apply a calibration factor to each reading, before making a comparison.  You can also check the dynamic range within the firmware.
 
Regards,
Mac
 
0 Kudos
Reply

468 Views
Alban
Senior Contributor II
Hello and Welcome,

Sending replies by email rather than posting to the Forum is fundamentally against the principle of any forum.
Forums are about exchange and not only take.

That is why I really hope that nobody will answer you by email, but will answer on the forum itself.
If you want to receive the answer via email, just "subscribe" to receive the replies from your post.

When you post, there is an option below the edition window saying "E-mail me if someone replies to this", you just need to check it.
Otherwise, if you forgot, you can come on any post of this the thread and click Options-> Add this thread to my subscriptions.

Regards,
Alban.
0 Kudos
Reply