DC current limiter circuit

good day

I want to construct a current limiting circuit, I want to have a 12V power supply, arduno uno, a bulb as a project load, a keypad for inputting a maximum current value or a current setpoint, a lcd for display and mosfet for pwm control. I am not sure how to do this. Can you please assist me with a starting point, similar projects examples. or circuit diagram examples.

thank you in advance

Maxim has a nice app note on this. Current-Limit Switch Is Digitally Program - Maxim Integrated This will give you a start on the hardware, and it uses a digital pot.

You can’t have a 12V constant current supply. You can have a constant current supply capable of a maximum output of 12V, but basically the voltage get turned up until the current hits its set limit.

There is sort-of a philosophical difference between "current limiting" and "constant current" (or "controlled current").

Current limiting is typically used in place of a fuse so if you short or overload your power supply it temporarily shuts-down or the voltage "folds back" to protect the power supply.

Constant current/controlled current is typically used to drive LEDs with a known-current. If you disconnect the load from a constant-current power supply the voltage jumps-up to its maximum as it tries to push current through infinite resistance.

Some bench/lab power supplies have an adjustable current limit so they can be used as a variable current source but it's mainly to protect the circuit (and to protect the power supply when set to maximum).

If you want to dim a regular incandescent light bulb you typically reduce the DC voltage, "PWM" the DC voltage, or "chop" the AC waveform.

If you want to dim an LED you can use PWM or you can use a controlled current power supply.

True ...... for 'ideal' circuits .... constant voltage and constant current really mean just that. Constant.

For practical circuits .... constant voltage or constant current means that the source attempts to make the voltage approach (if possible) a desired target voltage and/or current. So movement .... dynamics will be involved. So not dead-set constant or fixed for practical (non-ideal) circuits.

Breadboard each of the requirements alone (i.e. read keypad and send the value to Serial; read value from Serial and show it on the display). When you have it working start adding parts together (read keypad and show it on LCD).

EDIT: I have deleted this and reposted due to a brain fart. Sorry

http://www.skillbank.co.uk/psu/current1.htm

You can use a current shunt or current sense resistor in series with your load with one end connected to GND and read the voltage across it,
amplify it with an op amp , and read the amplified
signal with the arduino and use that to calculate
the PWM duty cycle. It's straight forward and often done.