FAB LAB Khairpur Sukkur IBA Sukkur IBA University
Merit, Quality, Excellence

FINAL PROJECT

Smart Inventory System for Small Components

Summary Slide of Final Project:

Presentation.png

slide presentation.png

Final Project Video

Problem Statement:

Proper placement of components, make them categorize and keep inventory update is the difficult task, it is the process which is better to be done when changes occur. Doing inventory was a difficult part of my previous job as Space Manager in TajurbaGah. To place small components we have cabinets with boxes, which are categorize and updated on excel sheets. But whenever someone needs any component from those boxes it takes time to find. As for my final project I want to solve that problem by making a smart inventory system which indicates the shelves in which desired components are present.

Electronic Components inventory at Tajurbagah

Electronic components placement at MAKERSPACE Tajurbagah Karachi

Ideation Phase:

To maintain inventory and to keep record about the presence of specific component and their no. of quanity some kind of mechanism is required. My idea for the final project is to make a shelf in which different components are present in boxes and when someone need any component it indicates that box and then update the present quantity in the inventory.

2D sketch of idea

2D Raster sketch of my final project Idea

After discussion with my local and regional instructors about my final project. They point out that to make this idea as my final project I need to mention why my project is different from existing inventory projects. They shared some past students webpages which already propose ways to solve this problem as comparision of my project with them problem statement is same but method to solve the problem is different I am sharing inventory projects below and then I describe in another section about my project

First Project: Inventory Bot

burn complete

Inventroy Bot Front and Back View


Here is the link of this project page. This project is made by Kohei Morimoto from FABLAB Kitakagaya Japan in 2017. The mechanism is based on core XY sytem which is made and attached on back of the cabinet a shaft with servo motor is attached on the head which pushes out the desired drawer, when a person need any component he/she has to give two inputs to machine a name of component and no. of quantity after that if the component is available the core XZ system move toward that box and push it out. The arduino is used to control the core XZ system which gets instruction from PC and act according to it.

Second Project: Wally

burn complete

A look to Wally


Here is the link of this project page. This project is made by Kenzo Prada Abiko from AS220 FabAcademy in 2015. This project also designed to maintain the inventory for the specific projects. To interface with machine, LCD is placed alongside buttons which are also fabricated, a person needs to input a number of project and the boxes which have component of those project light up to mention. After taking desired component a person need to enter the number of component he/she tooks. and inventory updated with respect to it.

Planning Phase (Ver.2):

Everything is going as planned then suddenly I met this guy: Mr. Francisco Sanchez. He visited Pakistan as per request of our instructors to repair ShopBot. We learn many things from him, he also gave us ideas about projects and modified our final projects ideas to be more better.

Picture with Francisco

Group Selfie with Mr. Francisco

Here is the link to visit my project plannig (ver.1) of final project. For Ver.2, I am sharing a simple sketch which is become the base for honey comb structure shelves in my final project. The below sketch shows some fix IP where search box is present along with shelves on screen to indicate the desired component.

Picture with Francisco

Project Sketch

User Journey:

A user journey represents a sequence of events or experiences a user might encounter while using a product or service. Here I am presenting a user journey to understand systematic flow of whole system.

  1. First a user asked for IP address from any of lab representator which is fixed by programmer for ESP-12E to operate the inventory system.

  2. User input the IP address in the browser of his/her laptop or mobile phone

  3. IP address opens the page in which a user found the list of items along with the no. of quantity which is stored in EEPROM of ESP-12E.

  4. When user click on his/her desired item in the list a pop-up appears to ask the no. of quantity either to remove or add in the shelf. and a button to locate item in inventory

  5. A user after adding no. of quantity and checked either remove or add, they press "locate component" button. With this ESP-12E pass a signal to 328p board to blink RGB LEDs of a specif box in which desired component/item is present

Implementation Phase (Ver.2):

After generating idea, we planned a sketch. Now It is time to work as per plan, to describe implementation I split my project documentation into two main parts which are:

  1. Mechanical Structure
  2. Electronic System

Mechanical Structure

Making of Main Structure

I assume a giant honeycomb structure in which instead of honey we put components in bulk, so user can find the desired component easily and update the quantity of specific components in database while finding them.

To talk about 3D modeling or designing only one software came in my mind, as I have whole FAB Course experience to work on SolidWorks, thats why I choose this software for making 3D model of honeycomb structure. In Solidworks we split the design into parts, seperately made them and then assemble them togther to complete the 3D model. In this case we make two parts, base and wall.

Making of Base

To make a base, first we made a sketch of shape with 6 sides(hexagon), sketch it and extrude it to thickness of wood "16mm".Then we made a 25mm box in center of one side and use "linear component pattern" to cpy it all 6 sides. After that I extrude cut those 25 mm boxes. and the base of singal shelf is made.

single_base making

Base for singal shelf


Then in assembly document of solidworks using Mirror, I mirrored it to several times to make whole base structure.

whole base design

Whole Base


Making of Side Wall

To make a side wall, first we made a sketch and extrude it to thickness of wood "16mm".Then on edge I made a rectaangles using lines and mirror and then extrude them to fix the side wall in base. To connect iwth other walls I made slopes on either side of side wall tso they fix with other wall by supporting them also.

side wall making

Side wall


wall with angles on base

Side wall (with slopes) fixing more perfectly then the other original design.


Unfortunately there is a less time for me to learn how to cut slope on both side in Shopbot (obviously there is a way to cut one side then to set the wood again on a same place to cut it from backside). I remake the side wall with simple sides by decreasing the width from 100mm to 90. It leaves the triangle like hole between hexagons when assemble it.

wall without angles

Side wall (without slopes).


wall without angles on base

Side wall (without slopes) setted up on base.


Joining Base and Side Walls:

After generating toolpath from VCarve I cut them both using Shopbot. To learn how to generate toolpath from VCarve please visit Generate toolpath

cutted parts on shopbot

Cutted Parts from Shopbot.


joiining parts

Joining side walls on base.


joiining parts

The Result is pretty expected.


Making Doors for Shelves

I have two options here: either making doors or making box for shelves, because of the size and hexagonal shape I decided to go with doors. For making doors I selected 3mm acrylic sheets to for laser cutting to get doors. But we have very limited 3mm Acrylic sheets in our lab and one of my colleague also want to use them. It takes 4 sheets to make perfect 12 boxes, in which most of the acrylic become wastage, so I scaled my utilization of acrylic sheets of 2x1 ft from 4 to only 2. I cut some doors in 2 parts and then use Elfy glue to join them.

The doors are first made in Solidworks along with handles then change to .dxf to open in inkscape file. From inkscape it changes to .dxf to .svg. And after changing in svg file it converts to .pdf format for laser cutting process (all files are attached in this week files).

making pdf from SVG for Epilog machine

fixing 7 doors in one 1x2 ft sheet.


making pdf from SVG for Epilog machine

doors while cutting in laser cutting machine.


making pdf from SVG for Epilog machine

uisng Elfy glue to joined parts of door.


Along with doors I made handles on 6mm acrylic sheets, which is set to be cut within 0.5x0.5 ft sheet.

making pdf from SVG for Epilog machine

handle file for laser cutting process


Fixing Doors on Shelves

For fixing doors on shelves I am using hinges which I bought 24 in less than 1.04 dollar. I am using them, one side is glued on acrylic and the other part is fixed with 3mm screws on shelves.

hinges

Cute and cheap Hinges


hinge fix on shelf

Hinge fix on shelf


main structure with doors fix on it

Fixed doors on whole structure


3D Box for Circuitry:

The circuits are discussed in next session of Electronic system. Here we only talk about 3D printed box for project circuitry. Like other design it is also first made in Solidworks. It consist of 2 parts one is box and other is cover (files are shared in this week files). The cover is not finished from one corner because of voltage fluctuation while 3D Printing but it is fitted perfectly thats why I used it.

designing box

Designing box


designing box cover

Designing box cover


box while 3D Printing

box while 3D Printing


Finished box and cover

Finished 3D Printed Box and cover


Electronic System

In this part I am discussing other half of project which is electronic system includes circuit boards, wiring from circuit board to output RGB LEDs and programming of the system.

Circuit Boards

First of all the system is based on two circuits in which one is made in Week-12 Output devices and other is made in Week-14 Networking and Communications.

The main circuit we are using here is 328p board which is connected with RGB LEDs (placed in each shelf) and connected with supporting board (ESP-12E Programmable Board) which enables ability to connect with Wifi. Both of the circuit board is made by myself in FABAcademy course. We discuss each board one by one below.

ATMega328p Board

The board is based on ATmega328p microcontroller and developed in Output device week. Here are some features suppports by this board.

328p board pin description

328p Board with Pin Description

To learn more about this board please visit this link of week-12. Here you can find everything from making to uploading code in this board.

ESP-12E Programmable Board

The board is based on ESP-12E controller processor and developed in Networking week. This board is designed by me, it doesn't require anything except FTDI Cable to program. It has manual way to upload code directly using FTDI Cable by pressing Flash and RESET buttons. ESP-12E in this project used to provide wifi ability to the system. It has a huge EEPROM memory which is enough to store inventory data (in my case). To learn more about this project please visit this link of week-14. Here you can find everything from making to uploading code in this board.

ESP-12E board

Programmable ESP-12E Board

Wiring

The system wiring is based on networking between 328p and ESP-12E board, connection from 328p board to RGB LEDs, and most importantily how RGB LED strip split to become output device in each shelf.

Networking between 328p and ESP-12E:

picture of boards connecting with each other

Connection between 328p and ESP-12E board

Making RGB LED output

First I cut RGB LED strip into pieces of 3 RGB LED for one shelf. As I have total 12 shelves so I used total 36 RGB LEDs for this project.

cutted RGB strip into 3

Cutted RGB LED strip into pieces of 3 RGB LED for one shelf

For connections I am using 36 male/male jumper wires and 36 female/female jumper wires cut all then from one side and sold with RGB LEDs. male connection on side of Dout and Female connectors with Din.

RGB LEDs with wires

Soldered jumper wires with RGB LEDs

I accidently increased the size of dogbones while cutting holes on main structure. These dog bone holes used to pass the wires from shelves so I dont need to make specific holes for wiring in shelf.

RGB in shelf

RGB LEDs in shelf and wires are outside to conenct with other RGB LEDs

showing wires outside main structure

RGB wires showed outside while wiring

As I mentioned I put one side of RGB as male wire and other side to be as female wire the reason for this is that these are addressable RGB LEDs. The connection between RGB LEDs are Din of 1st RGB is connected with controller, Dout of 1st RGB is connected with Din of 2nd RGB and the chain and so on. After fixing RGB LED strip with in shelves I connected there wires. 2 Wires are for 5V supply which is connected with main supply and address pins are connected to pass the signal.

connection completed between RGB LEDs

Connection between RGB LEDs

In the next part whole system is powered with 5V supply, my chinese mobile adapter with capacity of 5V and 2 Amp is used as power supply for this project, whole electronic system is connected together and settled in 3D Printed Box to connect with system.

eletronic system fitted in 3D printed box

Eletronic System fitted in 3D printed box along with power supply

Programming

Before jumping to this part it is important to visit week-12 and week-14 first, there you can find libraries and other basic stuff which is important to understand programming in above mentioned board.

Both boards are programmed using Arduino IDE, I split code in different parts and explain each part while sharing code below.

Code for ESP-12E Board:

// Including Libraries
#define DEBUG 0
#include
#include
#include



// FIXED WIFI Settings for FABLAB
//#define ssid "PTCL-BB" // WiFi SSID
//#define password "withoutthp" // WiFi password



// FIXED WIFI Settings for HOME - testing
#define ssid "NETVISION 0064" // WiFi SSID
#define password "noor2233" // WiFi password



// FIXED IP and NETWORK SETTINGS
IPAddress ip(192, 168, 0, 246);
//set static ip
IPAddress gateway(192, 168, 0, 1);
//set gateway
IPAddress subnet(255, 255, 255, 0);
//set subnet
ESP8266WebServer server ( 80 );



// INVENTORY ITEM NAMES, COUNT and QUANTITY
#define numberOfItems 12
String item[numberOfItems] = {
"ATtiny44",
"ATtiny45",
"20MHz_Oscillator",
"10k_Resistor",
"499_Resistor",
"LED_Red",
"LED_Blue",
"ATMega328p",
"1uF_Capacitor",
"Push_Buttons",
"AVR_ISP_Header",
"Male_Header_Pins"
}
;
byte itemQty[numberOfItems] = {
0,0,0,0,0,0,0,0,0,0,0,0
}; // DUMMY VARIABLE for storage
byte itemQtyS[numberOfItems] = {
10,13,5,18,6,9,3,2,12,14,16,20
}; // INITIAL COUNT when there is nothing in EEPROM, this is already saved now



// WEBPAGE CODE
// code was tested with notepad and browser(chrome)
// code written with help from bootstrap online demos and tutorials
// once code was ready, changed all double quotes to single quotes
// added variables for dynamic web page generation
// This code has some HTML code inside which is mismatch with this webpage code to change the settings of this page. One can find this part of code in file folder of this week // function which manages how the page is shown to user and what operation is perfomed for inventory control.
void handleRoot() {
int itemNumber = 100, qtyChange = 0, sign = 1;
if (server.args() > 0 ) {
if(DEBUG)
Serial.println("Server Arguments: ");
for ( int i = 0; i < server.args(); i++ ) {
if(DEBUG){
Serial.print(server.argName(i));
Serial.print(": ");
Serial.println(server.arg(i));
}
if (server.argName(i) == "qtyChange")
qtyChange = server.arg(i).toInt();
if (server.argName(i) == "itemNumber")
itemNumber = server.arg(i).toInt();
if (server.argName(i) == "add")
sign = 1;
if (server.argName(i) == "remove")
sign = -1;
// if server argument is a valid add/remove number
// the item quantity is changed, saved in variable, showed to user and saved in EEPROM
if(itemNumber if(itemQty[itemNumber]+(qtyChange*sign)>=0){
itemQty[itemNumber] = itemQty[itemNumber]+(qtyChange*sign);
EEPROM.write(itemNumber, itemQty[itemNumber]);
EEPROM.commit();
}
Serial.println(itemNumber);
Serial.println(",");
}
}
}
server.send ( 200, "text/html", getPage(0) );
}

int address = 0;
byte value;
void setup() {
// INITIALIZATION CODE, Serial, EEPROM, Server
delay(1000);
EEPROM.begin(512);
Serial.begin(115200);
delay(1000);
Serial.println(-1);
delay(1000);
Serial.println(-1);
// WRITE ALL DEFAULT VALUES TO EEPROM
// Serial.println("itemQtyS[z]");
// for(int z=0; z // address = z;
// EEPROM.write(address, itemQtyS[z]);
// Serial.println(itemQtyS[z]);
// address = address + 1;
// if (address == 512)
// {
// address = 0;
// EEPROM.commit();
// }
// }
// READ ITEM QUANTITY from EEPROM
if(DEBUG)
Serial.println("itemQtyREAD[z]");
for (int z=0; z address = z;
itemQty[z] = EEPROM.read(address);
if(DEBUG)
Serial.println(itemQty[z]);
address = address + 1;
if (address == 512) {
address = 0;
EEPROM.commit();
}
}



// connect to WIFI and start WEB SERVER
if(DEBUG) {
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
}
WiFi.config(ip, gateway, subnet);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
if(DEBUG)
Serial.print(".");
}
if(DEBUG) {
Serial.println("");
Serial.println("WiFi connected");
}
delay(1000);
Serial.println(0);
server.begin();
if(DEBUG) {
Serial.println("Server started");
Serial.print("Type this address in URL to connect: ");
Serial.print("http://");
Serial.println(ip);
Serial.println("/");
}



// link to the function that manage launch page
server.on ( "/", handleRoot );
server.begin();
delay(1000);
Serial.println(1);
if(DEBUG)
Serial.println ( "HTTP server started" );
delay(1000);
Serial.println(2);
delay(1000);
Serial.println(-1);
delay(1000);
Serial.println(-1);



// TURN OFF ALL LEDS
// at start LEDs of boxes 1, 2 and 3 are turned on to indicate system status
// each step makes the other box LEDs turn on
// box 2 is wifi connected status
// box 3 is server start status
}
void loop() {
server.handleClient();
delay(500);
}

// LOOP code, keeps running forever.



// Orignal checked by Noor

Code for 328p Board:

// Including Libraries
#include "FastLED.h"
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
#define PIN 6



// variable for which BOX LEDs to blink
byte ledToBlink = 0;


void setup()
{
Serial.begin(115200);
FastLED.addLeds(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
}
//Initialization PART.
// Starts the Serial Port, Controller waits for a NUMBER on the Serial Port to turn on the relevant LEDs of the selected BOX.



// RGB LED SUPPORT FUNCTIONS - from blog link: https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
void showStrip() {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.show();
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
FastLED.show();
#endif
}



// RGB LED SUPPORT FUNCTIONS - for a single PIXEL - from blog link: https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
void setPixel(int Pixel, byte red, byte green, byte blue) {
#ifdef ADAFRUIT_NEOPIXEL_H
// NeoPixel
strip.setPixelColor(Pixel, strip.Color(red, green, blue));
#endif
#ifndef ADAFRUIT_NEOPIXEL_H
// FastLED
leds[Pixel].r = red;
leds[Pixel].g = green;
leds[Pixel].b = blue;
#endif
}



// RGB LED SUPPORT FUNCTIONS - for all LEDs - from blog link: https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
void setAll(byte red, byte green, byte blue) {
for(int i = 0; i < NUM_LEDS; i++ ) {
setPixel(i, red, green, blue);
}
showStrip();
}


// LED EFFECT FUNCTION - from blog link: https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
// MODIFIED to read SERIAL and ONLY show the relevant LED and the one before and after it.
// Each box has 3 LEDs, so the number received is multiplied by 3 and then the LED before it and after it is illuminated and rest are all set as color to
BLACK.
void RunningLights(byte red, byte green, byte blue, int WaveDelay) {
int Position=0;
for(int i=0; i {
Position++; // = 0; //Position + Rate;
for(int i=0; i // sine wave, 3 offset waves make a rainbow!
//float level = sin(i+Position) * 127 + 128;
//setPixel(i,level,0,0);
//float level = sin(i+Position) * 127 + 128;

// CODE MODIFICATION START
// READ NUMBER from SERIAL
if (Serial.available()) {
ledToBlink = (Serial.parseInt()+1)*3;
while (Serial.available()) {
Serial.read();
}
}
if(ledToBlink>0){
// ONLY TURN ON 3 LEDs and rest all set to BLACK==OFF
if(i==ledToBlink-3 || i==ledToBlink-2 || i==ledToBlink-1)
setPixel(i,((sin(i+Position) * 127 + 128)/255)*red,
((sin(i+Position) * 127 + 128)/255)*green,
((sin(i+Position) * 127 + 128)/255)*blue);
else
leds[i] = CRGB::Black;
}else{
leds[i] = CRGB::Black;
}
}
// CODE MODIFICATION END

showStrip();
delay(WaveDelay);
}
}

// LOOP FUNCTION, keeps the led effect running at all times
// LED effect changes color.
void loop() {
RunningLights(0xff,0,0, 50); // red
RunningLights(0,0xff,0, 50); // green
RunningLights(0,0,0xff, 50); // blue
RunningLights(0xff,0xff,0xff, 50); // white

}


// orignal checked by Noor

User Interface

User interface will be displayed on either mobile phone or laptop of user it consist of list of items which is on buttons and when a person pressed that button a pop-up will show to ask the quantity of item which a person needed or added in inventory and a button to locate the item. When a person press the locate item RGB LEDs will blink of that specific shelf.

Uer Interface 1st Screen

User interface demosntration on laptop


Uer Interface pop-up screen

pop-up window


End Result

After interfacing and asking to locate desired component in inventory system. The RGB LEDs blink in a box to locate the component.

project display1
project display2

System locating desired component with different effects of RGB.



for on webserver of inventory system

Picture which is set above this description is shown at web server

Bill of Material (BOM):

Components Number of components * Price of
components(USD)
Total price (USD) link
8x4-ft 16mm MDF Board
1 * 10.5
bought locally
2x1-ft 3mm Transparent Acrylic Sheet
2 * 2.08
4.16
bought locally
.5x.5-ft 6mm Transparent Acrylic Sheet
1 * 2
1.45
Elfy glue
3 * 0.08
0.26
bought locally
Hinges
12 * 0.043
0.52
bought locally
Screws 3mm
24 * 0.042
1
WS2812B 60 RGB LEDs-WS2812-1m Length (36 used)
36 * 0.16
5.76
click here for link
Male/Male Jumper Wire (150mm)
36 * 0.098
3.52
click here for link
Female/Female Jumper Wire (150mm)
36 * 0.098
1
click here for link
ESP-12E
1 * 6.99
1
click here for link
ATMega328p
1 * 0.1
2
click here for link
5V 2Amp Adapter
1 * 1
1
bought locally
Supporting circuitry for both circuits
1 * 1
1
www.digikey.es
PLA 3D printed pieces
$36.59/0.75kg required 100g.
4.878
www.digikey.es
Total Cost
--
38.048
--

Further Improvements:

There is always a space for innovation in everywork. There are many things which is possible to do in this project for improvements. I mentioned some of improvement which I think i'll worked later to make this project more better and to make it as product from prototype

Acknowledgment:

Allah - beginning with the name of - the Most Gracious, the Most Merciful . All praise is due to Allah; we praise Him, seek His help, and ask for his forgiveness. I am thankful to Allah, who supplied me with the courage, the guidance, and the love to complete this course. Also, I can not forget the ideal man of the world and the most respectable personality for whom Allah created the whole universe, Prophet Mohammad(Peace Be Upon Him).

I would like to acknowledge my deep gratitude to Professor Neil Gershenfeld, director of Fab Academy whose lectures increases our exposure and encourage us to learn more, specially thanks to Vice Chancellor Sir Professor Nisar Ahmed Siddqui along with his team whose vision and mission make FABLAB possible in Pakistan. My instructors Sir Sohail Ahmed Soomro, Sir Fida Hussain Memon, Sir Nisar Ahmed Siddiqui and Sir Asim Ali Samejo who guide me with best of their knowledge in everyweek to complete the task. There are other honourable mentions like Nuria Robles for weekly reviewing my assignments, Francisco Sanchez Arroyo who is always available on Whatsapp for resolving my tecnhnical problems, My brother, Zaid Pirwani (my personal google) who is available on a single phone call to resolve my issues and Nasir Jumani who help me to plan and rethink where I badly stuck. My colleagues who always their to hand me complete group assignments. and all those who are available and somehow help me to complete this course I thank you all. Finally I thank to my family and friends who encourage me, financially support me and emotionally attached with me when I need them.

What I learned, made and shared here is thanks to you all.

"Click here"to download all files of this week

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License
.