Skip to content

Project Development

In this page, I will be taking you though the entire journey of developing my final project😶‍🌫️

Week 1

Initial design plans

You can find out more about my initial design plans, the reason behind my project, and its working mechanism by cliking here.

Week 2

3D designing

I had originally planned on just making a simple box for my device but during one of our local sessions, Rico suggested that I try making something a bit more creative since designing just a regular rectangular box was way too basic and boring😭. Therefore, I tried to think of new ways to design it. I thought of various different shapes like a hexagon(to make it resemble a honey comb) and a triangle(to sort of make it look likle a pyramid).

However, none of them made sense to me. That’s when an idea clicked in my head while I was watching Adventure Time! Why not make the storage box looks like BMO(a character from the show)? I had already thought of making the box resemble a robot so incoporating BMO in my design would be so much more cooler!

Image source

Designing the structure of my final project

This is how the first 3D design of my final project turned out:

Week 3

Rough Circuit designing

This week, I made sure to make a rough sketch of how my circuit will look like so that I will have a clearer vision of my project in my head. In the upcoming weeks, I will make sure to try it using an online simulator. Again, this is a very rough sketch.

Week 5

Cardbox prototype

This week, our instructor made us make a carbox prototype of our final project. This activity was very (emphasis on the very) helpful to us. It made us think about where we were going to mount all out electronics and how they were going to be connected to eachother.

This is how mine turned out after HOURS of hardwork.

This is when I open the door to the box. The small hole in the front is for the electromagnets to lock the door. As you can see there are 6 compartments for each iPad.

Here is a clearer view of the inside of the compartment. I have made a smaller compartment under each space for the iPads to place my pressure sensor which leads to the back of the box, for good wiring.

This is the top of the box where I will be mounting my electromagnets and RFID reader.

This is the hidden compartment where I will be placing my extension cord to charge the iPads and mounting the microcontrollers in.

Week 6

Demo final project board

For the assignment of week 6, I made the first demo of my final project board. However, this time, I will only be using one pressure sensor so that I can have enough pins to use the Xiao-ESP32-C3 microcontoller which is the most recommended microcontroller.

This is how my finished schematic design looks like.

And here is my completed PCB design.

For more details, tap here.

Week 8

Changes!

After our meeting with Mr. Rico yesterday, I made a lot of changes which are:

  • Instead of pressure sensors, I will be using Hall Effect Sensors because it is more durable, reliable, and more compact.

  • I also changed the structure of my box. The slots will now be arranged vertically instead of horizontally in order to distribute the heat evenly.

  • I will be using at least 2 electromagnets since 1 will not be enough to lock the door properly.

  • Instead of using the ESP32WROOM32 as my microcontroller, I will be using 2 Xiao microcontrollers instead since it will be more simpler and easier to manage.

Electromagnet and Relay module

Since this week’s assignment required us to make and test a microcontroller, I made my first demo of my board for my final project. My board only consists of 1 Xiao with 1 elctromagnet, RFID reader, and a pressure sensor.

Here is my complete soldered board:

Mistake!!

I was not aware that in order to use a pressure sensor, the HX711 load cell amplifier was required😭. That’s why in place of the pressure sensor, I used a switch to turn the electromagnet on and off.

Results

Learnings

From this activity, I was able to find out that 1 electromagnet was not going to be strong enough to lock the door of my project in place, which is why I will now be using a minimum of 2 electromagnets in my final project.

You will be able to get more details in my documentation for week 8.

Week 9

Input Devices

Since this week, we will be trying out input devices, I decided to test out some of the input devices I plan on using to sense the presence of iPads.

Hall-effect sensor

Hall effect sensors are sensors that can detect the presence of a magnetic field. Here are the connections I made with my board and my sensor.

Sensor Board
VCC 5V
GND GND
Signal pin D0

This is the code I used along with the prompt I used to generate it from ChatGPT.

Write a code that programs my hall effect sensor, connected to my Xiao ESP32C3, to detect the presence of a magnet.

#define HALL_PIN 2  // GPIO2, change if needed

void setup() {
  pinMode(HALL_PIN, INPUT);
  Serial.begin(115200);
}

void loop() {
  int sensorValue = digitalRead(HALL_PIN);

  if (sensorValue > 0) {
    Serial.println("Magnet detected!");
  } else {
    Serial.println("No magnet.");
  }
  Serial.print(sensorValue);
  delay(300);
}

Results

Conclusion

As you might have also noticed from the video above, the sensor was not able to detect the presence of a magnet very well. It had to be in a very weird certain position for the sensor to be able to detect it. Additionally, the magnet had to be in physical contact with the sensor which is why I am not considering using this sensor for now.

Photoresistor light sensor

A photoresistor light sensor also known as LDR(light dependent resistor) is a sensor which detects light levels. This is a very simplified flowchart showing you how it works:

More light → lower resistance → more current flows

Less light (dark) → higher resistance → less current flows

Here is the connections I made with the sensor and my baord.

Sensor Board
VCC 5V
GND GND
Signal pin A0

This is the prompt I used to generate the code is:

Write a code that programs my LDR, connected to my Xiao ESP32C3, to detect the light levels

Here is the code:

#define LIGHT_SENSOR_PIN 2  // This must match the wire connected to DO

void setup() {
  Serial.begin(9600);
  pinMode(LIGHT_SENSOR_PIN, INPUT);
}

void loop() {
  int sensorValue = digitalRead(LIGHT_SENSOR_PIN);
  Serial.print("Sensor Value: ");
  Serial.println(sensorValue);
  delay(300);
}

Results

Conclusion

The LDR gave me pretty accurate results. However, I am still unsure wheter I should use it or not because since the iPad will already be in a dark slot, I don’t think an iPad being there will make much of a difference to the light intensity there. I also tried a IR sensor but it is not working right now. I will try it again and decide!

Week 11

Updated list of components

Electronics and Modules

  • Xiao ESP32C3 x2

  • IR sensor x 6

  • RC522 RFID module x 1

  • 5 V Electromagnet x 3

  • 4 channeled relay module x 1

  • RFID card(for the users)

  • 12V DC adaptor x 1

  • Jumper wires

IR sensor

This is the setup.

I went through this tutorial.

This is the code I got from the above link.

int IRSensor = 9; // connect IR sensor module to Arduino pin D9
int LED = 2; // connect LED to Arduino pin 13

void setup(){
  Serial.begin(115200); // Init Serial at 115200 Baud Rate.
  Serial.println("Serial Working"); // Test to check if serial is working or not
  pinMode(IRSensor, INPUT); // IR Sensor pin INPUT
  pinMode(LED, OUTPUT); // LED Pin Output
}

void loop(){
  int sensorStatus = digitalRead(IRSensor); // Set the GPIO as Input
  if (sensorStatus == 1) // Check if the pin high or not
  {
    // if the pin is high turn off the onboard Led
    digitalWrite(LED, LOW); // LED LOW
    Serial.println("no motion"); // print Motion Detected! on the serial monitor window
  }
  else  {
    //else turn on the onboard LED
    digitalWrite(LED, HIGH); // LED High
    Serial.println("Motion Detected!"); // print Motion Ended! on the serial monitor window
  }
  delay(1000);  // Delays for 1000 milliseconds (1 second)
}

The code basically senses the presence of an object in front of it and it is displayed in the serial moniter. The LED in my board also turns on when an object is in front.

Results!

Problem

The issue I faced in the beginning was the sensor always sensing something although nothing was in front of it. This was because the sensitivity of it was very high. This could be fixed by simply turning the potentiometer!

Conclusion

The IR sensor was pretty easy to work with. It also gave me pretty accurate results. Therefore, I think I will use this sensor.

Week 12

Component Specification #1

You can visit this to check out my component specification and their prices etc.

Testing adaptor and electromagnets

To test if the electromagnets were strong enough for my door or not, I tested it with an adaptor at the lab with Mr. Anith Ghalley. This is how it looks like:

Mr. Anith also explained how I should connect my relay module to the design which was very helpful.

Conclusion

The electromagnets were pretty strong even when I increased the number of electromagnets whose power was supplied by the adaptor. This made me confident that the door in my final project will lock just fine. Now, I will try to see if there we can find a material just like the one in the electromagnet so that I can use it to lock the door instead of using 2 electromagnets together.


Thank You!

The template for this website was provided by Mr. Anith Ghalley and used with his permission


Last update: April 14, 2025