If you want to buy something from a new vending machine inside the entrance to a shopping center in the U.K. city of Nottingham, you can’t use cash. Everything inside is free–and only accessible to people who are homeless, who can use a key card to access fruit, sandwiches, energy bars, clean socks, toothbrushes, and other necessities.

“There is a critical need for access to food and clothing outside the capacity that shelters can offer,” Huzaifah Khaled, founder of Action Hunger, the nonprofit that installed the machine and is planning a series of others, writes in an email to Fast Company. In the U.K., as in many other countries, shelters often have very limited operating budgets and are only accessible for a small part of each day.

“It requires the homeless to schedule their days around visits to the shelter, making it hard to hold a stable job or see family regularly,” he says. “Our vending machines offer 24/7 access, so they can be used at a person’s convenience–and completely free of charge.”

Action Hunger partners with other homeless organizations to hand out the cards. In Nottingham, it worked with a group called The Friary, a day center for the homeless that has been in operation for 30 years. With a card, someone can access three items each day. But to continue using it, they need to check in each week at a partner organization. Khaled recognizes that the machines–like a related “Little Free Pantry” project in the U.S.–are only a temporary solution.

“The idea is that users don’t become dependent on the machines, and are working towards a long-term plan for getting off the streets,” Khaled says. “I want our low-cost vending machines to complement other existing services, as I believe continued engagement with local services is key to ending the cycle of homelessness, and linking the use of our cards to continued engagement with these services is a way I believe we can ensure that. It will ensure contact is sustained, and hopefully for long enough for their homelessness to be curbed altogether. ”

Khaled was inspired to create the project as a doctoral student at the University of Cambridge, while commuting from Nottingham. As he spent time in train stations, he befriended homeless people in the stations. “I always stopped to talk, often with a coffee or meal in hand,” he says. “I developed an acute understanding of their needs, and learned that even access to basic necessities like food and water was sporadic and oftentimes cumbersome . . . I realized that there had to be a more effective way of at least ensuring the bare necessities were always available.”

After Khaled wrote to dozens of vending machine manufacturers, one company, N&W Global, decided to donate a machine, which was installed in December. A businessman has donated another 100 machines. Volunteers help restock the machines, using food rescued from local restaurants. In a new partnership with UberEats, the organization will be able to make requests to refill the machines through an app, with UberEats making deliveries.