10kHz frequency signal

Hi all

Is there a way to produce a 10kHz frequency signal to count up a counter with?

Thanks for your help,
Mark

Can you clarify exactly what you mean please? Are you talking about a hardware output or what?

Im just talking about a counter as a node msg.payload. Target is to build a digital twin of flow meter.

Mark

I doubt this would be easily achievable within a flow, given that you need to send a payload every 100 microseconds, and the operating system is not "realtime".

There are highly accurate oscillators you can buy that output 10k, and depending on how fancy you want to get there are both fixed and digital controlled frequency outputs

Eventually you could look into making a signal generator using an ESP32 device. Then sending the signals to Node-RED; MQTT, GPIO....

Or this, even simpler I think:

Theoretically, this should do what you want

Whether it'll do what you need in practice is another matter :slight_smile:

[{"id":"759e555cfae5e864","type":"inject","z":"80a5a214f02754bd","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"0.0001","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":130,"y":120,"wires":[["6d8ee7259f9862a1"]]},{"id":"084186bdde00fd4e","type":"debug","z":"80a5a214f02754bd","name":"debug 467","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":120,"wires":[]},{"id":"6d8ee7259f9862a1","type":"trigger","z":"80a5a214f02754bd","name":"","op1":"","op2":"0","op1type":"pay","op2type":"num","duration":"0.05","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":300,"y":120,"wires":[["084186bdde00fd4e"]]}]

This seems to work but for some reason I was not able to create a up-counter from this 10kHz output. My application would be as follows:

  • Getting a Frequence Value from 5Hz-10kHz e.g. 550Hz.
  • Building de cycle time for the counter which shall count-up in given frequence e.g. 1/550 = 0.001818
  • Reset Counter if a reset signal comes

Target is to build kind of flow meter as digital twin. Such flow meters provide flow as Frequence-Signal

Regards Mark