Rodrigo Rangel
Published © GPL3+

EchoSight

In 2020, over 2.5 million people with visual disabilities were detected. Here we're giving them access to information in a smarter way

IntermediateShowcase (no instructions)15 hours185
EchoSight

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
NXP RC-522
×1
DFPlayer - A Mini MP3 Player
DFRobot DFPlayer - A Mini MP3 Player
×1
Flash Memory Card, SD Card
Flash Memory Card, SD Card
×1
Speaker, Piezo
Speaker, Piezo
×1
Battery, 3.7 V
Battery, 3.7 V
×2

Software apps and online services

Arduino IDE
Arduino IDE
Fusion
Autodesk Fusion
Visual Studio 2017
Microsoft Visual Studio 2017
google forms

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
heat-shrink tubing

Story

Read more

Custom parts and enclosures

3D Bracelet Model

3D Model for the bracelet with the space to hold Arduino Nano, 2x 3.7V LiPo batteries and PCBwith DFplayer and Speaker

Schematics

Electronic schematic

Connexions between Arduino, DFPlayer, Speaker, RC522 and power source

Code

Visual Studio App

C#
App for uploading new RFID tags to the Arduino
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
using System.IO;

namespace Registrador_RFID
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            ColumnHeader header = new ColumnHeader();
            header.Text = "Códigos";
            header.Name = "col1";
            header.Width = 110;
            listView1.Columns.Add(header);
            listView1.Scrollable = true;
            listView1.View = View.Details;

            button2_Click(sender, e);
        }

        private void button1_Click(object sender, EventArgs e)
        {   //Send
            if (comboBox1.Text == "")
                return;

            serialPort1.PortName = comboBox1.Text;


            try
            {
                foreach (var item in listA)
                {
                    serialPort1.Open();
                    serialPort1.Write(item);
                    serialPort1.Close();
                    Task.Delay(500).Wait();
                }
            }
            catch
            {
                MessageBox.Show("Couldn't connecto to the device", "Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {   //Update
            comboBox1.Items.Clear();
            string[] ports = SerialPort.GetPortNames();
            foreach (string port in ports)
                comboBox1.Items.Add(port);
        }

        List<string> listA = new List<string>();
        private void button3_Click(object sender, EventArgs e)
        {   //Open File
            OpenFileDialog v1 = new OpenFileDialog();
            v1.Filter = "CSV (*.csv)|*.csv";

            if (v1.ShowDialog() == DialogResult.OK)
            {
                
                StreamReader reader = null;
                reader = new StreamReader(File.OpenRead(Convert.ToString(v1.FileName)));
                
                listA.Clear();
                listView1.Items.Clear();
                while (!reader.EndOfStream)
                {
                    var line = reader.ReadLine();
                    var values = line.Split(',');
                    int i = 0;
                    foreach (var item in values)
                    {
                        i++;
                        listA.Add("x" + i.ToString("D3") + "y" + item + "z");
                        listView1.Items.Add("#"+i.ToString("D3")+" "+item);
                    }
                }
                reader.Close();
            }
        }
    }
}

Arduino Code

C/C++
Arduino code for reading RFID tags with RC522, sending signal to DFPlayer to reproduce audio and receiving information from the Visual Studio App to store more RFID tags inside EEPROM memory
#include <SoftwareSerial.h>
#include "DFRobotDFPlayerMini.h"
#include <SPI.h>
#include <MFRC522.h>
#include <EEPROM.h>

#define RST_PIN 9
#define SS_PIN 10

String mySt;
char myChar = 0;

MFRC522 mfrc522(SS_PIN, RST_PIN);

// Ports for communication with DFPlayer (serial)
static const uint8_t PIN_MP3_TX = 2; // Connect to RX in the module 
static const uint8_t PIN_MP3_RX = 3; // Connect to TX in the module 
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);

DFRobotDFPlayerMini player;

void setup() {
  Serial.begin(9600);
  SPI.begin();
  mfrc522.PCD_Init();
  softwareSerial.begin(9600);
  if (player.begin(softwareSerial))
    player.volume(30);  // Volume (0 a 30)
}
int leido[4];
int id;
char codigo[15];
int dir;
char code_temp[3];
int code[4];
int StrToHex(char str[]){
  return (int) strtol(str, 0, 16);
}

void loop() {
  if (Serial.available() > 0) {
     myChar = Serial.read();
     mySt +=myChar;
   }
   if ((mySt.length() >0)&(!Serial.available())) {
      if(mySt.length()!=14) return;
      mySt.toCharArray(codigo,15);
      if(!(codigo[0]=='x'&&codigo[4]=='y'&&codigo[13]=='z')) return;
      dir=(100*(codigo[1]-'0'))+(10*(codigo[2]-'0'))+(codigo[3]-'0')-1;
      
      for(int i=0;i<4;i++){
        for(int j=0;j<2;j++)
          code_temp[j]=codigo[j+5+(2*i)];
        code[i]=StrToHex(code_temp);
      }
      digitalWrite(5,HIGH);
      for(int i=0;i<4;i++)
        EEPROM.update((dir*4)+i,code[i]);
      digitalWrite(5,LOW);
      mySt="";
   }

  if ( ! mfrc522.PICC_IsNewCardPresent()) return;
  if ( ! mfrc522.PICC_ReadCardSerial()) return;
  memset(leido, 0, sizeof(leido));
  id=0;
  for (byte i = 0; i < mfrc522.uid.size; i++)
      leido[i]= mfrc522.uid.uidByte[i];
  // End RFID tag reading
  mfrc522.PICC_HaltA();         

  for(int i=0;i<128;i++)
    if(EEPROM.read(4*i)==leido[0])
      if(EEPROM.read(4*i+1)==leido[1])  
        if(EEPROM.read(4*i+2)==leido[2]) 
          if(EEPROM.read(4*i+3)==leido[3]) 
            id=i+1;
  player.play(id);
}

Credits

Rodrigo Rangel

Rodrigo Rangel

1 project • 1 follower

Comments