Skip to content

Electronics Design

Working

alt text

Planned Pinouts

alt text

ESP32 Pinouts

alt text

First Attempt

My first board failed. I was too ambitious and was trying to make my final board. In the process I forgot to add reset button and also from FTDI cablel, forgot to put in a voltage regulator.

alt text

  • Using a jumper wire I could solve the power problem by removing the power from FTDI cable but because I did not have a reset button, I was not able to program the board.

  • Also somehow I forgot to route the button to enable pin anded used jumper wire to program. I also did my pin connections wrong for the RFID.

But my power source from Power jack worked.

alt text

Output and Input devices Considered

  1. 6 Selenoids
  2. Speaker through DFplayer Mini(GND, IN, VCC)
  3. RFID tag reader(7 pins, SDA,SCK,MOSI,MISO,GND,RST,VCC)
  4. Switches
  5. LEDs
  6. FTDI programming pins

Selenoid Testing

Tested 12V solenoid that was in the lab but need to test 5V solenoid. The testing of solenoid with relay is already explained in the output week. Using transitor to switch the solenoids was also an option I wanted to explore as the relays were bulky.

alt text

I used the IRF830 for this testing as this was the only switching MOSFET we had in the lab. It works only when 13 Volts in suppled and I think that is because Drain-Source resistor is 1.5 Volts.

Features

  • N-Channel Power MOSFET
  • Continuous Drain Current (ID): 4.5A
  • Gate threshold voltage (VGS-th) is 10V (limit = ±20V)
  • Drain to Source Breakdown Voltage: 500V
  • Drain Source Resistance (RDS) is 1.5 Ohms
  • Rise time and fall time is 16nS and 16nS
  • Available in To-220 package

For the final project, I will be using TIP120 darlinton-Transistor with 5 volts solenoid.

Solenoid Testing and programming

I tried programming RFID using ESP-32 Dev module and relay modules to check if my programming was working. I did two programming and the second version worked.

  • I renamed the 2nd block of each RFID card as A , B and C.
  • Secondly, programmed ESP32 module to swicth on the related solenoid to pop braille letters.

alt text

My code worked, so now I need to futher develop the the code for all the letters and numbers for future.

Here are my codes:

Second attempt

For this week 13 assignment, I made a new board for my final project. I designed the board after testing my program in a ESP32 dev module in my previous assignment. I used the RFID Card that I programmmed in previous weeks assignment with letters to pop corresponding solenoids when placed on card reader this week.

I used KiCAD to desing my board as shown below.

alt text (This is the corrected ckt with the right orrientation of the power jack and power supply of FTDI cable)

alt text

Failure

I had to mill two boards as in the first one I had inverted the SVG image of drill files in MODs, which made the drill holes bigger.

alt text

Here are the BOM:

alt text

  • Also the the board below, the orrientation of the power jack was wrong in my design because of which I had power issue in my board. I had also connected, 3 volts output of the regulator to 5 volts input of FTDI cable.

  • With few tweaks I was able to use the board by giving the power supply from board external powersupply and not using the input powersupply from ftdi cable.(I corrected the ckt and attached above)

alt text

  • Here is the setup for my this weeks assignment. I gave an input power supply of 12V from a power source with 1.8A current.

  • The pin connections for RFID card reader are as follows: SDA-22, CLK-19, MOSI-23, MISO-25, GND-GND, RST-22, 3.3V-3.3V. For solenoid, I connected the solenoids to GPIO27, GPIO25 and GPIO14.

alt text

  • The had already programmed the cards in week 11 for the input week and this week I want the card reader to read the card

  • I wrote the program with help from online tools and Claude AI chat bot which was much more helpful then ChatGPT.

  • I am attaching the full code below but here is the logic to the code which triggered the respective solenoids when the card reads the last data on the RFID card. I wanted to trigger particular solenoids as they will be my braille cells for my final project.

void displayBraillePattern( char letter)
{
  switch (letter)
  {
    case 'A':
      Serial.println("Case A");
      digitalWrite(SOLENOID1_PIN, HIGH);
      digitalWrite(SOLENOID2_PIN, LOW);
      digitalWrite(SOLENOID3_PIN, LOW);
      break;
    case 'B':
      Serial.println("Case B");
      digitalWrite(SOLENOID1_PIN, HIGH);
      digitalWrite(SOLENOID2_PIN, LOW);
      digitalWrite(SOLENOID3_PIN, HIGH);
      break;
     case 'C':
      Serial.println("Case C");
      digitalWrite(SOLENOID1_PIN, HIGH);
      digitalWrite(SOLENOID2_PIN, HIGH);
      digitalWrite(SOLENOID3_PIN, LOW);
      break;
    // Add more cases for other letters here
    default:
      Serial.println("Default");
      digitalWrite(SOLENOID1_PIN, LOW);
      digitalWrite(SOLENOID2_PIN, LOW);
      digitalWrite(SOLENOID3_PIN, LOW);
      break;
  }
  delay(1000); // Adjust the delay as needed
  digitalWrite(SOLENOID1_PIN, LOW);
  digitalWrite(SOLENOID2_PIN, LOW);
  digitalWrite(SOLENOID3_PIN, LOW);
}

The code worked and you can see in the video below:

!!! Failure Burnout detector was triggered

I got this error with the new board I made for this week and I could not figure out the error. I said it was because of the bad connection(soldering issue) and power issue but even when measuring the the input voltage it was 3 volts. So, I used my other board I made in previous week which worked. I need to still check remake the board and maybe that time it wll work.

Design File

design files

Testing of DF player

New Circuit Board changes

I made a new board with pinouts for DF player and one extra pin out for LED lights in the future. Also another reason I made the board was because Of the FTDI cable connected to 5 volts input.

alt text

In this design, I made mistake again by not connecting the the 5 volts output from 5 volts regulator to 5 volts input in 3.3 volts regulator.

I need to change my design to my previous design where I am giving power supply from power jack and not from FTDI cable. Also need to use screw terminal for my output pins as my traces are coming off after few uses.

TESTING DFPLAYER alone

I have connected the RX to pin GPIO pin11 and TX pin to GPIO pin6 of ESP32-wroom-32 as DF player use UART communication.

alt text

I made the connection refering to the picture below from hackster.io

alt text

I tried a simple code to play the only audio I had saved in the SD card and and it worked. Need to reverse the pinout from RX and TX for UART communication in code or hardware but I did it in code.

#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

int Player_state = 13;

// Use pins 2 and 3 to communicate with DFPlayer Mini
static const uint8_t PIN_MP3_TX = 11; // Connects to module's RX 
static const uint8_t PIN_MP3_RX = 6; // Connects to module's TX 
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);

// Create the Player object
DFRobotDFPlayerMini player;

void setup() {
 pinMode(Player_state, INPUT_PULLUP);  

  // Init USB serial port for debugging
  Serial.begin(115200); 
  // Init serial port for DFPlayer Mini
  softwareSerial.begin(9600);

  // Start communication with DFPlayer Mini
  if (player.begin(softwareSerial)) {
   Serial.println("OK");

    // Set volume to maximum (0 to 30).
    player.volume(20);
    // Play the first MP3 file on the SD card
    player.play(1);
  } else {
    Serial.println("Connecting to DFPlayer Mini failed!");
  }
}

void loop() {

if (digitalRead(Player_state) == LOW)
  {
      Serial.println("audio is playing");
  }
  else
  {
      Serial.println("audio is not playing");
  }
}

Intergrating DF player + RFID + solenoids

13/5/2024

I have made 4 boards till now and I need to work on making one more because the previous board, the pins came out and need to make changes to the pinouts for one of the output pins of my Solenoid. Apperantly, because I am using pin number 12 and 13 for solenoid connection, I am having uploading issue (“pakage Transfer Timed out error”) to the ESP32. But I also think the problem is because I have a pin connected to pin 9 which is Rx pin. Still needs to check on that.

But today I am discounnecting the pins and working on programming.

I had tried programming but it didnt work.

code

I am getting gibrish as shown below in serial monitor where previously, I used to get the Card name when I place RFID tag on the reader.

alt text

Things I tried: - I tried again coding only for the RFID and SOlenoid again with this board and it worked. Only when I am coding with codes for DF player it is not working.