FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
130 views 2 comments
by anonymous
I want to use RUT955 to measure the frequency of the low voltage ac signal, how can i do so please advice. i am using an angle sensor which gives me an output in frequency from 300Hz 480Hz.

1 Answer

0 votes
by anonymous
Hi there,

i would suggest a frequency transducer hooked up to the analouge input.

something like this: https://www.wago.com/de/messumformer-trennverstaerker/jumpflex-messumformer/p/857-500
by anonymous
Thank you for the reply.

Please also confirm if you have any other model in Teltonika which can take input without the Freq Transducer.
by anonymous

Hi, i´m just a guy on the forum, so...

I use some RUT955 to measure and log water levels. So i´m used to use the analouge inputs of the device. Maybe there´s another automotive device from Teltonika that could measure frequency directly, but i don´t know. Also i think it should be possible to write a script the makes it possible.

As an inspiration here´s what chatGPT has to offer (no warranty!!! but it helped me with my scripts alot :)

code
#!/bin/sh

# Set the GPIO pin number of the digital input
gpio_pin=6

# Configure the GPIO pin as an input
echo $gpio_pin > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio$gpio_pin/direction

# Measure the frequency of the input signal
while true; do
    num_rising_edges=$(cat /sys/class/gpio/gpio$gpio_pin/uevent | grep "GPIO_EVENT=0x01" | wc -l)
    frequency=$((num_rising_edges / 2)) # Divide by 2 because we're counting rising edges
    echo "Input frequency: $frequency Hz"
    sleep 1
done

# Clean up by unexporting the GPIO pin
echo $gpio_pin > /sys/class/gpio/unexport

This script uses the sysfs interface to access the digital input of the Teltonika RUT955 router. It first exports the GPIO pin number (in this case, 6) and sets it as an input. Then, it continuously reads the uevent file for the GPIO pin to count the number of rising edges (i.e., transitions from 0 to 1) that occur over a 1-second interval. The number of rising edges is then divided by 2 to calculate the frequency of the input signal in Hz. The script then prints the current frequency and sleeps for 1 second before repeating the process.

To run the script, save it as a file (e.g., measure_input_frequency.sh), make it executable (chmod +x measure_input_frequency.sh), and then execute it with ./measure_input_frequency.sh from a terminal on the Teltonika RUT955 router. Note that this script assumes that the input signal is a square wave with a 50% duty cycle. If the duty cycle is different, the frequency calculation will need to be adjusted accordingly.