The proper definition of otaku, when written properly with kanji (お宅) is actually house. As Metro already mentioned, the slang meaning of the word refers to a person who is so obsessed with something that they would stay in their house all day in order to do it. The word doesn't imply anything to do with anime, it can refer to an obsession with anything, but even in Japan when somebody mentions otaku, unless there's some context to suggest otherwise, it's usually assumed that they're referring to the otaku who spend all their time watching anime, reading manga, watching hentai, and for whom Akihabara is the physical incarnation of heaven on earth.
You can be an otaku of something else too, of course. For example, some guy who was so obsessed with trains that he dedicated his life to visiting every single railway station in Japan (seriously) would be referred to as an otaku.
I don't think it has quite the same meaning as nerd, either. IMO it's a lot stronger (Someone who simply knows a bit about old movies or something could be described as a film nerd or something, even if they're not obsessed), and otaku does have a pretty negative connotation, whereas nerd doesn't, really.
It'd be fairly accurate to call me an anime nerd, because I have an interest in, and know a lot more than most people about, anime - but I'm nowhere near otaku level.