The latest iMacs use the sensors inside the HD itself. If you fit a different model or make the sensor can't be read and the fans go on full speed. From 2009 on Apple used the internal sensors. You could still work around the problem by using the exact same model of HD. This year (2011) things got much worse - Apple uses HDs with a proprearitary firmware that uses 7 instead of 4 pins (they actually use non standart SATA connectors) on the SATA bus for themp reading. You therefor can only use Apple branded drives for a premium pricetag. More information here.
Shame on Apple - lets work on a solution!
Here's an excellent article on upgrading your 2009. It also has links to compatible drives: http://www.everymac.com/systems/apple/im...
The problem with changing drives is the thermal sensor. If you stay with the same "brand" of drive there should be no problem. If you change brands, you will need to change to that companies sensor. As far as I know there are three different ones, the Western Digital 922-9225, the Seagate 922-9224 and the Hitachi 922-9223
Yours definitely have the proprietary HDD sensor if it goes crazy like this
There are a few fixes that do not involve using compatible or flashed drives to work
Look for SMART control software that is free and install that, and have it run at startup or if it gives you the option to run at startup, use it and see if that works
I have also heard the sensor is part of the power cable, matching the part number for the right cable, this has been reported to work with friends who tried it
These are general tips, but the year the mac is made will also play a major role in their effectiveness
As per age of each mac, the 2009 ones are the easiest to tame ones, SMART control software works on them, and the power cord swap may work too and is more likely, and matching drive brands could work as well, and drive brand matching too
2010 ones are something I am not entirley sure about, if I figure it out, I'll update this
2011 is probably hopeless but the power cord swap and SMART software, these are the worst ones due the HDD power connector on the drive, if this fails to fix it, game over
As to places where to get compatible drives, OWC sells some, I have been told they are compatible in some way, but cannot verify this as I own a MacBook Pro, but they do sell Apple ROM ones too and have been told these work, just be sure to get a seagate or WD and match the brand to be safe
OWC has a upgrade program for these Macs, but this is only for the 2010/2011 ones, these are 21.5 and 27''
This is all I know about this issue with the drives
Here is a OWC blog post if you want to read it