Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Modbus TCP with Arduino - Digital output problem

Modbus TCP with Arduino - Digital output problem 5 years 1 month ago #10191

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 85
  • Karma: 0
Hi everyone,
I followed ben's tutorial on Modbus TCP - logic I/O and I used Martin's mudbus library.
I've made an HMI on Proview to test some LEDs, just like on the tutorial, but for my case, instead of the Schneider Momentum PLC, I used an Arduino MEGA 2560 with W5100 Ethernet Shield R3.
The communication is fine, but what I encounter is strange: when the LEDs are ON on the Proview HMI, LEDs are just dimming on the breadboard. I decreased the resistance values from 325 ohms to 80 ohms and they're still dimming. I removed one LED and one resistor and I replaced them with a NPN transistor to drive a small DC motor, even without any resistor, the output from the Arduino isn't enough to power the transistor. However, with the same hardware setup, when tested on Arduino IDE, LEDs are shining bright, and the transistor is working fine.
So I'm wondering... why do I get lower output voltage and current when using Modbus TCP on Proview and why do I get higher when testing on Arduino IDE? Does it have something to do with the mudbus library? or anything else?

Any help greatly appreciated
/Maverick
Last Edit: 5 years 1 month ago by Maverick. Reason: to add more precision
The administrator has disabled public write access.

Modbus TCP with Arduino - Digital output problem 5 years 1 month ago #10192

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 85
  • Karma: 0
hi everyone,
sorry for the inconvenience, it appeared that i just made a mistake in the Arduino sketch (a lesson to prove that it's not always good to just blindly follow examples):

i've set up all the pinMode to INPUT, that's why it didn't work very well as i said.

so, just by setting all the pinMode to OUTPUT, the LEDs are shining bright and the transistor is working well to power the DC motor.

i hope this post would be useful to those who would encounter such problems, and those who are involved to using modbus TCP with Arduino

Best regards
/Maverick
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 7.531 seconds