<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									RPLidar A1 with Arduino works not constantly - I/O Devices - Sensors - Modules				            </title>
            <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/</link>
            <description>Discussion board for Robotics, Arduino, Raspberry Pi and other DIY electronics and modules. Join us today!</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 12 Aug 2026 14:25:44 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12351</link>
                        <pubDate>Tue, 04 Aug 2020 19:11:12 +0000</pubDate>
                        <description><![CDATA[You are trying to use the same serial port for logging and the lidar?  Soft serial the Lidar if you can and on an Uno (or any 328p), nothing past 57k baud.  Period :)]]></description>
                        <content:encoded><![CDATA[<p>You are trying to use the same serial port for logging and the lidar?  Soft serial the Lidar if you can and on an Uno (or any 328p), nothing past 57k baud.  Period :)</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>triform</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12351</guid>
                    </item>
				                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12350</link>
                        <pubDate>Tue, 04 Aug 2020 18:05:03 +0000</pubDate>
                        <description><![CDATA[@ruplicator
I tried the serial.flush() in a few ways, but none would work. Think that the delay caused by the serial.flush() is too high, because in some cases the lidar won&#039;t start working...]]></description>
                        <content:encoded><![CDATA[<p>@ruplicator</p>
<p>I tried the serial.flush() in a few ways, but none would work. Think that the delay caused by the serial.flush() is too high, because in some cases the lidar won't start working or gives more inconstant values than the orignial program.</p>
<p>But thanks anyway :-)</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>jonaskell</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12350</guid>
                    </item>
				                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12349</link>
                        <pubDate>Tue, 04 Aug 2020 18:03:10 +0000</pubDate>
                        <description><![CDATA[@ve1dx
Yes, I will let you know. Honestly I don&#039;t have any clue what could fix my problem]]></description>
                        <content:encoded><![CDATA[<p>@ve1dx</p>
<p>Yes, I will let you know. Honestly I don't have any clue what could fix my problem</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>jonaskell</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12349</guid>
                    </item>
				                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12177</link>
                        <pubDate>Mon, 20 Jul 2020 17:54:17 +0000</pubDate>
                        <description><![CDATA[@jonaskell
Grabbing at straws here but you don&#039;t have much of a delay in your loop and the Serial.print may be walking on each other. take a look at]]></description>
                        <content:encoded><![CDATA[<p>@jonaskell</p>
<p>Grabbing at straws here but you don't have much of a delay in your loop and the Serial.print may be walking on each other. take a look at <a href="https://www.baldengineer.com/when-do-you-use-the-arduinos-to-use-serial-flush.html">https://www.baldengineer.com/when-do-you-use-the-arduinos-to-use-serial-flush.html</a></p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>Ruplicator</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12177</guid>
                    </item>
				                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12174</link>
                        <pubDate>Mon, 20 Jul 2020 16:47:43 +0000</pubDate>
                        <description><![CDATA[@jonaskell That looks like the old mess we&#039;d get on RS-232C interfaces if we had the number of data bits wrong, the parity bit set incorrectly, etc.  There are enough &quot;good&quot; characters to su...]]></description>
                        <content:encoded><![CDATA[<p>@jonaskell That looks like the old mess we'd get on RS-232C interfaces if we had the number of data bits wrong, the parity bit set incorrectly, etc.  There are enough "good" characters to suggest it's close.  I agree with @ruplicator that the UART is likely the problem.  Typically old RS-232C interfaces ran at higher voltage swings than 5V — I recall -12V level corresponds to a logical '1' and +12V level corresponds to a logical '0'. </p>
<p>However, that's old DB-25 connector era thinking . . . back in the medieval days of computing!  Whatever it is, it's close.  I assume you tried different cables, etc.  I wish I had something more to suggest, but I don't.  All I can say is it's close, but some little thing is causing it to act erratically.  Like 7 data bits instead of 8, etc.  If you resolve it, could you let us know what was causing it?</p>
<p>Paul VE1DX</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>VE1DX</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12174</guid>
                    </item>
				                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12172</link>
                        <pubDate>Mon, 20 Jul 2020 16:04:03 +0000</pubDate>
                        <description><![CDATA[Thank you, but both ideas won&#039;t work. I checked the baud rate and tried othe rates, but none would work...
Any other ideas?]]></description>
                        <content:encoded><![CDATA[<p>Thank you, but both ideas won't work. I checked the baud rate and tried othe rates, but none would work...</p>
<p>Any other ideas?</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>jonaskell</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12172</guid>
                    </item>
				                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12163</link>
                        <pubDate>Mon, 20 Jul 2020 01:50:30 +0000</pubDate>
                        <description><![CDATA[@jonaskell
You might have better luck if you reduce the serial speed to the monitor to 9600. That is the default speed for the Uno. It looks like the UART is having trouble syncing at 11520...]]></description>
                        <content:encoded><![CDATA[<p><span>@jonaskell</span></p>
<p>You might have better luck if you reduce the serial speed to the monitor to 9600. That is the default speed for the Uno. It looks like the UART is having trouble syncing at 115200.</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>Ruplicator</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12163</guid>
                    </item>
				                    <item>
                        <title>RE: RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12136</link>
                        <pubDate>Thu, 16 Jul 2020 10:15:12 +0000</pubDate>
                        <description><![CDATA[I do not have much experience with lidar but I suggest you try 
putting  &quot; lidar.begin(Serial);&quot;   after the &quot; Serial.begin(115200);&quot;
Just a thought.]]></description>
                        <content:encoded><![CDATA[<p>I do not have much experience with lidar but I suggest you try </p>
<p>putting  " lidar.begin(Serial);"   after the " Serial.begin(115200);"</p>
<p>Just a thought.</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>hstaam</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12136</guid>
                    </item>
				                    <item>
                        <title>RPLidar A1 with Arduino works not constantly</title>
                        <link>https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12127</link>
                        <pubDate>Wed, 15 Jul 2020 16:54:06 +0000</pubDate>
                        <description><![CDATA[Hi
I am currently working on a project with a RPLidar A1 connected to an Arduino UNO, where I need to display various distances on the serial monitor. The Lidar works and the connection to ...]]></description>
                        <content:encoded><![CDATA[<p>Hi</p>
<p>I am currently working on a project with a RPLidar A1 connected to an Arduino UNO, where I need to display various distances on the serial monitor. The Lidar works and the connection to the Arduino as well, because I tested the Lidar via Frame Grabber and the Lidar spins when connected to the Arduino. My problem is that the serial monitor doesn't show constant values. After a few measurements the serial monitor prints "⸮P⸮%⸮". Does anyone know how I can fix this so the serial monitor will print constantly?</p>
<p>Serial monitor example:</p>
<p>⸮P⸮%⸮ distance: 0.00 // angle: 74.50<br />distance: 807.50 // angle: 69.48<br />⸮P⸮%⸮ distance: 802.25 // angle: 70.72<br />⸮P⸮%⸮ distance: 0.00 // angle: 138.00<br />distance: 5143.75 // angle: 131.48<br />⸮P⸮%⸮ distance: 5060.00 // angle: 132.69<br />⸮P⸮%⸮ distance: 391.50 // angle: 0.41<br />distance: 393.00 // angle: 1.69<br />⸮P⸮%⸮ distance: 394.50 // angle: 2.70<br />⸮P⸮%⸮ distance: 0.00 // angle: 59.47<br />distance: 0.00 // angle: 60.67<br />⸮P⸮%⸮ distance: 0.00 // angle: 61.88<br />⸮P⸮%⸮ distance: 3370.75 // angle: 111.27</p>
<pre>My code:<br /><br />#include &lt;RPLidar.h&gt;<br /><br />RPLidar lidar;<br /><br /><br />#define RPLIDAR_MOTOR 3<br /><br />void setup() {<br />lidar.begin(Serial);<br />pinMode(RPLIDAR_MOTOR, OUTPUT);<br /><br />pinMode(11,OUTPUT);<br />pinMode(12,OUTPUT);<br />pinMode(13,OUTPUT);<br /><br />Serial.begin(115200);<br />}<br /><br />void loop() {<br /> if(IS_OK(lidar.waitPoint())) {<br />  float distance = lidar.getCurrentPoint().distance;<br />  float angle    = lidar.getCurrentPoint().angle;<br />  bool startBit  = lidar.getCurrentPoint().startBit;<br />  byte quality   = lidar.getCurrentPoint().quality;<br /><br />  if(angle &lt; 180) {<br />  Serial.print("distance: ");<br />  Serial.print(distance);<br />  Serial.print(" // angle: ");<br />  Serial.println(angle);<br />  }<br /> }<br /> <br />  else {<br />    analogWrite(RPLIDAR_MOTOR, 0);<br /><br />    rplidar_response_device_info_t info;<br />    if (IS_OK(lidar.getDeviceInfo(info, 100))) {<br />      lidar.startScan();<br /><br />      analogWrite(RPLIDAR_MOTOR, 255);<br />      delay(10);<br />    }<br />  }<br />}</pre>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/sensors-modules/">I/O Devices - Sensors - Modules</category>                        <dc:creator>jonaskell</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/sensors-modules/rplidar-a1-with-arduino-works-not-constantly/#post-12127</guid>
                    </item>
							        </channel>
        </rss>
		