So our school project is to create a LED light to city streets that can basically turn on when its dark outside, so dark city streets could be lit up at night. But the hard part about it is, that this LED light would in this case be turned on the whole night when its dark. But is it possible to make the photo resistor only turn the light on to about 20% brightness when its dark outside, and then add a motion sensor, that can turn the brightness to maybe around 100% when people is walking by?
I've tried to play with the website circuito.io and created what you can see on this picture. I've also already got some feedback on reddit, explaining how the mosfet may be overkill for this build and a simple transistor maybe could do the job, but i think my biggest problem is the coding. I can find a lot of previous builds using either buttons or potentiometers to turn the brightness up and down, but cant really figure out how to do the dimming purely software based, and determined by the sensors in the build.
Really hope you guys can help me 
Where does the ultrasound ranger come into the picture?
What code have you tried?
What did it do that you didn't want, and what didn't it do that you did want?
Hi mate,
Welcome to the forum.
Yes it is possible, using the ultrasonic as your range sensor.
What code do you have at the moment?
Tom... 
I think that we need to see a data sheet or the part number of the LED strip and the transistor, too.
groundFungus:
I think that we need to see a data sheet or the part number of the LED strip and the transistor, too.
Oh yeah of course. The whole list of products used is right here. It is all generated by curcito.io.
TomGeorge:
Hi mate,
Welcome to the forum.
Yes it is possible, using the ultrasonic as your range sensor.
What code do you have at the moment?
Tom... 
Hi, thanks!
I'm actually totally new to this arduino hardware and software universe. My starting idea was from this post:
https://create.arduino.cc/projecthub/achraf-oukheir/automatic-brightness-sensor-856b62
But this code is without the function to dim the light at different scenarios. So that i want the light to turn on dimmed at 20% when it gets dark, but to turn to full brightness when someone walks by the range sensor.
My brother created this simulation with only the ultrasonic distance sensor:
Hi,
Forget simulators, get coding and use the controller.
Have you got any code working that at least fades the LEDS.
Don't try to do anymore than that, get it working.
Then some code JUST to get distance readings from the ultrasonics.
When you have done that, then you can combine and modify your code.
Programming a huge block of code will not make things easy.
Tom... 
TomGeorge:
Hi,
Forget simulators, get coding and use the controller.
Have you got any code working that at least fades the LEDS.
Don't try to do anymore than that, get it working.
Then some code JUST to get distance readings from the ultrasonics.
When you have done that, then you can combine and modify your code.
Programming a huge block of code will not make things easy.
Tom... 
Oh okay!
I have actually not bought any of the stuff or the Arduino yet, because i wasnt exactly sure what parts to get. But as this project is school funded im just thinking about buying all the things in this list and then just work my way out from there.
(except the LED strip, because thats expensive)
Thanks for the advice, i will try to work my way into getting the LEDS to fade, once i get my hands one the things straight away.
- Jacob

jacobrc:
(except the LED strip, because thats expensive)
LED strips should be cheap... a few USD per meter, no more. Depending on the type/colour/number of LEDs. Just got myself some very bright 20W, 1m long, white strips on aluminium backing in nice casing for the equivalent of USD 3 per piece, from a retail shop. Online should be a bit less.
Make sure you have a power supply that's suitable for your LED strip - correct voltage, sufficient current supply.
You're going to need some kind of transistor to control those LEDs - a MOSFET is good, do make sure it's logic level - popular ones in TO220 package include IRL540 and IRLZ44N.