Some ideas for a domestic antitheft system... and probably more.

Hi Dario.

On my side it will not require a regulator at all, the inlet power will be 12V or 24V that is basically yet stable, so it could power directly the relays' coil via the transitor. So, you will have a direct input at 12 or 24V connected on the transistor collector.

That's what I was thinking too. So we have the same opinion. Ok. I'll do like that!

I'm really happy that you decided to move on higher voltages, because a long line with 5V supply may result in excessive drop of voltage over the line

You're right. I've really appreciated your feedback. That's what I was searching from this discussion on the forum. Thanks!

Just a quick update about libraries. I wrote a library that abstracts to the input/output pins and relays and seems working fine. It's able to use some hardware feature built in the SPI expander (like enable/disable the pull-up for each input, reverse the polarity, read the "onchange" event and so on). I'm satisfied about that.
I've added also an abstraction layer for the RS485, trying to automagically generate the Tx enable with no user intervention. This last feature, unfortunately, is not completed. I've found some limitations on the arduino serial core library code that prevents the possibility to easily inherit from the serial class in order to auto generate the Tx signal. Actually I've a working set of functions (like, for example, the write(string)) but not all.. For example the writeln and write(float) is not working as expected. I know what's the problem but I'm not able to fix it without changing the arduino core library (and I don't want to do that).
I've found other users in the forum with the same problem. I'll investigate a little more when I'll have time.

I'm actually too busy in other projects so I've to stop the library development for some time.

Ciao!
Marco.