If the input is HIGH - the LAMP is ONIf the input is LOW, the LAMP is OFF (or blown!)
@wvmarleSo that way I don't even need that voltage divider circuit for each lamp, with just 1 diode (1N4148) per lamp I can do it? You've just put it waaaay simpler that I was thinking.Meanwhile you posted another answer, so now you are saying that I replace that diode in the schematic with a 100k resistor?
Post #5 (left side diagram) plus Post #7 - both our brains combined == the best solution, but make sure to follow wvmarle's thoughts completely - or you'll smoke the Arduino.The 100K resistor is *really* important!
Yes - can do. The Arduino's processor's pins have clamping diodes to keep the input voltage under control (that's why you have to stay between +5.5V and -0.5V normally). These actually can be used in the exact way as I described - this is even written in the data sheet - to keep the voltage under control, as long as you keep the current under control with a resistor.This works as long as you can be sure that your 24V doesn't have spikes or so, like in automotive applications. I'm assuming a nice clean 24V supply here. Lamps are also nice and clean almost purely resistive loads (incandescents are really just resistors, but also LEDs), so no problems there either. If these assumptions are wrong you have to let us know, as my very simple circuits are not suitable for all situations.
Use the LEFT diagram...The bulb itself is what replaces the PULLUP.The reason is as noted above - If the input is HIGH - the LAMP is ONIf the input is LOW, the LAMP is OFF (or blown!)The 100K resistor is *really* important!In theory, you could use an input to sense the 'driving signal', and if that is ON, but the bulb is OFF - the globe is dead - as explained above.