Hi! This is my first post on the forums, and I'm excited to meet everyone!

I'm trying to design a "remote control" ultrasonic power switch. Basically, from across the room you can hit the circuit (an ultrasonic receiver and some other components which I need your help with) with 40kHz, and it turns on power to a circuit and keeps it on. Then, later on, if the circuit is on, and you hit it with 40kHz again, it'll turn the circuit off.

I was thinking of having the ultrasonic receiver connected to an op amp to boost the minimal signal it'll receive, then have that connected to a comparitor to set a logic level to high when there is power hitting the ultrasonic receiver, then having the comparitor connected to a flip-flop or something like that to latch the power on. Am I thinking in the right direction? Basically the power needs to latch on once it's hit with the first ultrasonic signal, and then latch off if it's hit again sometime later on...and obviously I don't want the circuit to turn on and off 100 times if I continuously hit the ultrasonic receiver with signal for like 10 seconds.

Any ideas / circuit diagrams would be greatly appreciated as I'm not really familiar with how to use flip-flops or comparitors; it's just what my teacher suggested!