Unlike older models which either had an external thermal sensor glued on or leveraged the HD's makers manufactures diagnostic sensor they had started to put inside the drives. Apple contracted them to modify the drives so the sensor could be accessed via the SATA connection.
This makes it harder to put in just any drive as you need to replace the missing sensor externally. Here is a special adapter cable you'll need: OWC In-line Digital Thermal Sensor for iMac 2011 Hard Drive Upgrade if you use a drive that does not have the correct firmware.
For a few dollars more I would recommend going with a SSHD hybrid drive or if you can do it put in a second drive which in this case would be a SSD as well as replace your current HD with a standard HD. That way you can create a Fusion drive set gaining more performance.
Here's the IFIXIT guide to replace your current HD: iMac Intel 27" EMC 2429 Hard Drive Replacement
And here is the dual drive IFIXIT guide if you decide to take it up a notch: Installing iMac Intel 27" EMC 2429 Dual Hard Drive Kit. Remember here we are putting in a SSD here.