Including my institution in a research paper Consider this scenario:


I am a student. I ask my professor about possible research grants. He suggests applying for a research grant with 3D printing. He helps me brainstorm and incubate in idea. 
I start doing research, get a proof-of-concept, submit the proposal. While waiting for the decision, he suggests I present at my university's research conference. 
I register for the conference, include my professor as the advisor and give the presentation.
Get a good amount of my research done. My proposal was rejected unfortunately. I still did a tremendous amount of work, so I am going to write up a formal paper on my findings. 


So the question: Is it appropriate to include my university as my affiliation in the paper? This is my first research paper, so I don't quite know the best practices on this. I should credit my professor. He really helped me to shape my idea and gave me a lot of advice. However, he did not have a formal role in the research. 

I did do my work in the school's hardware lab. My professor did help me a lot in giving me advice. However, the tools, materials and 3D printer were all mine and it was all done on my own time. 

So I'm writing this paper up, and wondering whether I should include my title using something like the following template:

3D Printing Stuff Title 
John Smith
Advisor: Hubert Farnsworth
Department of Quantum Neutrino Fields
Mars University
fry@mars.edu
As a student, your research affiliation is the university --- the professor is beside the point.  You should list your affiliation as:


  Your Name
  [optional: your department]
  University Name
  [optional: university street address]
  City, Region, Nation
  email address and/or other contact information


The degree of detail requested depends on the requirements of the venue where you are publishing: the critical part is name, institution, city/nation, and durable contact information for you (since people may try to find you five or 10 years later).

Credit to your professor will likely be as a co-author: talk to your professor,
as the answer will depend on the degree of involvement and the conventions of the community you are submitting to---computer science 3D printing and biology 3D printing are very different.  If your professor is not a co-author, they should be recognized in your acknowledgements section instead.