
The author made this build pretty simple to do, the arduino controls some LEDS and a speaker, and gets input from what I think is an IR distance sensor, but I bet this could be adapted to Ultrasound. Once someone gets really close, it says “boo”.
https://www.instructables.com/Interactive-Jack-o-lantern-sees-You-Taunts-and-Cha/