Unsolved Serial port break/freeze when sending data to arduino using QT
-
Hi
It sounds more like a serial over usb driver issue.
Since it can run for days and start working as soon as the OS
redetects the usb serial.
what chip is it ? FTDI ? -
Just connect the Rx/Tx pins of your serial port, open the qtserialport terminal example and try to enter any symbols and see what happens. In this case you will be know that a problem is in HW or in qtserialport.
-
@jkprog that sounds indeed like a HW problem.
I have these too sometimes, most often due to electrical ARCs in the slave device.
but it can also happen if the electrical ground (GND) between PC and Arduiono is bad. in that case, electrical current flows trough the USB ground wire and disturbs communication.
Regards
-
@aha_1980 but how do I solve the problem? How to make sure that the electrical ground is fine?
-
@kuzulis I bought another arduino, and uploaded the same program to it. Then I made a similar gui with 9 buttons. The arduino is connected since 3 days to my computer, and I try switching the buttons on the GUI and it has been working fine.
But on the original controller with 2 arduinos connected to a different PC with windows 10 it doesnt seem to work as desired.
I have also disabled the USB suspend settings on windows 10 to eliminate any chances of USB port getting disabled. -
I have attached the circuit diagrams as to how I have connected my 2 arduino mega to power and relay module.
The first circuit diagram shows how I powered my arduino and the relay modules.
The following diagram shows how the arduino GPIO pins are connected to the low voltage relays.
Each arduino mega 2560 is connected to 4 relay modules. I have powered my relay modules with the same power source that is used to power each relay module. Both arduinos are being powered separately using a 7.5V 700mA regulated supply. The arduinos are powered from the same socket on 2nd floor and the computer is on 1st floor and is powered from a different socket.
The GPIO pins of arduino are connected to the relays on the module. The output of the relays is connected to high voltage relays which are then connected to the lights to be switched on/off.
Is there anything that I am doing wrong in the wiring?
The 8-relay modules that I am using are :
srd-05Vdc-SL-C -
@jkprog I'm no expert for the power supply part, just two questions:
- how long are the USB cables?
- can you try the arduionos without the power (relay) part?
-
@aha_1980 The arduino usb cable A/B is around 4ft. But then I have used USB extension cables which are of length 15-17ft.
At times, just closing the GUI window and reopening it also makes it work. -
@jkprog everything over 3m works a bit, over 5m not at all. please check the max. length.
-
It is approx 8m.
Is there some solution to this problem other than switching to WiFi? Will increasing the baud rate help to fix this problem?
By the way, I have used the USB booster cable extension. Initially I used normal USB extension cables and the problem was even more frequent. With the usage of booster cables it got better but still this is not acceptable for my seniors.
I cannot move the computer or the arduinos to the same floor. -
Hi
Why not use a serial over lan device ?
Like
https://www.startech.com/eu/Networking-IO/Serial-over-IP/1-port-RS232-serial-over-ip-adapter~NETRS2321PI had good result with those when i need serial from office to machine.