Jump to content

Measuring frequency from TSL235R LIGHT-TO-FREQUENCY CONVERTER using a TIVA Launchpad

Recommended Posts

I have a TSL235 R light to frequency converter, the datasheet is here: http://www.rhydolabz.com/documents/sensors/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, 



Link to post
Share on other sites

There are several ways, and which way depends on the accuracy you need in the result and how frequently you need the result.


For example, if you only need the light value every few seconds, using a counter to count the output pulses for 1sec gives you the frequency directly.


If you need the light value 10 time per second, counting for 1/10s, and multiply by ten


If you need the value on demand, quickly, then you can use a timer to measure the length of a single, or small number, of pulses (get the period, which is 1/f), and take a reciprocal to get frequency.


The longer you can measure, the more precise the result, since the measurement will be done by counting pulses, and the count will always be +/-1 or +/-2 (depending on synchronization conditions). The net result of this is that at HIGH intensity, with HIGH frequency, best precision is by counting cycles from the sensor, the longer the better. At LOW light, with LOW frequency output, the best precision is timing the cycle from the sensor.


For example: If you are interested in low light for photographic exposure, you would time the length of the pulse using a timer and capture mode. The output of the sensor goes to a capture input, the timer is configured (details depend on the application and language/programming package used) and the number of timer timer clocks  is counted and stored in the appropriate CCR automatically. This is automated in many libraries. For example, there may be a function such as "pulseIn" in the Arduino toolset to time the length of a pulse. Sometimes quite precisely, sometimes less so.


For example: for high light levels, you can set the timer to cycle at, say 1/10th second. The output of the sensor again goes to an appropriate timer/counter input. Clear a counter at the beginning of the cycle, and read it at the end of the cycle. Again, this is a common process, so it is pretty well automated and many libraries provide a tool to do most of the heavy lifting for you.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...