# Simulate speeding in node red

**URL:** <https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151>\
**Category:** General\
**Tags:** function-node, mqtt\
**Created:** [13 December 2022 19:33 UTC](https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151 "2022-12-13T19:33:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mai](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mai](https://discourse.nodered.org/u/mai)\
**Post date:** [13 December 2022 19:33 UTC](https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151/1 "2022-12-13T19:33:05Z")

</div>

Hello,  
I was wondering if anyone has any idea how I can simulate speeding in node-red, like the data that can be collected through a laser speed gun or a radar...  
To put you in the situation, I need to generate this kind of data in order to use it to sort the drivers into good drivers and reckless drivers. Any kind of clue is appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 December 2022 19:54 UTC](https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151/2 "2022-12-13T19:54:13Z")

</div>

You could use the `random` node to generate values.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 December 2022 20:34 UTC](https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151/3 "2022-12-13T20:34:24Z")

</div>

Or indeed the `$random` function in a change node using JSONata. `$random() * 150` should give you a value between zero and 150 for example.

---

<div class="post-metadata">

**Author:** ![mai](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mai](https://discourse.nodered.org/u/mai)\
**Post date:** [14 December 2022 09:38 UTC](https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151/4 "2022-12-14T09:38:18Z")

</div>

Thank you for your reply! I will try it out and see if it will be of any help in my case since the values I need since I was thinking I should be using an increasing function of sort or maybe a hyperbolic function.

---

<div class="post-metadata">

**Author:** ![mai](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mai](https://discourse.nodered.org/u/mai)\
**Post date:** [14 December 2022 09:40 UTC](https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151/5 "2022-12-14T09:40:36Z")

</div>

Thank you for replying!! I am a beginner in node-red and I haven't gotten the chance to use the change node yet, I will take your advice and experiment with it. Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 February 2023 09:40 UTC](https://discourse.nodered.org/t/simulate-speeding-in-node-red/72151/6 "2023-02-12T09:40:36Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
