Follow up question on this topic: if powered from the external plug, does the USB cable between the Pi and the A2 need to be modified to cut out the power supply in the USB cable or is that already accounted for in the USB adapter provided?
Hi,
Another customer had a similar question recently. You can read my answer here.
If you need the USB cable to always be connected (cannot be unplugged before proper power-up), then you will most likely need to find a way to not provide power to the interface from the USB cable.
You will most likely still need to keep the common GND to ensure proper serial communication.
To be honest, we have not tried to remove the VCC part of a USB cable and see if this will work well still. In every situation up to now, we have simply unplugged the cable before powering the device.
Sincerely,
Hey,
On a separate note, it seems the USB standard requires the device to observe VBus (VCC) high before tehy can communicate on D+ / D-.
Therefore, this would indicate that a properly working device should not communicate if you remove the VCC (VBus) component of a USB cable.
That being said, many devices do funny things (outside the standard), so it may still work. But, with this new information, it is not recommended.
The best option would be to have a way to disconnected the USB cable from either the adapter board or the host before power-up is done on the barrel connector.
Maybe use a tri-state buffer with 4 channels that is triggered by the same power source as the barrel connector?
Sincerely,
Thanks for following up. I have no idea what a tri-state buffer is so I will opt for the plug/un-lug method for now. To be clear, I am powering the lidar from a pair of 18650 Li-ion batteries (3000 mAh). I have buck converter to limit the output to +5v (+5.05 to be pedantic) and smooth out the ripples. I have a spare ground before and after the buck converter so linking that all to a common ground should not be a problem. After start up of the lidar on external power, your recommendation is then hook up the USB and there should be no power issues. Does that sound correct?
Hey,
Thanks for the clear explanation of your setup.
Yes, that does sound like it would be the recommended solution. This has been working well for us here with our tests.
We have contacted the manufacturer to confirm if there is a simple solution to the “power from USB before barrel” issue. We will post here again once we have a reply.
Sincerely,
Hi,
The manufacturer responded that they were aware of the RPi not being able to provide enough power directly. Their recommendation is basically the same as ours previously: provide enough power at startup for the RPLidar A2 to power -up properly. Since the adapter board will use power from either the USB port or the barrel connector (whichever shows up first), make sure your barrel connector external power source is turned on first (before the RPi) or ensure the RPLidar is only connected to the RPi by USB after that power-up has happen from the barrel connector.
That being said, there is another alternative that may be simpler (and better), especially if you need the USB to always be connected (such as in a mobile robot that may sleep/reset/turn on automatically) or just any assembly where it is impractical to disconnect/reconnect the USB cable at every power cycle: a powered USB hub placed between the RPLidar A2’s adapter board and the RPi. This hub would most likely be powered by your regulated output from the power bank. Just make sure the hub is rated for a high enough current and it should be fine.
Another (but a bit more complex) solution would be to make your own adapter board that provides power only from the barrel. We do this for example in our SSC-32U boards, where the USB socket only powers the USB interface but not the on-board electronics or motors.
We hope this helps!
Sincerely,
Presume the barrel connector is positive (+) on the inside and ground on the outside, correct? I am definitely getting +5.05 through my buck converter but the lidar is not powering up. The moment I plug it into my lap top, I get a green light on the small USB board. Is there some “switch” I need to flip? Does anyone make a connector which is already soldered on the inside? I am not confident in my own work.
I connected a multimeter into my circuit. I can see that I am delivering +5.05V to the mini-usb converter that came with my RPLidar. I never get a green or red light on that board when connecting everything up. I also tested and I am drawing .27A. When I plug into my raspberry pi, I get a green light, but no red light on the usb converter. Via python, I can get info and health from the lidar, start the motor, stop the motor, etc but not take readings. I also notice when I plug into my pi, the power drawn through the mini-barrel drops off to +.002V, which I think is expected. When I plug the lidar right into my laptop, I get an initial red+green light on the mini-board, then a steady green for a few seconds, and I can do everything I can with my pi as well as take readings etc. It seems like the board is not getting powered up properly through the barrel connector.
I am using this buck converter: amazon.com/gp/product/B018J … UTF8&psc=1 According to that page, the ripple on these is 30mV.
Data sheet is here: pdf1.alldatasheet.com/datasheet- … 584EN.html
Any idea on what I might be doing wrong? It seems like I can’t initialize this from the barrel connector.
Hi,
Thank you for all the details. We communicated these to the manufacturer and here is a copy of their reply:
[/highlight][/font]
Sincerely,
Thanks for the update. I have another buck converter coming to the house today as well as a USB hub. One of them will work (I hope). More to come.
Sigh.
I used this buck (amazon.com/DZS-Elec-Adjusta … =LM2596+DC), inputting +7.2, trimming to +5.05 out. Plug that into the barrel connector and get nothing. Plug into the barrel and then the Pi, I get the instant green light, but not the red light. I can talk to the to RPlidar for get_heath(), get_info(), but the motor won’t start and I don’t get any scans. That is consistent with just plugging directly into the Pi so I am pretty sure the barrel is not powering there. I put a multi-meter into the circuit, I am getting a stead +5.05V.
I bought this USB hub (amazon.com/gp/product/B00DQ … UTF8&psc=1) which puts out +5V @ 2.5 amps. Plug that into the provided power supply and into the wall, and then plug the Pi and RPLidar into that (one at a time), the Pi starts up, the Lidar never does. Change the order, same result. Plug the Lidar in alone, same result. Take the wall wart out, power the hub from my MS Surface Pro 4, both the Lidar and Pi start with no problem.
I bought this power bank (amazon.com/gp/product/B00Z9 … UTF8&psc=1). Powered the USB port from there. The Pi starts, the RPLidar never does. Both the Surface the the USB hub are USB 3.0 so the power output should be comparable. The power bank provides +5V, up to 3A per port (I am only using 1). With nothing else on the hub, the Pi want’s +5V, running flat out (100% on all cores), the Pi wants 730mA. Even with the 1500_mA start up of the Lidar, the hub and the power bank should be adequate.
At this point, I am at my whits end. The barrel connector doesn’t seem to work. If you can provide me a clear point to take a voltage reading from the USB board, I will take one to see if power is being provided beyond the connector. I have no idea on a way forward. I could try modifying a USB cable and pulling power from the power bank (an earlier poster suggested success), but I am not convinced the provided USB board is working properly. Any suggestions you might have would be appreciated.
Just to be clear, the PRLidar works perfectly with my Surface Pro.
Thanks.
I would be happy to measure the current. It will take me a bit to set up a way to do that.
I have to say this is quite a weird situation. It is starting to feel like their might be something wrong with your adapter board… but then it works with the Surface Pro.
We have relayed this information to the manufacturer as this is definitely beyond our typical support for these kind of products. We’ll post here again as soon as we have more details.
Sincerely,
I have resolved this to an intermittent issue. To interface with the RPLidar via Python, using this library (github.com/SkRobo/rplidar), you need to update to the latest version of pyserial. Once I did that, I was able to run the small demo at the bottom of that page meaning the RPLidar works with my Pi now!
The RPLidar connects when powered off either the Pi USB interface or the barrel+USB interface. I am still not convinced this is powering off the barrel connector at all. I have to poke around a bit more to see if I can make the powered USB hub work. It didn’t work “out of the box” but I suspect that’s because the RPLidar is moved off off /dev/USB0 to some other port. I will play with that later. Thanks for all your help!
I can safely say that I am running the RPLidar off the USB port of my Raspberry Pi. Admittedly, the Pi is not under any load, but it is working. I will watch it as I progress to my next phase running SLAM. Thanks again for all your help.
Hi,
We are glad you got it up and running!
Feel free to post about your project here. We are certain the RobotShop community would be interested in learning more about it!
Good luck with your project.
Sincerely,