Need help regarding kick back diode

Your mosfet has a nice high voltage rating, so I suspect a 560 ohm resistor will do the job nicely.

If you want to measure the energy recovered from the solenoid, this is how I would do it:

  • connect diode and resistor across solenoid

  • use an Arduino analog input pin to measure the voltage across the mosfet, using a voltage divider. For example, 1k from the pin to ground and 39K from the pin to mosfet drain.

  • write a program to turn on the mosfet, wait long enough for the current in the solenoid to reach maximum, capture the time using micros(), turn off the solenoid, do 100 or so analog reads of the pin (storing the data in an array), then capture the time again to see how much time has elapsed. Then send the data and the times to the serial port so you can read it on a PC.

Using that data, you can work out the voltage across the diode/resistor combination as a function of time. The instantaneous power is being fed to the resistor is (V^2)/R and you can integrate this to get the total energy dumped into the resistor. To get the total energy, you need to allow for the energy dumped in the solenoid's own internal resistance too.