I'm building a generator for a school project. I'm planning to use N42 neodymium magnets with performance of 5100 Gauss, How do I calculate what diameter of copper wire I need to make the coils and how do I determine the best number of turns for that particular set up?
This assumes you have an oscilloscope or a sensitive-enough AC voltmeter. Grab any old wire and wind one turn around the core. Don't worry if it's a bit messy. Spin the generator at the design speed and measure the voltage at coil (not after the rectifier, if you're using one). That's how many volts per turn you'll generate at that speed.
Now divide the voltage you need by that number, taking into account whatever losses you'll get from rectification, etc. That's how many turns you need.
Now estimate the area you have available to put those turns into. Divide your area by the number of turns you need. That's the area of the wire you have room for. Multiply it by 0.75 or 0.85 depending on how super-cool you think you are at winding.
Get a wire table (the ARRL handbook has one, there may be at least one on some forgotten corner of the Internet, somewhere). Find a wire size that has the area you need. Get some, and start winding.
And do not be upset if your calculations are way off the first time around -- that just means you're an engineer.