This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Measuring frequency with TSL235R LIGHT-TO-FREQUENCY CONVERTER using TIVA LaunchPad

I have a TSL235 R light to frequency converter, the datasheet is here: www.rhydolabz.com/.../TSL235R_LF.pdf.

I want to measure the output frequency which is in the range of 250 kHz. I have an ARDUINO Uno and TIVA LaunchPad. How can I interface the sensor with the board for the frequency measurement ?

I am not an electronics engineer, so only reading the datasheet doesnt do it for me. |O

Page 5 of the datasheet shows the diagram to interface the sensor with an MCU. Is it possible to do with TIVA Launchpad ? Will it be accurate enough ? Any example program for this implementation ?

- Regards
Chintan Pathak
Asst. Prof,
CED, IES, IPSA.

  • Hello Chintan,

    It is possible to do so with the TM4C123 LaunchPad. The System can be clocked at 80MHz giving a clock resolution on the timer for 12.5ns. The output from the LtoF needs to be connected to a timer working in Edge Time Mode where it shall capture the time count at which the rising edge got detected. The software running on the uC would then need to take two successive edges to compute the time difference and thereby the frequency.

    Since Timeout is not provided, a second timer running with the same parameters except that it is in periodic mode shall be used to generated timeout to detect a rollover.

    Regards
    Amit
  • Counting would be simpler. Full scale on the device appears to be 500kHz. Reading counts every 1/10 second gets you down to about .2% of full scale before granularity is an issue in a back of the envelope estimate.

    Accuracy I haven't looked (the device seems to have considerable variance though so I think accuracy is not a great concern) at and Chintan didn't specify any required accuracy or precision.

    Robert
  • May I place 2nd vote for, "counting over the largest, pre-rollover interval?"

    I too feel that such devices will not be famed for high precision.    Thus - making just a, "back to back" measurement - is likely to evidence wide extremes - even when the light level is held constant.

    Counting over a wider interval tends to greatly reduce this (unwanted) effect.    As one has stated - choosing a count "window" - safely less than "counter rollover" simplifies & speeds processing & display of (the more accurately) measured data...

  • Thanks bosses for your reply, 

    So as I understand I need to use the counter on the uC to read the frequency. As I understand, the internal timers are less accurate and less power consuming than external crystals. 

    Can you suggest some example implementations for reference. 

  • Chintan Pathak said:
    Can you suggest some example implementations for reference. 

    Surely - but the detail would likely bore you (and us) and the exchange would (likely) become long/tedious.

    May I suggest that you consult with the Electronics and/or Physics department - at your university?   It's predictable that other issues will arise - and "local input" often proves best/fastest/easiest!   

    Each specialty area has its own jargon - tech-speak - surely we'd not quickly/easily master yours.   And - I'd bet - as your project progresses - you'll want to make changes - thus having "local expertise" (sooner rather than later) will pay great dividends.

    After your electronic dept. has reviewed this exchange - and the MCU data - they (most likely) can frame the most suitable questions.

    We note that you have added a concern (now) about "power consumption" - which was absent in your initial request.   All facts presented - up front - most always proves best for all...   (provides guardband against "dead alley" or twisted/wrong paths...)

  • Agree with cb1. Also depending on the project complexity it's just possible it would make a project for a student.

    Depending on your accuracy requirements they might also suggest something different for sensing. My initial read of the data sheet is that this sensor has an initial accuracy of no better than +/- 50%. The timer source error is small in comparison.

    Robert
  • You Robert - prove again - far more diligent than this reporter.   And absolutely true - ideal project for hungry/smart/interested student.   (Luis?)

    Our small tech firm has long learned that clients (and posters) "love to sneak in" adders - often this (significantly) alters the playing field (wrecking our earlier work) - thus my suggestion of poster seeking local expertise to better frame & plan his attack.

    We note that poster Robert very quickly & easily pinpointed a significant weakness in the chosen sensor.    Such speaks to the need for more (i.e. some) departmental collaboration - so that the best blend of expertise is achieved - does it not?   

  • The academic research environment is even more prone to that, the process of taking measurements inspires the need to measure something different.

    Robert
  • Hello Chintan,

    Something really bothering me is the fact that you stated internal timers are less accurate and power consuming that external crystals. Do you mind explaining how you came to this understanding?

    Regards
    Amit
  • Amit, I believe he's referring to the internal oscillator, which certainly is less accurate.

    Robert
  • Hello Robert

    I thought that in the beginning but then TM4C LaunchPad come with "external crystal". So the timer being run out of the external crystal cannot be less accurate!!!

    Regards
    Amit
  • It will be less accurate if the crystal is ignored in favour of the internal oscillator.

    Robert
  • Hello Robert,

    That is what keeps me bothered. Poster never explained what he meant., and he (in my opinion) has not taken adequate information from yours and cb1's original post to derive a conclusion.

    Regards
    Amit
  • May I (always respectfully) note that the clear, "lack of departmental collaboration" has led (now) to a (7 long) "crazy quilt" of guess-work posts - as we attempt to, "tease out" a full & proper user specification...   Wasteful - is it not?