As a sequence to the project, if I want to read the signal in a computer that is 10 meters away from the arduino (wifi or ethernet), in an interface that shows the bulbs and if they are ON or OFF.
I'm expecting you need the right-hand diagram (switch wired high side, but that's maybe less important with 24VDC than 240VAC) but it depends on the actual wiring. In the case of the right-hand diagram the bulb would act as pull-down when the switch is open.And for the fun of it I started to think on how you could sense whether the bulb is broken. This can be done with a network of resistors and two diodes:This can be sensed with an analog pin. I didn't try to optimise values, these should work fine.Lamp good, switch open: current via R18 and lamp+D2+R20, then R19 to ground. Output 4V.Lamp good, switch closed: current via lamp+D2+R20 and R18, then R19 and R21+D4 to GND. Output 1.1V.Lamp broken, switch open: current via R22+R20 and R18, then R19 and to GND. Output 3.5V.Lamp broken, switch closed: current via R22+R20 and R18, then R19 and R21+D4 to GND. Output 1.9V.
WiFi is easiest, use an ESP8266 based board such as the NodeMCU or WeMOS mini. Then you run a web server on your PC, to which you send the status as http POST.Note that you can't use a resistor network as shown here on either... the ESP8266's ADC is 0-1V, so both these development boards add a voltage divider to bring this to 0-3.3V. That voltage divider messes up the voltage coming out of this network.
It seems you're going to need either an Arduino (the Pro Micro has 8 analog pins available) with separate ESP-01 module or so for the network connection, or an ESP based board with ADC expansion board (like 2x ADS1115 connecting over I2C). The second will be easier to implement.
Also note that you have to change the resistor values of the network, as the ESP8266's ADC goes from 0-1V, and as said the development boards add their own voltage divider which makes the whole thing a bit more complex. Hence the external ADC. You'll anyway have to change the values in the resistor network that I suggested, as you have to go to <3.3V outputs.
You can use the same approach as the Arduino: use a big enough resistor (100k at least) to connect the switching side of the switch directly to one of the NodeMCU's digital pins, or use a diode and the internal pull-up method. Both will work just fine. The ESP8266 also has these clamping diodes.Of note: some pins of the ESP8266 have special function in the boot process (0, 2 and 15 specifically - you have to check to which Dxx they're mapped) and are best avoided unless you know what you're doing.. Pin 1 and 3 are TX and RX which can be used but are also used to program the thing, and you may want to use them for debugging. That leaves you with 4, 5, 11, 12, 13 and 14 that can be used without issues.
Correct. So just add a port expander. An MCP23008 or PCF8574 to add 8 ports, or an MCP23017 or PCF8575 for 16 more ports, or use shift registers.
Do also read this ESP beginner's guide with lots of useful info on this processor. It is very similar in many respects to the Arduino but does have some important differences, especially due to the WiFi parts.