Go Down

Topic: Serial Port Not Found when using multiple sensors (Read 147 times) previous topic - next topic

eaick

I'm using an Arduino Uno and trying to configure three MG-811 sensors to work together.

When I have one or two of the sensors plugged in to the board (pins A1 and A2), the code uploads just fine and works as desired. As soon as I add power to the third sensor, the already-uploaded code stops running and I get the following error when I try to re-upload:

Code: [Select]
Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"

Sketch uses 5760 bytes (17%) of program storage space. Maximum is 32256 bytes.
Global variables use 286 bytes (13%) of dynamic memory, leaving 1762 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\\.\COM4": The system cannot find the file specified.


Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
processing.app.SerialException: Error opening serial port 'COM4'.
at processing.app.Serial.<init>(Serial.java:147)
at processing.app.Serial.<init>(Serial.java:82)
at processing.app.SerialMonitor$4.<init>(SerialMonitor.java:101)
at processing.app.SerialMonitor.open(SerialMonitor.java:101)
at processing.app.AbstractMonitor.resume(AbstractMonitor.java:104)
at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2126)
at processing.app.Editor.access$1300(Editor.java:115)
at processing.app.Editor$UploadHandler.run(Editor.java:2104)
at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - COM4; Method name - openPort(); Exception type - Port not found.
at jssc.SerialPort.openPort(SerialPort.java:167)
at processing.app.Serial.<init>(Serial.java:136)
... 8 more
Error opening serial port 'COM4'.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


I've tried using external power sources, different analog pins, a different Arduino, and an entirely different set of sensors. It doesn't seem to matter where the power is drawn from, which sensors I use, or which pin(s) I'm using. I can even have all three sensors grounded and connected to analog ports, but as soon as I add power to the third sensor it stops running the program and recognizing the serial port.

My best guess is that it has something to do with each sensor attempting to draw 5V; is there a limit regarding voltage and analog inputs?  Any suggestions on how to avoid this error?

ballscrewbob

What CURRENT does each sensor require ?

Doubt it is an actual VOLTAGE issue.

Schematic would be useful too.

Maybe worth reading this before adding any more information.

Bob.
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

eaick

#2
Sep 17, 2019, 10:53 pm Last Edit: Sep 17, 2019, 11:00 pm by ballscrewbob
I've attached a schematic of one of the configurations I've tried, just to give a general idea. I've also tried using separate power sources for each sensor with a common ground, and a few other brief ideas. Sorry for any confusion; I'm used to working with software, not hardware, so this is fairly new to me... in all my searches over the past weeks, I haven't even thought to check current as opposed to voltage.

If I'm reading the datasheet for the MG-811 correctly, each sensor draws 200mA. I'm using an external power source, so I should have enough current supplied for all three. I've seen that Arduino has a limit on the sum of the currents for all of the input and output pins; would using transistors alleviate the problem?

MOD EDIT

ballscrewbob

#3
Sep 17, 2019, 11:02 pm Last Edit: Sep 17, 2019, 11:08 pm by ballscrewbob
200mA is more than the Arduino can handle.
SO your PSU should be at least 600mA just for the sensors alone.

Also don't forget these types of sensor mostly have an initial burn in period and warm up period . (24/48 hrs)

I presume you did the burn in's already ?
Once you have completed the burn in then you can calibrate them (not always needed but recommended).

The warm up period can often draw more than the run current.
Your present pic is likely to either stop the Arduino from working or even damage it beyond repair.

Bob.
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Go Up