I have modify the ATX power supply unit from my old PC. That are 12V, 5V output, total over 20A. But my ATtiny PCB board only have 3 items: 3W LED, PIR sensor, BC337 transistor.
I plug my board to power supply, after about 5 mins, it got quite hot. ( I did not measure the temperature, but I think there is ~45 C @ ATtiny surface.
I think too much current input to the board, how can I limit the current. I think the PCB need about 120-200mA is enough, included the further items which are not presented now.
You do not limit the current. The device draws (consumes) whatever current it requires and if your components are overheating you are either have one or more of the following conditions :-
a) feeding the circuit with too high a voltage
b) applying a load that exceeds the design of the control components
c) you have a wiring error
There are BC337 NPN transistor between MCU & 3W LED
If the Arduino is getting hot, something is wired wrong.
Is there a resistor between the transistor base and the Arduino? The base-emitter junction is effectively a diode and if it's not current limited, you'll draw excess current from the ATmega chip, possibly damaging it.
Of course the LED is also a diode and must be current-limited. Normally, a special constant-current switching supply is used for LEDs of 1W or more. With "regular" LEDs you can use a resistor, but that's not efficient with high-power LEDs and you'd need at least a 5W resistor because the resistor will get HOT!
DVDdoug told you about two resistors (resistor for transistor base and resistor for led current limiting). Do you see those resistors in your schematics?
BTW, if you power an 3W LED, even a blue or white one with 3.2V forward current, from 5V, something (either the current limiting resistor or the transistor in an opamp based CC supply) will have to dissipate almost 2W. Keep that in mind.
An alternative would be a switching CC supply. In my experience, those are better bought. Meanwell has the LDD series, but for a single 3W led they are overpowered. I am sure someone can point you to an IC.