McDonald and his friends came up with the concept for a Microsoft app competition but didn't win.
They went on to win $20,000 in software costs in a university competition, however.
McDonald wanted to design and make an interactive button that encouraged people to use the technology.
"This needed to almost have a pulling effect to make you want to press the button - it is where the interaction actually begins."
The 19-year-old went on to make a prototype at the university's makerspace where he worked part-time.
McDonald and other staff used a 3D printer and a laser cutter to make it - in just three hours.
He pitched the idea to the head librarian at Auckland Central, who he happened to know, and got the go-ahead to give the device a trial run.
The device takes a photograph of the user's face to determine their mood and links it to the time of day and the weather to choose a suitable book.
The Auckland Central Library have set up the device in their own makerspace and linked it to the library's basement collection.
McDonald said he was excited about the possibility of more interactive devices in public spaces.
"I'm really looking forward to the day when people can walk down Queen St and it's just a playground."