how to put Atmega328 to sleep mode and wake it up without button,without WDT
Welcome to the forum. Your sensor does essentially the same as the button. What button does is:
pulled up line is shorted down to ground
OR
Pulled down line is connected up to HIGH
so your wake up on button simply feels the line changing up to down or down to up position. Your sensor does exactly the same. You only need to understand if the sensor pulls down or up when it's detecting. Then you connect it like a button and program it like for a button, because in terms of voltages they behave similarly. Again, you have to check if your sensor outputs &quot;active high&quot; (high voltage out for detection), for example, which I'm assuming now. If so, make a pulldown on its output and program interrupt on the rising edge. So your output line is always low, but when detection event occurs, the output of sensor becomes high and it wakes atmega up or does whatever your interrupt on rising edge does.
I assumed you have some most basic detector that output just detected or not detected at some range.
ADDITION (too long to comment):
I still lose your point sometimes, but as I see it, you need a sending circuit that will run independently from the MCU? I mean, the worst case thing you can always throw in a ATTINY85, it consumes close to nothing, especially if you sense not continuously, but, say, sleep 0.5s, wake up, sense, sleep. Because your hand will definitely cross that time interval. Or make it 0.2s or whatever. And ATTINY can control receiver too then, and then wake up the atmega from total shutdown (can even unpower it entirely via mosfet or just wake up via interrupt)? This will also save you battery, because attiny uses just so little, but lets you shut down atmega328 entirely.
Clock down attiny as well for extra low power