1. K-State home
  2. »Physics
  3. »REU
  4. »2022
  5. »Koby Harding

Department of Physics

Physics Department
116 Cardwell Hall
1228 N. Martin Luther King Jr. Drive
Manhattan, KS 66506-2601

785-532-6806 Fax


Koby Harding, Kansas State University, Physics Major
Mentored by Dr. Cosmin Blaga
What is piNet?

PiNet is a network of raspberry pi microcomputers aimed at managing a broad variety of tasks at K State's James R. Macdonald Laboratory. This network targets tasks which involve physical contact with laser systems or other potentially hazardous environments. For instance, as changing ambient temperature and humidity cause the path of a laser beam to drift slightly, experimenters must compensate by turning fine adjustment knobs on a mirror mount. By automating this and other processes, piNet would both restrict the necessity for physical interaction with lasers as well as allow experimenters to manage data acquisition overnight or remotely from anywhere with internet. In addition, piNet is equip with sensors which relay information about various conditions in the lab.

External Structure

PiNet consists of a few raspberry pi's powered through and connected via a "power over ethernet" switch. Each pi hosts its own local webserver, accessible only to devices connected to this wired connection. For example, one raspberry pi collects and stores temperature, humidity, and pressure data each minute, as well as an image of a sample of the beam profile. The pi then hosts a website that neatly displays all this information, as well as some graphs created using these data. Other pi's complete tasks such as the beam adjustment described above, toggling of beam blocks, listening for alarms, etc. One 'central' raspberry pi then connects to all of the local websites hosted from each of the individual pi's, and displays all of these data on a single page for convince. This page is still local (only accessible to devices connected to the wired network,) and from it, experimenters can observe and control many parts of many different laser systems in JRM Lab. A public page is also created, accessible over wireless internet, which mealy displays information. The structure is designed with safety in mind such that only authorized personally can manipulate parts of piNet, but also so that the data gathered is visible from anywhere.

Fig 1

Fig. 1. Window view of one local website.

Fig 2

Fig. 2. Beam profile (top left) Beam locator (top right) 3d beam plot (bottom)
Internal Structure

The code at the heart of piNet is all written in python3.7, but HTML, CSS, and JavaScript are also used to format the webpages. The servers are hosted using Flask, and the data is stored using SQLite. The information on the central site is gathered via 'web scraping' and parsing methods facilitated by Requests, Regular Expressions, and Beautiful Soup. The data are manipulated using Matplotlib, Scikit-Image, Astropy, and Scipy. 


As a student of K State, I began work on piNet before my involvement with REU, and will continue working on the project after the program is over. By virtue of the modular nature of this project, piNet will never really be 'complete,' but rather will simply be adjusted over time to fit the needs of experimenters. With this in mind, I've tried to make my code as readable and as robust as I can manage given my genuinely absolute lack of coding experience prior to this project. I'm about to enter my sophomore year, and as such this project will likely be mostly in my hands for the next few years. By the time I leave, I hope that piNet is integrated well enough and is useful enough to justify its continued use after I'm gone.


I'd like to express my enormous gratitude toward my mentor Cosmin Blaga, who facilitated this opportunity for me. I'd like to acknowledge Eric Mullens, a grad student in Cosmin's group who worked extensively with me any my lack of coding experience. I'd also like to mention Pavan Muddukrishna and Sajed Hosseini-Zavareh, two grad students in Cosmin's group who helped answer my questions when Eric wasn't available. Lastly, I'd like to recognize Kim Coy, Bret Flanders, and Loren Greenman, who put enormous effort into organizing this program.

Final Presentation

National Science Foundation

This program is funded by the National Science Foundation through grant number PHY-1757778. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.