Motion Sensor LED

Ok first things first...

Does the sensor work properly? Are you seeing the inch and centimetre distance displaying when you open the serial monitor (ctrl shift M) ?

Second, there's nothing in your code that uses the sensor reading to do anything other than display it, far as I can see any road. So you will need to describe in words first, what you expect the value to mean in terms of the lights.

Your heading says "motion sensor", yet the sensor you have is a distance sensor; it does not detect motion. So you'll need to describe how you want that to work. Say a person comes within range of the sensor from out of rang, that would be "motion" I guess, so lights on? But then they stop... the sensor value will no longer change and your code would need to continually monitor for the value to change, and turn the lights off if it doesn't change for a few seconds?

That's quite tricky (ie non beginner) coding I'd say.

You might be better with a PIR sensor, which does detect motion.

Third: looks like a relay wired in there somehow: you'll need to provide a circuit diagram of how that's been done. Can't tell much from the photos :wink: