how to increase the range of KY-005?
First, I think 40 mA to output from a GPIO is not a wise idea, because those are Arduino Pin Current Limitations.

What you can do is:


The VCC pin can handle 200 mA. So you can use this pin to power your KY-005 and use a transistor to switch it via a GPIO (much less than 40 mA is needed for that).
Or (high likely not needed): use an external power source and use a transistor in the same way.


For knowing all details about using a transistor this way, google for "transistor as switch".