# Problems with the Arduino Node

**URL:** <https://discourse.nodered.org/t/problems-with-the-arduino-node/30133>\
**Category:** General\
**Created:** [15 July 2020 14:47 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133 "2020-07-15T14:47:47Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [15 July 2020 14:47 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/1 "2020-07-15T14:47:47Z")

</div>

Hi, I'm reading analog sensor with the Arduino Node, the which one that use firmware, so it reads really fast, I was trying to use the delay node but it seems that ignore the delay, and also I try to modify the firmware code on the Arduino IDE also no change, someone could help me?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 July 2020 15:17 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/2 "2020-07-15T15:17:55Z")

</div>

When you say you tried to use the delay node what were you trying to use it for? If you want to only let one message through every so often (which I suspect may be what you want) then you want it in Rate Limit mode (as that is what you want to do) and Drop Intermediate Messages (otherwise it will queue them up).

---

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [15 July 2020 15:21 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/3 "2020-07-15T15:21:51Z")

</div>

Actually I already try to use Rate Limit, but I will show you what happend, just let me record the screen.

---

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [15 July 2020 15:39 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/4 "2020-07-15T15:39:48Z")

</div>

![Node-RED Dashboard - Google Chrome 2020-07-15 10-34-30](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/b/9b27be768565ec471ab1bb3a53a399014e93a131.gif)

so basically, it looks like is accumulating on the rate node all the values that is reading, and if you see the dashboard in reading so fast it looks like it reads 100 times in a sec.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 July 2020 15:43 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/5 "2020-07-15T15:43:10Z")

</div>

I can't read the flow very well but Values does seem to be changing once per second, and you don't seem to have a Delay node on Values2

---

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [15 July 2020 15:50 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/6 "2020-07-15T15:50:23Z")

</div>

```auto
[{"id":"edb614cf.020e88","type":"arduino in","z":"9171c016.29999","name":"Mega","pin":"0","state":"ANALOG","arduino":"d70d24c3.546d58","x":210,"y":320,"wires":[["e68ecae.0cb5c38"]]},{"id":"c9acd3c5.9d70e","type":"ui_text","z":"9171c016.29999","group":"67ceb806.ee4028","order":4,"width":0,"height":0,"name":"","label":"Vaues","format":"{{msg.payload}}","layout":"row-spread","x":370,"y":400,"wires":[]},{"id":"5710aee6.bde6f","type":"arduino in","z":"9171c016.29999","name":"Mega","pin":"2","state":"ANALOG","arduino":"d70d24c3.546d58","x":530,"y":320,"wires":[["d43dc895.2fb828"]]},{"id":"d43dc895.2fb828","type":"ui_text","z":"9171c016.29999","group":"67ceb806.ee4028","order":4,"width":0,"height":0,"name":"","label":"values 2","format":"{{msg.payload}}","layout":"row-spread","x":740,"y":280,"wires":[]},{"id":"e68ecae.0cb5c38","type":"delay","z":"9171c016.29999","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":360,"y":320,"wires":[["c9acd3c5.9d70e"]]},{"id":"d70d24c3.546d58","type":"arduino-board","z":"","device":"/dev/ttyACM0"},{"id":"67ceb806.ee4028","type":"ui_group","z":"","name":"control valvula","tab":"5dcfacf2.ebe1e4","order":1,"disp":true,"width":"6","collapse":false},{"id":"5dcfacf2.ebe1e4","type":"ui_tab","z":"","name":"Home 1","icon":"dashboard","disabled":false,"hidden":false}]

```

here is the flow, yeah I don't use the delay node to show you how quick are the readings with out the node, and no it don't change once per second even if I disconect the arduino it keeps showing data that's why I thing that is acummulating and then is sending the data acuummulated

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 July 2020 16:10 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/7 "2020-07-15T16:10:13Z")

</div>

Look back at how I said to configure the delay node, then look at how you have configured it.

---

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [15 July 2020 16:21 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/8 "2020-07-15T16:21:46Z")

</div>

Alright thanks I think is working. I did't see the option. Can you help me with the MQTT nodes?.  
Well I thing isn't conecting because the broker but I did the installation as always but i need to type on my Raspberry Mosquitto -v to work, some advice?

---

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [15 July 2020 16:32 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/9 "2020-07-15T16:32:17Z")

</div>

can you help me with this also  
output\_value = map(output\_value,500,0,0,250);  
I want to use that function but I don't know to much Javascript, I wass looking for that function in Javascript

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 July 2020 16:36 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/10 "2020-07-15T16:36:40Z")

</div>

Back on the issue with the delay node, you would be much better to work out how to slow it down in the Arduino, there is no point wasting processor time in node-red handling messages coming in at a much faster rate than is required. This isn't the best place to ask about Arduino code of course.

On the other issues it is best to start new threads so someone who knows about the particular area will see it. Also best to open one thread per issue. If you ask multiple questions on one thread it just gets confusing. Finally make sure you explain the problems you are seeing as clearly as possible.

---

<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:** [15 July 2020 17:16 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/11 "2020-07-15T17:16:07Z")

</div>

Isn't that using Firmata? If so, you don't get any control on the Arduino as far as I know. You send something and you get something back immediately.

---

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [15 July 2020 18:03 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/12 "2020-07-15T18:03:32Z")

</div>

Yeah is using Firmata, thanks for the information.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 July 2020 20:43 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/13 "2020-07-15T20:43:54Z")

</div>

So does that mean that for the Arduino to send a value node-red has to ask for it first? If so then the solution to the problem of how to slow down the rate messages are received at is to slow down how often you are asking for it.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 July 2020 21:20 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/14 "2020-07-15T21:20:24Z")

</div>

Hi @colin - no the arduino node just turns on analogue read mode and the values are streamed in - and we output them if they change... obviously for digital inputs 0 -\> 1 and 1 -\> 0 is fairly well... binary... so often not high rate - but analogue will often vary a lot due to noise, natural variability, etc etc so a high output rate is expected - that indeed then should be downsampled / smoothed / filtered as appropriate.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 July 2020 19:35 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/15 "2020-07-16T19:35:54Z")

</div>

OK, understood. So @lalo the Rate Limit delay node is a good way to go.

---

<div class="post-metadata">

**Author:** ![lalo](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@lalo](https://discourse.nodered.org/u/lalo)\
**Post date:** [16 July 2020 19:49 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/16 "2020-07-16T19:49:15Z")

</div>

Thanks to both. Is working well my flow

---

<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:** [30 July 2020 19:49 UTC](https://discourse.nodered.org/t/problems-with-the-arduino-node/30133/17 "2020-07-30T19:49:17Z")

</div>

Closed on 30 July 2020 19:49 UTC

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