ACRL TechConnect

From Python to Raspberry Pi

Celebrating Pi Day with data science

Ariel Deardorff is data services librarian, email: ariel.deardorff@ucsf.edu, and Dylan Romero is Makers Lab manager, email: dylan.romero@ucsf.edu, at the University of California-San Francisco

The University of California-San Francisco (UCSF) Library is a graduate-only health science university with four professional schools (medicine, pharmacy, nursing, and dentistry), a graduate division, and an academic medical center. For several years UCSF has been the number one public recipient of NIH funding, reflecting the school’s dedication to biomedical research. Around 2015, the UCSF Library began investigating new ways to serve the university’s research population. Seeing a need for more computational and entrepreneurship training the library piloted two new programs: the Data Science Initiative (DSI) and the Makers Lab.

The UCSF Library DSI began in 2016 as a way to address a lack of computational training opportunities on campus. The broader mission of DSI is to teach computational and data skills to UCSF students, faculty, and staff to improve health. In practice this means that the DSI team of four teaches classes and offers consultations on programming (in R, Python, Unix, and SQL), data visualization, data management, machine learning, statistics, and bioinformatics. The majority of DSI classes are targeted toward beginners, and aim to get researchers and research staff up and running with the skills they need to harness large biomedical datasets and manage their research in a reproducible manner. As of August 2018, approximately 1,700 UCSF community members had participated in a DSI class.

The UCSF Library Makers Lab began as a series of pop-up workshops in 2015 and has expanded to a vibrant space within the library. The Makers Lab encourages the UCSF community to unleash its natural creativity by learning how to 3-D print, make a button, try a knitting project, or tinker with an Arduino. Staffed by library volunteers, as well as staff from across UCSF, the Makers Lab is open Monday through Friday from 10 a. m. to 6 p.m., and hosts a variety of pop-up workshops and activities throughout the month. UCSF community members can bring personal or work-related projects to the Makers Lab with the idea that the projects will help students, faculty, and staff be better prepared to address health science challenges in novel and creative ways.

The DSI and Makers Lab are natural partners as they both focus on building skills around visualization, programming, and electronics. While many members of DSI volunteer in the Makers Lab, they wanted a chance to showcase the overlap in their two areas of expertise and formally collaborate on a community event. Given its emphasis on math and computation, Pi Day (March 14, so named because the numbers 3/14 resemble the first three digits of pi) seemed like an excellent opportunity for the two teams to work together. Drawing inspiration from the Pi Day events organized in part by Lisa Federer at the NIH Library,1 the teams decided to collaborate on two Pi Day events in March 2017 and 2018.

The 2017 and 2018 Pi Day festivities had two major goals: to introduce the UCSF community to the computational resources (chiefly coding courses and programmable electronics) available through the DSI and Makers Lab, and to build community and create opportunities for interprofessional education. A third internal goal of the collaboration was to give library staff members a chance to collaborate and improve their own programming skills.

The 2017 workshop

The 2017 Pi Day event was designed to be a fun, interactive workshop to introduce UCSF community members to the concept of programming in Python (a programming language popular in the sciences), using a Raspberry Pi (a tiny, $40 programmable computer), and introducing them to the resources available to learn more about these tools.

Social post highlighting the Pi Day 2017 event.

Social post highlighting the Pi Day 2017 event.

Like most events held in the Makers Lab there were no prerequisites. Instead the event was marketed as a chance to learn and explore new tools in a welcoming environment. The teams hoped that the event would bring together people from across the university and give them a chance to experience the Makers Lab.

The workshop was held from 11:30 a.m. to 1 p.m. in the Makers Lab, which limited the number of attendees to approximately 20 people. In preparation for the event, the lab staff set up six Raspberry Pi devices with computer monitors and keyboards.

The event started with a quick introduction to Raspberry Pi and Python, as well as an overview of the two library programs. The introduction was followed by a brief demo from a UCSF researcher who described how she used the Raspberry Pi in her own research (to track optical mice movements), as well as for fun (as an automatic garage door opener).

Next, workshop participants broke into groups of three around each of the workstations, and a DSI staff member led the group through a basic Python script that would access temperature data from the Raspberry Pi (which has a built-in temperature sensor) and output a basic graph.2 Working together, and with assistance from DSI staff, the teams were able to type out the code and see the resulting graph.

During the last part of the activity, a staff member walked around with a hair dryer to watch how temperature change impacted the graph output. After the activity concluded, attendees moved into an adjoining room for refreshments (pizza and pie, of course), as well as a pi recital—a contest to see who could recite the most digits of pi.

The 2017 Pi Day event was considered a success. There were 20 attendees, the majority of whom were beginners in both Python and Raspberry Pi, the perfect target audience. Even given their lack of experience, all the teams were able to complete and run the Python program by the end of the session and were able to produce a graph of the temperature change. Even more compelling from a community-building perspective, workshop attendees represented many different user groups (including nine staff members, six postdocs, three students, and one faculty member) and schools within the university (including each professional school and the graduate division). During the social portion of the event several participants entered the pi recital (the winner recited 23 digits!),3 and many stayed late to enjoy pizza, chat, and network.

The 2018 workshop

Given the success of the 2017 Pi Day event the DSI and Makers Lab decided to team up again for Pi Day 2018. For this second event the two teams wanted to focus on the use of programmable electronics—like Raspberry Pi and Arduinos (a programmable microcontroller)—in healthcare. Originally they envisioned a larger hackathon-style event where researchers could investigate potential healthcare applications for the programmable electronics in low resource settings. Unfortunately there wasn’t enough time to host this larger event, so instead the teams decided to try more of a showcase-style meetup, where researchers could try out biometric sensors and brainstorm potential health science applications.

Biomedical sensors attached to the Arduinos from the 2018 workshop.

Biomedical sensors attached to the Arduinos from the 2018 workshop.

This version of Pi Day required more advance planning as the DSI and Makers Lab teams needed to source a handful of biometric sensors, learn how to attach them to the Raspberry Pi/Arduinos, and find and run the code to operate them. Eventually the teams chose a heart rate sensor, fingerprint sensor, force sensor, and a motion sensor (see Appendix A for the sensors and code used).

The 2018 Pi Day event was also hosted in the Makers Lab, so once again space was limited to approximately 20 people. To fit the more meetup-style vibe of this event, the time was changed to 4 to 6 p.m. To arrange the space, staff setup four workstations with the live sensors, as well as a table with spare electronics that people could borrow.

On Pi Day, after an introduction to the projects, attendees were invited to try out the sensors and brainstorm potential medical applications on whiteboards next to each station. After an hour of exploring, attendees were once again invited next door for another pi recital, pizza, and pie.

The 2018 Pi Day event had slightly fewer attendees at 16 people, but they once again reflected a wide range of users (including staff, postdocs, faculty, and students) and departments (including dentistry, medicine, pharmacy, and the graduate division). Engagement levels were high, as evidence by the number of suggestions that were written on the whiteboards. The Pi Recital was especially popular in 2018, even more so since the winner was able to recite 100 digits of pi.4


The Pi Day events of 2017 and 2018 were successful in engaging members of the UCSF community with the resources available through the Makers Lab and DSI. In 2017 attendees had a chance to gain hands-on exposure to Python and Raspberry Pi, and learn about the classes that the DSI and Makers Lab teach on those topics. In 2018 attendees tried out biomedical sensors and brainstormed how they might be used in the healthcare setting. Example ideas included using the fingerprint sensor as a lab security system, using the force sensor to measure pressure points in a patient’s bed, or as physical therapy for finger injuries. These ideas will inform the development of a hackathon style event tentatively scheduled for 2019.

As evidence of the high level of engagement, one attendee commented in the follow-up survey: “This was an amazing event—thank you! Really opened my eyes regarding how fast the hardware is evolving and how easy it is to write code to interact with sensors.”

Another key success of the events was that they brought together many different groups from across campus, including students, faculty, postdocs, and staff. One attendee noted this in their follow-up survey by sharing that, “This was a great opportunity to learn something completely out of my wheelhouse, and interact with others I’m unlikely otherwise to meet. I worked with someone from another campus . . . pretty neat.” Community building was especially evident during the pi recital and social part of each event as attendees networked and chatted over pizza and pie.

Finally, the events gave Makers Lab and DSI staff a chance to gain hands-on experience programming in Python, and using the programmable electronics. Before helping with Pi Day some of the team members had never used a Raspberry Pi or written a line of code. In the preparation for the first workshop, they were able to practice as a group so that they could act as helpers during the event.

In 2018 library team members were required to stretch their skills even more as the biomedical sensors were challenging to setup and run. Some of the sensors required additional soldering in order to attach them to the Arduinos, and others had errors in their code that needed to be fixed. By the day of the event the team members were able to talk in detail about their sensor project as they had spent considerable time getting it up and running. This built confidence in library staff and increased their ability to advertise and advocate for DSI and Makers Lab classes. Additionally, DSI and Makers Lab staff were introduced to other low-cost programmable electronics through feedback from the event and follow-up research.

Soon after the Pi Day 2018 event, the Makers Lab purchased Arduino Trinkets, Arduino Shields, and small breadboards to better align our services and equipment with the needs of the health science community.

Given the positive results of the 2017 and 2018 Pi Day events, the UCSF Library will likely continue to hold similar events in the future. Potential ideas for next year include holding more of a hackathon-style event or moving the event outside the Makers Lab to open up the event to more attendees.

Appendix A: Biomedical Sensors and Code

Heart rate


  1. “The NIH Library Is Participating in NIH Pi Day | NIH Library,” accessed August 3, 2018, https://www.nihlibrary.nih.gov/about-us/news/nih-library-participating-nih-pi-day.
  2. “Temperature Log—Introduction | Raspberry Pi Projects,” accessed August 16, 2018, https://projects.raspberrypi.org/en/projects/temperature-log.
  3. “UCSF Library on Twitter: ‘#PiDay Contest Winner: Leslie Wu (@1wu) Who Recited 23 Digits in #pi for Our #piday2017 Event Today. Leslie Went Home w/ a @Raspberry_Pi Kit … Https://T.Co/LPKOzt2o97,’” accessed August 7, 2018, https://twitter.com/ucsf_library/status/841800973584494592.
  4. UCSF Library, “Mario a @UCSFGradDiv Student in Biomedical Sciences Was the Victor of the Day for Our #piday Recital Contest with a Whopping 100 Digits Recited! He Won a @Raspberry_Pi 0. High Five to All Who Participated Today!Pic.Twitter.Com/CpKZFfwB0D,” Tweet, @ucsf_library (blog), March 14, 2018, https://twitter.com/ucsf_library/status/974078909267427328.
Copyright Ariel Deardorff, Dylan Romero

Article Views (Last 12 Months)

No data available

Contact ACRL for article usage statistics from 2010-April 2017.

Article Views (By Year/Month)

January: 0
February: 0
March: 0
April: 0
May: 0
June: 0
July: 0
August: 0
September: 0
October: 0
November: 13
December: 235