Comuni Cibo - Smart Dispenser / Fridge With DragonBoard 410c

by AlonsoC7 in Circuits > Software

1552 Views, 9 Favorites, 0 Comments

Comuni Cibo - Smart Dispenser / Fridge With DragonBoard 410c

Comuni Cibo - Logo.jpeg
WhatsApp Image 2017-02-26 at 9.38.06 AM.jpeg
Desperdicio2.jpg
Final Product.jpeg
Qualcomm.png
Desperdicio.jpg

The Little Free Library of the Food World

Introduction:

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.”

Problematic:

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.

Objectives:

· 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.

Specifications:

OS used in DragonBoard: Debian

Source code: Python

Design:

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.

Materials:

· 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

Making the Fridge’s Structure

WhatsApp Image 2017-02-25 at 9.34.02 PM.jpeg
WhatsApp Image 2017-02-25 at 6.41.55 PM.jpeg
WhatsApp Image 2017-02-25 at 9.33.57 PM.jpeg

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.

Connecting the Circuits and All Devices

circuits.PNG
COCO_bb.png

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)

Installation of All Dragonboard Equipment, Terminal and Screen.

WhatsApp Image 2017-02-25 at 9.33.55 PM.jpeg

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 https://github.com/dmandala/library_test.git

· Compile and run:

$ cd library_test

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

$ sudo ./AC-ledSOC

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

break

if target_address is not None:

print "found target bluetooth device with address ", target_address

else:

print "could not find target bluetooth device nearby"

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

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.

#!/usr/bin/python

import time

import bluetooth

from gpio_96boards import GPIO

GPIO_A = GPIO.gpio_id('GPIO_A')

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

tant_1_hr=0

tant_1_min=0

tatemp=0

tant_2_hr=0

tant_2_min=0

tatemp2=0

use=0

target_name = "Uriel" #User 1

target_name2= "Julian" #User 2

#breaktime=time.localtime()

def blink(gpio):

for i in range (1):

gpio.digital_write(GPIO_A, GPIO.HIGH)

time.sleep(6)

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 )

t_1=time.localtime()

break

if target_name2 == bluetooth.lookup_name( bdaddr ):

nameread=bluetooth.lookup_name( bdaddr )

t_2=time.localtime()

target_address = bdaddr

break

#breaktime=time.localtime()

if target_address is not None:

print "found target bluetooth device with name ", nameread

if target_name==nameread:

t_1_hr=t_1.tm_hour

t_1_min=t_1.tm_min

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

tant_1_hr=t_1_hr

tant_1_min=t_1_min

tatemp=tant_1_min+2

use=1

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

else:

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

if target_name2==nameread:

t_2_hr=t_2.tm_hour

t_2_min=t_2.tm_min

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

tant_2_hr=t_2_hr

tant_2_min=t_2_min

tatemp2=tant_2_min+2

use=1

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

else:

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

if use==1:

use=0

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:

blink(gpio)

else:

print "could not find target bluetooth device nearby"

Using the LCD Screen and All Mounted

WhatsApp Image 2017-02-26 at 9.38.06 AM.jpeg

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.

Downloads

Conclusions

Niños Felices.jpg
SmartCities: Comuni Cibo - Free Food for All

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.

Authors:

- 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