ULN2003 and Optocoupler : Your Suggestions - advises

Hi to all

i have this pcb with these connection

Description :
When you press one of the buttons the micro-controller do one function and while doing it keeps the led of the button on .
After finish this function you can press an other button to do something else with the same attribute (keeping the led of the button on)

My project : i would like to remove the buttons and replace it with an arduino

i am thinking to use an ULN2003 darlinghton transistor and some optocouplers like this one :

the optocouplers will be in order the Arduino can read when the main pcb stops the function

( the pcb after the press of the button if starts the function then keeps the input low to )

any suggestions ? is there an other way to do what i want or this method is the most appropriate ?

Disclaimer : i am not an electronics expert, just like to make projects play and learn through my mistakes and difficulties

Thanks in Advance

1 Like

Makes sense to me, I would give it a try.

Your circuit diagram looks incomplete till wrong to me.
Which controller supports 24V on its inputs or outputs?
Which LED survives 24V without a current limiting resistor?
You don't want visible LED feedback in your modified circuit?

Thanks for using Fritzing in a meaningful way :slight_smile:

The buttons are Tactile Switches on a small pcbs with terminals for the connections and leds, resistors so that is why can handle 24v but as my problem was not these switches i avoid the reverse engineering to embedded in my schematic

Maybe it is not clear from the picture but when i was referring to the controller with the inputs i was referring to a pcb that has the controller... so the pcb has lot of embedded electronics to handle the inputs

No i dont want visible leds as a feedback as i am thinking to use a small screen printing the state of the function

thanks both for the replies :slight_smile:

I will take a SWAG: The schematic is not complete nor annotated, it is missing the buttons. Input_01 is not correct it is in three different circuits. Since the Nano turns on the ULN2004 that drives an OptoCoupler that tells the Arduino the signal is active is confusing. The Arduino knows what it turns on and off, just save it as a variable. If the inputs are the switches you can eliminate the ULN2003 unless the inputs also need feedback.

The signal is essential for the external hardware. Without that requirement there were no reason for 24V compatibility.

Yes I had made a mistake when I was copying the label part of the input in the program, forget to change the names to "input_02" etc

Annotation was not necessary in my opinion as I was asking as general opinion guidelines if my thinking was in the right way.

I haven't calculate the resistors values as I didn't know yet if my schematic (connections) was ok

About the optocouplers as I told in my post the main pcb with the inputs (it is not my pcb, it is from a company) when the controller takes an input and is available to do the function then keeps the input low and so the led indicator in the button is always switched on.

So This feedback is critical to the operator to know if the controller has accepted the input and if is is doing anything.

With your proposal to use just a variable to check if it is on or off the pin that gave the command to the controller I could check only the part of the arduino... Never was sure if the main controller accepted the command and if it is working on it

I wanted to keep my connections as simple as I can and that is the reason that haven't try to find a way to make my arduino communicate with the main controller directly...

Here is a more detailed description of the machine i want to control as it was asked

As i told before the main board is not mine so i dont know why they are using a 24v signal as an input for the selection switches
The Board has lot of connectors but are not used all in this application

The machine is some type of industrial mixer (i dont have picture as i am out of town at the moment).
the mixer has a motor to mix (obviously)
The mixer works only if the top lid is closed and locked (has some switches to monitor the lid position and lock that goes to the Main board and i Don't want to mess with them for safety reasons )
the mixer has also some sensors for the level of the container, temp sensor and some other staff that dont know what they are for.

The mixer has 3 buttons of mixer program routines.

As you cant see with the lid closed if the mixer is working and in what routine is working i suppose that is why the have led indicators in the buttons to light if the selection is made and working on that

i want with the Arduino to control the routine functions from a distance (in the same building) without the need to connect so many cables - new lines

i will copy that and to the forum also

here is an old picture i had from the board when i had to remove it to replace a burned bridge rectifier

You can use some home control equipment with a device (slave) controlling MCU and a detached command MCU.

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