Home Automation project

Greetings to all members of this forum,
I started a Home automation project in witch I want to automate my home to control lights etc… For my light control I designed a board with the ATtiny85 microcontroller, it is a simple board which comes in all wall switchs in the house because I want the lights to be controlled by the Arduino and the wall switch itself. See the attachment for the pictures. On he schematics I use Ne555 chip to represent the ATtiny85. Arduino is connected to pin 3, the wall switch to pin 2 and te solid state relay with the transistor to pin 5 witch controlls te lights. When the pin 2 changes the state or when pin 3 is high pin 2 goes high, simple. I know how to write the program and I understand electronics but I dont know witch transistor to use. NPN or Logic state and which? The Vcc on the scheatics is 5V and Vce on the transistor must be 5V. Because the board and the Arduino will be connected via a long wire (max 20m) should I put a lightning protection with some diodes? And do I need to improve something on the schematics?
Tnx…

ATtiny45-85.png

Several things are not clear in your approach:

What exactly is the purpose of the microcontroller?
If all you want is to remotely activate the digital pin and hence control the lights, why the need of the microcontroller? Simply wire that 'digital pin' to the relay directly.
Long lines are a problem in terms of capacitance as well possible surges and induced voltage.
Thats why you would normally send commands through a link that employes error detection as opposed to just activating a simple digital pin.
Consider an RS485 link which is tolerant to noisy environments.

The microconroler is there because I want to avoid using extra wires. I want the light to be controlled by the aduino and the wall switch (It's like having 2 wall switches for the same light only in my situation the other wall switch is the arduino). Without the microcontroller i have to connect a wire for driving the relay, for detect that the wall switch is pressed and power etc...

So witch transistor is the best for that job?

OK, you have specified an AQ1AD2 which has a very sensitive input and a quoted inherent input impedance of 1.6k. As such, it will only draw about 3 mA at 5V, so you do not need any transistor to control it from an Arduino or ATtiny85, just connect it directly to the output pin.

It is however, a DC switching SSR with a 1 A rating, so I do wonder what you are controlling with it.

I know see that i put the wrong ssr in the scheme, sorry. I will control it with a G3MB-202P with is a 2A AC ssr. It draws about 10 - 15 mA but i will put 3 in parallel because they are very small and only 2A each. And together they draw cca 40mA so i will need a transistor.

TheHeavyMan:
So witch transistor is the best for that job?

BC547, use base resistor 10k