Your post describes what happened only in general terms. Often, as the saying goes, "The devil is in the details." Whether you were wrong or not depends on exactly how much of a disturbance your "bending down to get the pen" caused. Was it a large pen, which fell to the floor, rolled and clattered under the desk in front of you, and forced you to crawl along in a "slithery" dance move, or was it a quick "down and up" which normally wouldn't even have been noticed, but the teacher accidentally saw it? That difference matters. You have only two choices about what to do next. One is to fight the detention by complaining to officials and getting your parents involved. If you have others who will back up your story, you might get excused, but if not, you'll probably end up in detention despite your effort. The other choice is to save yourself the time, work, and aggravation of arguing, attend the detention, remind yourself that sometimes things aren't fair, and put it behind you as quickly as you can. This is probably the wiser choice.