jhpark
environment : Arduino R3 IDE, openPLC 4.1
 
openPLC operation on my arduino look OK. But when I use 2 sets of leds, the led light becomes very weak, especially the green led.
Because of this problem, multiple leds were captured while operating in a dark room.
Under bright light, it is not easy to tell the green led is on.
 
Any solutions to fix this problem is appreciated. Does my functional block diagram make this trouble?
 
Thanks in advance,
 
John
 
openPLCproblem.jpg
Reply 0 0
thiagoralves
Hard to tell since you didn’t share any details about your circuit, power supply, logic or program.
Reply 0 0
jhpark
Thanks you very much for your time. I attach my FIRST openPLC coding.
 
PLCproblem.jpg
Reply 0 0
fg71
Why a LED drop in voltage is your power supply is not stable.
You need to make sure every LED have the same amount of voltage in simple terms voltage is the same if you use parallel connection.
You could use resistor to get 10mA that is enough to not use dark room.
Reply 0 0
jhpark
Why a LED drop in voltage is your power supply is not stable.
You need to make sure every LED have the same amount of voltage in simple terms voltage is the same if you use parallel connection.
You could use resistor to get 10mA that is enough to not use dark room.
I have supplied 1A external power to arduino uno R3. But the brightness has not changed at all. But my windows 11 driver was damaged while 2 other arduino roms are disabled. Those arduino ports are not recognized anymore. I have checked 5 volts output not to make a mistake. Because I have moved from my country's home with minimal items with me, I do not have many tools now. I need to recover (factory reset ?) those two boards. By running my openPLC on ubuntu did not change the brightness of leds. 1A power supplier was samsung old phone's adapter. Posivite 5 volt and ground was verified using my cheap tester. I found a term "PLC" from linkedin after arriving the US. This is the reason for making my first openPLC. 8-) Because my original area is not electronics, I did not bring soldering tools. When my coding is not right, I could see bright leds. But after correcting my errors, leds become dim.
Reply 0 0
thiagoralves
Most likely issue is not on OpenPLC or even your code. Things like that are more likely to be caused by bad circuitry. If you’re not familiar with electronics, you will need help from someone that is.
Reply 0 0
jhpark
I don't think I made a mistake in wiring. My 2nd GND is from analog GND, because I have no other tools except a tester. My wirings can be found from an attached image. Although I am new in openPLC and PLC, I have been writing C codes for over 40 years. This is my second arduino project. Recently, I have made a 210V (12V) toy car following righthand side of a blue lane using arduino with the help of AI and myself. You may find arduino uno R3 board under an ubuntu laptop. I took one circuit analysis class over 40 years ago, 8-) while my major is *general* engineering.
 
2way.jpgJH20251029_image.jpg
Reply 0 0
thiagoralves
With the same circuit, write your program in C using Arduino IDE. If the LEDs work as expected, then the problem is with your PLC project configuration/code. If it remains with the same problem, then the issue is with your circuit
Reply 0 0
fg71
Most LED have max current of 20mA, to be able to visual LED in state ON/OFF the current is enough to be 10mA.
If you use Arduino Uno you have 5V on the pin and for the LED you have around 1.8 - 2.2V
 
The calculation is: (5v - 2v) / 10mA = (5 - 2) / 0.010 = 300
 
You need to have register of 300 ohm
 
This is what I'm talking about, when you connect 3 LED you need to use parallel circuit there voltage do not change.
When each LED have it own register and use the same amount of ohm the current for each LED will be close to same.
This means all LED's you use in your circuit will have same brightness. You control the brightness of the LED with current not voltage.
Reply 0 0
FrederikYssing
You could use a meter and measure voltage and amperage and the value of the resistors inline with the LEDs.
If all fails, use transistors as drivers for the LEDs
Reply 0 0
Reply