How to dimm the lights with microwave sensor connected to aruduino uno

Thank you in advance guys! :smiley:
Im working on a project. And i ran into some trouble. So please help!
The problem is that i want to dim the led light with pwm modulator connected with arduino uno.
I know. Use potentiometer. But i cant. I must not. And also i must not turn the LED light off.
What i want is that a microwave sensor which will i put into analog pin 0, dim the LED light
to 30 or 40 %. How can it be done . Please help.
If you want to know what im working on i will tell you if you promise you wont take my idea.
Its a major science project involving street lamps. A smart grid of LED lights.
That will be my science project, or final work to get an engeenering diploma.
It shall not be easy but with your help i could make it.
Thank you once again.

It sounds easy. You can use the map() function and maybe the constrain() function. Please post a link to your microwave sensor and post your sketch so far. Please read the forum guide to know how to post code and links correctly.

:slight_smile: thank you very much Paul. Now i know it is possible by using the right microwave sensor. I do not have any sketch nor did I chose a microwave sensor. Its still messy in my head. But thank you now I know it is possible. If you have any recomendations please do. You see i must use an arduino with gsm card in it to connect it to the network. And the lamp will have 130 Watts of power so i dont know how to put it all together yet.

Just a couple of things.

What do you suppose you would be doing with a potentiometer?

Why would you plug a microwave sensor into an analog input?

You need to locate each of the parts you are suggesting and post links to them before we can advise on how to use them and whether they indeed are the proper ones you should use.

I presume your intent is to dim the street lights until there are people present, and then bring them up to full intensity until the people pass by.

Yes Paul thats right! :smiley:
Its intented primarily for vehicles and vehicles that move on the road. This was invented in Denmark 2007, and here in Croatia is one team thats working on the same lets say project as me. Mine system will be operable in cities so its a new inovation. Thanks Paul for help and good will! :smiley:

Well, there are two ways of looking at this.

One is to use a microcontroller - such as an Arduino Pro Mini - to make the decisions and timing for this purpose. That has the advantage of flexibility - you can change the decision parameters.

The alternative is to simply connect the parts together. Most such microwave sensor modules have the "lag" timing built-in so that they will keep a light on for a defined interval after they were last tripped. And to provide the 30% PWM, you can use something as simple as a "555" timer. You then use a simple "OR" function of the PWM timer and the microwave sensor - if the latter is actuated, then the output is always on, otherwise you get the PWM for power saving.

The fixed logic has the advantage that it cannot suffer a code crash, though you can use the watchdog in the microcontroller to provide protections against that possibility.

The UNO is essentially for playing - unless you are using it with a "shield" designed for a specific purpose, the Nano if you want serial connectivity (including for frequent code updates) or Pro mini if you do not need that, are far more practical for "real world" designs.