Introduction: Comuni Cibo - Smart Dispenser / Fridge With DragonBoard 410c

The Little Free Library of the Food World


Smart Cities need to focus on the interconnection of services for a better quality of life. It has been estimated that in 2050 more than 60% of population will be living in the cities and necessities like feeding will be a complexity.

Making the refrigerator-concept for a public space helps people confront the reality of how much of what we eat is thrown away.

“Hunger in half of the world proves that the values of the other half are lost.”


In Mexico, 23 people die per day due to malnutrition. It is one of the biggest problems affecting the country and although given priority, it has not been possible to solve in an optimal way. While there is so much famine in the country, 10.4 million tons of food are thrown out every year by business policies. This amount of food is more than enough to feed the 28 million Mexicans suffering from hunger.

Comuni Cibo (“community food” in latin) is an intelligent food dispenser that when passing a card slot or identifier with a chip or an address the pantry will leave a gate. The cards have unique identification and the sensor of the Comuni Cibo, upon receiving the signal of the chip, "blocks" the card for a certain time. This so all the users have the same opportunities to acquire food and do not get to abuse the given service. The Comuni Cibo would be outside the self-service stores like groceries, food stores and restaurants, so that the food is available to those in need.


· Bring technologies and mechatronics knowledges to ethics civility to serve the community.

· Create control systems based on a real-time intelligent database.

· Reduce the amount of wasted food in exchange.

· Create Social Responsible Business(SRB) in enterprises with the help of they can do.

· Human sense and solidarity with the support of social organizations.


OS used in DragonBoard: Debian

Source code: Python


The idea itself is not intended to create the machine, but a service that performs a system of intelligent operation. Exempts food or basic food from the pantry, which meets the needs of people living in poverty. It has an automatic system that measures a RTDB (Real Time Data Base) that saves the information of the user now of entering the service. There is a timer that measures a period of less than or equal to 24 hours once the service has been requested, for safety reasons and to have fairness of opportunities to obtain pantries in the citizens.


· MDF wood 2 mm thick.

· Qualcomm Snapdragon Dragonboard 410c

· Four 5V Motorreductors

· 2 m Galvanized Wire

· Glue

· 9V Battery

· 12 3’’ Screws

· Jumpers

· Optocouplers

· Trial LED

· LCD Screen Grove RGB Backlight V2.0

Step 1: Making the Fridge’s Structure

In DXF, we used as a reference of a vending machine, which it isn't we pretend to offer to public. It was only used for design and aesthetics. We used the SolidWorks tool software.

Step 2: Connecting the Circuits and All Devices

You can connect these circuits as is shown. We designed this in Fritzing.

Plug the pin 23 (GPIO-A) and ground pin (GND) from the DragonBoard to the optocoupler.

(We designed all this with our knowledges)

Step 3: Installation of All Dragonboard Equipment, Terminal and Screen.

Step 4: Access the GPIO Through the Terminal (UXTerm) and Type This Code:

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get dist-upgrade

· Super user to GPIO folder:

$ sudo su

$ cd /sys/class/gpio

· Export, direction, value:

$ echo GPIO23 > export

$ cd gpio(23)

$ echo “in” > direction

$ echo 0/1 > value

Now we will access to the GPIO with the libraries:

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get dist-upgrade -u

· Install Libraries:

$ sudo apt-get install libsoc-dev libmraa0 libmraa-dev libupm0 libupm-dev

· Install Dependencies:

$ sudo apt-get install git

· Clone sample code:

$ git clone

· Compile and run:

$ cd library_test

$ gcc AC-ledSOC.c -o AC-ledSOC -lsoc

$ sudo ./AC-ledSOC

Step 5: Testing Bluetooth

Test Bluetooth. Import the bluetooth library into Python to simulate user detection when approaching.

import bluetooth

target_name = "Uriel"

target_address = None

nearby_devices = bluetooth.discover_devices()

for bdaddr in nearby_devices:

if target_name == bluetooth.lookup_name( bdaddr ):

target_address = bdaddr


if target_address is not None:

print "found target bluetooth device with address ", target_address


print "could not find target bluetooth device nearby"

Step 6: Establishing Timer

At the time the authorized user enters the service, the DragonBoard must count a certain time until the user can reuse the service. This is done for safety reasons so that the user does not want to take over products. So in other archive add this code:

import time

tiempo= time.localtime(tm_hour)

print "local time is:", tiempo

Step 7: Verify User Identity

To test security, the identities of each user must be distinguished to allow access to the machine or not. Everything is connected to the database in real time. In this case, we used an example to control 2 users including their basic information.


import time

import bluetooth

from gpio_96boards import GPIO

GPIO_A = GPIO.gpio_id('GPIO_A')

pins = ( (GPIO_A, 'out'),)








target_name = "Uriel" #User 1

target_name2= "Julian" #User 2


def blink(gpio):

for i in range (1):

gpio.digital_write(GPIO_A, GPIO.HIGH)


gpio.digital_write(GPIO_A, GPIO.LOW)

while (1):

target_address = None

nearby_devices = bluetooth.discover_devices()

for bdaddr in nearby_devices:

if target_name == bluetooth.lookup_name( bdaddr ):

target_address = bdaddr

nameread=bluetooth.lookup_name( bdaddr )



if target_name2 == bluetooth.lookup_name( bdaddr ):

nameread=bluetooth.lookup_name( bdaddr )


target_address = bdaddr



if target_address is not None:

print "found target bluetooth device with name ", nameread

if target_name==nameread:



if(t_1_hr > tant_1_hr or (t_1_hr==tant_1_hr and t_1_min>=tatemp)):





print"hora de uso = ",tant_1_hr, " : ", tant_1_min


print"siguiente hora de uso = ",tant_1_hr, " : ", tatemp

if target_name2==nameread:



if(t_2_hr > tant_2_hr or (t_2_hr==tant_2_hr and t_2_min>=tatemp)):





print"hora de uso = ",tant_2_hr, " : ", tant_2_min


print"siguiente hora de uso = ",tant_2_hr, ":", tatemp2

if use==1:


if __name__ == '__main__':

import argparse

parser = argparse.ArgumentParser( description='Blink LED on GPIO A (pin 23)')

args = parser.parse_args()

with GPIO(pins) as gpio:



print "could not find target bluetooth device nearby"

Step 8: Using the LCD Screen and All Mounted

When the user is identified within the database, it is detected and released the user information on the LCD. We add this last code to our DragonBoard in a new archive, finally we use the archive of code in Python.

Step 9: Conclusions

This project is quite rentable. We spoke with Hector Mares, owner and CEO of Alsuper, and he said that it was a splendid idea. He is looking forward to implement the Comuni Cibo and work with us. Also, Ricardo Tarango, owner of Ricky’s Tacos and Red Texas, also liked the project and confirm that he wanted to be part of it. He said it was a feasible and doable project.

Patricia Lepure, the president of the Carita’s Food Bank of Chihuahua approved it and told us that they are willing to support and work with us. Caritas will oversee choosing the users of Comuni Cibo and giving them their card. Also, they will help us with the deduction of taxes to the stores and restaurants that want to be in the project.

With Comuni Cibo, millions of pesos will be saved and millions of people will be able to have access to food. It’s a win-win for all.


- Julián Marcos Estrada Ortega

- Alonso Contreras Baeza

- Jorge Sáenz Castillo

- Daniela Alejandra Rubio

- Luis Jaime Orozco Villalva

- Uriel Alejandro Castillo Villa

Tecnológico de Monterrey - Qualcomm Smart Cities