USB - data without power

I had this attached to another related post, but it was ignored, likely as no one was interested in the other post. However, I’d like to be able to read output from Log.info() calls via USB, but without supplying power via USB. The project involves powering the device via battery, so I don’t want USB power.

I purchased a USB adapter that supposedly does not pass power, only data. However, the Particle device is not recognized by my MacBook if power isn’t being provided via USB.

Is there a technique that’s best practice for reading Serial.print() and/or Log.info() calls when not supplying power via USB?

Hi @ctmorrison

I’d recommend using Serial1 for the print logs and the LogHandler. You’d need a usb/serial adaptor, but this ensures that VUSB is unpowered.

I use it when testing power draw with the Otii.

1 Like

@no1089 , thanks for the suggestion. I’ll give it a try when I’m next in the office. Do you have a recommendation for a usb/serial adapter that you’ve had success with?

Hi @ctmorrison
I personally recommend this one:

which is working like charm for me :slight_smile:

One more thing I would like to mention, not 100% sure but you can use Serial1.print() functionality etc. just worries about Log.info() etc. as is strictly connected with Serial

UPDATE
never mind I found the answer for myself :see_no_evil: you can easily use it with Serial1LogHandler
Serial1LogHandler

1 Like

That's the one yes.
If you declare the loghandler, you don't need to do Serial1.begin() - it's already handled by the loghandler.

@ctmorrison This is the one I use: FTDI Serial TTL-232 USB Type C Cable - 3V Power and Logic : ID 4331 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits, but generally for power tests I run it via the Otii for power and use the built-in serial port on it to determine what the application is up to.

2 Likes

Gen 3 devices cannot use a USB port that does not supply power. The nRF52 uses the presence of USB power to determine whether to turn on the USB block in the MCU. If there is no USB power, the USB module in the MCU is turned off.

You can use Gen 2 devices with no USB power.

Serial1 is usually the best alternative if you need to measure current, and also for catching log messages immediately after waking from sleep.

2 Likes

@dreamER , I acquired the Pololu board you recommended and changed SerialLogHandler to Serial1LogHandler. I connect TX and GND from my Argon board to RX and GND respectively on the Pololu board. I connected my MacBook to the Pololu board with a USB cable. However, I’m getting “No serial port identified” when I do a particle serial monitor.

I did a ls -al /dev and found some ports with the current time stamp. However, adding them to particle serial monitor --port didn’t help. I’d appreciate any guidance.

@ctmorrison you have to specify from which port you would like to pull data.
Connect Pololu adapter to your MacBook and then try:
brew install lsusb and then:
lsusb
when you discover your adapter e.g: /dev/ttyS0 (I’m Linux guy, no clue about Mac :see_no_evil:)
try: particle serial monitor --port /your/discovered/usb_to_serial (e.g: particle serial monitor --port /dev/ttyS0)

let me know if this help :slight_smile:

@ctmorrison I forgot to mention to Try to install driver fo this adapter
https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip

The info is on Pololu website
I didn’t need any driver for Linux :grin:

@dreamER , thanks for that tip…it works great now!

Glad to hear that :wink:
I’m just curious, did you have to install this driver ?

Well…I think so. I believe I had tried to monitor any other device that had the appropriate timestamp, but without success. I then installed the driver and it worked…as soon as I picked the appropriate device. The only way I’d know for sure would be to remove the driver and try again. But, I don’t have the time to do that right now.

Thanks, again, for your suggestion!

1 Like

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