Power Arduino from 12V, yet still connect USB? Ramps 1.4 board


#1

I’m not sure how to do this the ‘best’ way. I’ve currently cut D1 (not powering via 12V supply) so I can connect USB, and USB also provides the power. I want to disable USB power so I can switch back to 12V powering the Arduino (reconnect D1). My goal is to print standalone, via USB or to trigger a SDCard print via USB (Octoprint). Has anyone either cut traces on their arduino or modified a USB cable with success to do this? Or some other modifications?


#2

I’ve had the same scenario/problem but I’ve been using my Pi for other things and have created other problems to solve. :blush:

It may be possible to turn off USB port power from your RasPi. See the post from jdb on this thread https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=93463.


#3

Darn you for not solving this problem first… The problem with solving it in software on the PI is the software has to run first, which will not happen before the USB power is applied… I’m thinking cutting traces/de-soldering a fuse on the Arduino is the safest way, then you don’t care about the cable or boot order.


#4

Ahh, I ran my Pi from it’s own 5v power supply and the powered Pi was keeping the Arduino powered (just barely) via USB even when the printers mains power was switched off. I guess I had a similar problem not the same. I guess I don’t understand your case entirely. I’ll come back to it later to see if I can help.


#5

I want to switch between my Mac, PI and no USB connection. Simple really :slight_smile:


#6

I haven’t had any trouble connecting my PC or RasPi via USB with D1 connected. It works.


#7

From here

The VCC pin can be connected to your ATX’s 5Vsb to continuously power the Arduino from your ATX power supply. You will want to make sure that D1 is not installed or cut out. The Arduino is not designed to be powered directly on the VCC rail and the VIN pin at the same time.

I read that as don’t do both, although very possible I misunderstood. When I did it briefly, I saw a dramatic increase in brightness on the LCD, and didn’t think that was a “good thing”.


#8

I do the same. Only issue I have is that my board stay powered on when connected to the PI. Shouldn’t be to hard to make a small USB to USB adapter with no 5v connection.

Edit : Get one of those http://s3.trianglecables.com.s3.amazonaws.com/images/catalog/product/USB-2-A-Male-A-Female-Passive-Extension-Cable-6-Inches-1.jpg, cut the red wire or 5v wire. You should be good to go :stuck_out_tongue:


#9

I’ve been thinking about the same sort of thing. My Ramps board stays on all the time powered by my Pi. I’d like to experiment with using a GPIO pin from the Pi to toggle the Ramps reset switch. It should be do-able, but will require a level-shifter between the Pi’s 3v logic and the Arduino Mega’s 5V logic.


#10

Good idea. You should not need the level-shifter though. The Arduino will still read 3.3v as high. You just don’t want to do it the other direction. Like writing a digital pin on the Arduino high and trying to read it on the RPi GPIO, that would be bad.


#11

Kent, Great point. I didn’t even think about that. The microcontroller that’s reading isn’t setting a voltage, so as long as I doon’t drive the Arduino high, I won’t break anything.


#12

@LogicalChaos I don’t know why the wiki says to disconnected D1. The Arduino is designed to be powered by either the VCC input or the VIN input (which is what D1 connects to) simultaneously. I do that all the time. Actually, I think I do know why they say that - it’s because the original Arduino Mega did not have that capability but I think that was added in R3 which is what we’re all using nowadays.


#13

Thanks for that info @mjrice. I had re-soldered D1 already (that was a pain), and had not seen any ill effects, so I’ll stop worrying about it.