The only way to tell the drive to erase everything is to send the ATA Secure Erase command. This tells the controller to wipe the drive in a secure way. It is the only NIST-approved way to securely erase a drive. Lots of info from this discussion http://security.stackexchange.com/questions/5749/how-can-i-r...
But with modern drives you are not getting at the physical layout. The drive may detect an error and remap surrounding data for you. Consequently, some data surrounding some badblock(s) in the past will potentially never be overwritten by your process. Someone with separate hardware or an alternate firmware could always retrieve it.
I guess the right solution would be to store your data only in encrypted form on your drive. Then you will only have to worry about safely deleting the key.