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.

TDC1000: Water flow metering

Part Number: TDC1000
Other Parts Discussed in Thread: TDC7200

Hello I'm trying to make a water flow rate sensor. I'm using TDC1000 and TDC7200 to get data from audiowell 1Mhz tranducer (HS0014-00 Ultrasonic Water Flow Tube). I'm using atmega328p as microcontroller. I successfully read and write both TDC device registers. But whether I connect sensors to TDC1000 or don't connect I get similar data from TDC7200. TDC7200 sends TRIGG signal to TDC1000 and TDC1000 generates START and STOP pulses. What can I do to read proper data from ultrasonic sensors? Thank you.

  • Hi Murat,

    For ultrasonic water flow metering, we no longer recommend the TDC1000 due to its poor accuracy. Instead, please consider switching to the MSP430FR6047. This MCU was designed specifically for flow metering applications. The TDC1000 should only be used for liquid level sensing and concentration measurements.

    Answering your original question: The sequence to use the TDC1000 and TDC7200 combination in general is as follows:

    1. Configure the TDC1000 via SPI using the microcontroller.
    2. Configure the TDC7200 via SPI using the microcontroller.
    3. Send start time-of-flight command to TDC7200 via SPI using microcontroller. The TDC7200 will send a TRIG signal, and the TDC1000 will respond with the creation of the START and STOP pulses.
    4. Wait until the TDC1000 has sent the expected number of STOP pulses, or until a time-of-flight timeout occurs. Maximum timeout on TDC1000 is 8ms.
    5. The TDC7200 TIMEx register values will update based on the START/STOP pulse activity.
    6. Read back the TDC7200 time-of-flight results via SPI using the microcontroller.

  • Hello Akeem,

    Thank you for your answer.

    Unfortunately I cannot switch my microcontroller right now.

    I am doing exactly what you suggested, I configured TDC1000 and TDC7200 via SPI using the microcontroller, I send start tof measurement to TDC7200 via SPI, TDC7200 sends TRIG signal and TDC1000 generates START and STOP pulses, than I read TDC7200 registers to get TOF data. But my problem is I get similar TOF data from TDC7200 sensor connected or not connected to TDC1000. I can provide signal screenshots of my oscilloscope tell me which signals do you need.

  • Hi Murat,

    Have you confirmed using an oscilloscope that the TDC1000's START and STOP pulse activity is different with and without a sensor connected? Depending on the answer, it may be that either or both the TDC1000 and TDC7200 needs additional optimization to enable the proper TOF TIMEx captures.

    You may be re-purpose the working source code examples within the TDC1000-TDC7200EVM GUI v1.2.7.1 (Rev. F) installer, and use the register map configuration files for both devices generated by the online TDC1000 design tool at https://webench.ti.com/webench5/TDC/index.html?origin=pf_panel&app=levelHead 

  • Hi Akeem,

    Thank you for your answer it helped a lot now I have difference between sensors connected or not. Distance between my sensors is 62mm should I read TOF data according to this distance when there is no flow?

    Another questions in TDC1000 datasheet it says TDC1000 automatically swap channels to read both upstream and downstream data how can I detect is it swapping channels or not?Is there a way to understand which TOF data is downstream or upstream?

    Thank you.

  • Hi Murat,

    Yes, the 62mm static TOF reading is the no flow result.

    In the automatic channel swap of Mode 2 you are referring to, there is no bit available to indicate the active channel. If you are only monitoring the flow rate in one direction, then the TOF result itself will indicate if the measurement was downstream or upstream mode. For example, if the first measurement has a short TOF, and the next measurement has a long TOF measurement, then the first measurement is the downstream (always the shorter TOF time).

    If you need to know exactly which channel is active, you should use Mode 2 with EXT_CHSEL = 1, such that the active channel selection is controlled manually with the CHSEL pin. If you want to swap channels in software exclusively, use Mode 0 or 1 and toggle the CH_SEL bit.

  • Hello Akeem,

    I'm sorry I'm bothering you with my questions.

    I configured my TDC1000 according to webench register file, I can now detect downstream and upstream datas thank you for your answer.

    But now my problem is I won't be able to read 62mm when no flow is present, I'm reading approximately 63002526 ps and it is equals to 21.44 mm when I get speed of sound in the dry air 340 m/s @25°C because I didnt get the water tests hence I won't be able to read distance of the sensor in the air. Is it because I configured TDC1000 to work with water? How can do now?

    Thank you for your efforts,

  • Hi Murat,

    I believe the problem is that your measurement is through air, which the 1MHz transducer is not equipped to handle. Once you fill the tube with water for a no flow measurement, you should see more reliable results. If you want to check the measurement in air, you will most likely need to use a different transducer pair (lower frequency, such as 200kHz, which can also be used in liquid).

    P.S. your questions are never a bother, that's what I am here for - to help! :-)

  • Hello Akeem,

    Thank you for your answers and understanding :-)

    I will measure water flow thats why I need to use 1Mhz transducer. As you suggested I filled my tube with water and tested I get similar results as before what can cause of that faulty measurement do you think I somehow make a damage to my transducers?

  • Hi Murat,

    I don't think you damaged your transducers. The only way to damage the transducer is if you over excite the transducer burst voltage, which the TDC1000 is incapable of doing (max driver from the IC is 5Vpp - which is safe for most transducers).

    The issue most likely has to do with your receiver register settings. Typically either the BLANKING time is too short or the ECHO_QUAL_THLD level is too low.

    • If the BLANKING time is too short, then the ring-decay resonating energy of the transducer after bursting can still show up as a false positive on the receiver path, and trigger the threshold based echo detection. You can increase the BLANKING timer value to see if the TOF value also changes.
    • If the ECHO_QUAL_THLD is too low, then the noise floor ripple can likely cause a false positive trigger. It is more likely that the ring-decay is still very strong at 62mm, which is why the TOF you are reading is always constant.

    You can monitor the COMP_IN pin with an oscilloscope to see the echo envelope to see if the ring-decay is the problem at 63002526 ps.

  • Hello Akeem

    Thank you for your answer, I will change Blanking time and ECHO_QUAL_THLD values to get actual TOF data

    Right now my TDC1000 config is:

    TDC1000_Config0                         4A
    TDC1000_Config1                         41
    TDC1000_Config2                         12
    TDC1000_Config3                         08
    TDC1000_Config4                         1F
    TDC1000_TOF-1                           E4
    TDC1000_TOF-0                           32
    TDC1000_Error_Flags                     00
    TDC1000_Timeout                         03
    TDC1000_Clock_Rate                      01

    I will send you the results whether or not I'm successful

    Thank you so much