Is my select of resistor ok for PN2222A base?

It was for render the idea.

In English those words mean nothing.

Sensor take voltage totally disconneted from the atmega

That is not possible, it will not work without a common ground.