daniel93 wrote: And wouldn't it be better to connect to the "pissing" system and make a piece of electronics on ATMega8 yourself?
Hello. Inspired by the quoted thought, I decided to solve this problem through exercises and self-education. Let me say at the outset that I am not an electronics engineer and therefore I am asking you to spare any critical comments about my professionalism.
I have an AirWick FreshMatic without a motion sensor. I allow myself to paste photos of my friend groovee (I have exactly the same model).

So...
Assumptions:
1.hand piss button;
2. motion / lighting sensor (new functionality), without blocking (1);
3. time trial;
So I started and after spending some time on the internet I wrote my first ATmega8 program. A test board for the above-mentioned processors was created on the way, etc. It all took a while. However...
Everything works as planned. Well, maybe almost ... well, my (un) electronic knowledge does not allow me to solve the motor control.
I tried with different npn transistors. Emitter to ground, collector to motor, base through 10k resistor to ATmega8 port (PB0). But unfortunately the engine does not have the strength to push the dispenser to spray. The power supply is 5V - workshop conditions, but ultimately it will be 3V. The motor connected directly to these 3V / 5V works without any problems. I tried different values of the resistor on the base but it did not work.
I think the devil is in choosing the right transistor. I read on the forum about motor control with uP, but they are about to build some cosmically complicated circuits there, and I know that it can be done easily - there is only one transistor on the original board, marked Q1.
In addition, with the system in which I connected this motor, an unforeseen complication occurs, consisting in the fact that the whole system seems to be in a loop - a trick every now and then. At the same time, there is no regularity as to when this is done - the effect is once in, once out is gone. I think the reason for this may be the voltage drop in the system after turning on the engine.
That's it for the moment. I am waiting for suggestions and possible hints. Only in a very short way, please.
Of course, I will post the diagrams and the program code in my free time.