Controlling AC light bulb intensity
This can easily be implemented using arduino (or some other micro-controller), an ultrasonic distance sensor, a triac (with proper opto-isolated driver such as MOC3021), a zero cross detection circuit made using another opto-isolator such as K814P and an incandescent bulb.

Read something about phase control. It's like a pwm for ac power source. You can use this optically isolated zero cross detection circuit:



This will give you a 100 Hz or 120 Hz signal depending upon where you live. This is one of the prime ingredients for phase control.

In order to drive the bulb, you will need a triac (electromechanical relay won't cut it). Here is a circuit that you can use:



When Triac1 pin is HIGH, TRIAC_LOAD1 gets connected to LIVE1. Other end of LOAD is directly connected to neutral so the load turns ON. However, it won't turn off as soon as you send the TRIAC1 pin LOW. Read more on triacs.

With this circuit and an arduino, you can make an incandescent bulb glow at different brightness levels (CFL and most LED bulbs won't work).

Now the last thing that remains is using your ultrasonic sensor to measure distance.

Once you know that, you can combine all these things to get the desired effect. As soon as you move towards the distance sensor, increase the brightness of the bulb using phase control.