DEV Community

Nihal Rajpal
Nihal Rajpal

Posted on

GSoC 2025 - Week 8: Designing Serial Port Component and Real Hardware Demo

Week 8 began with our second meeting with Prof. Gargi Khanna, joined by my mentor Aman Asrani. We showcased the improvements made to previously added components based on feedback from the first meeting. We then brainstormed the design of the Serial Port component, and were joined by Vivek Rao, who provided insightful inputs that greatly enriched the discussion.

Serial Port Component Design

During the discussion, we explored how a Serial Port component could enable educational simulations involving real hardware. The conversation highlighted several practical use cases and helped refine the expectations for the component's interface and user experience.

One of the most informative parts of the session was the detailed discussion around the bit width property of the components give in circuit simulators.

๐Ÿ”ง Planning the Demo

Following these discussions, I focused on preparing a comprehensive demonstration of the Serial Port component, which had been developed in the previous weeks.

Initially, I considered two separate examples:

  • One for receiving input from actual hardware.
  • Another for sending output to hardware.

However, we finalized the idea of a single integrated demo that covers both input and output as it would be much more practical & intuitive.

๐Ÿ› ๏ธ Final Demo Setup

The finalized setup includes:

  1. Arduino Uno
  2. LDR (Light Dependent Resistor)
  3. Relay Module
  4. Bulb
  5. (Most importantly) CircuitVerse with Serial Port Component

Workflow:

  1. Arduino reads analog data from LDR (connected to A0).
  2. This data is sent to CircuitVerse via the Web Serial API.
  3. Based on the reading, CircuitVerse sends a control bit (0 or 1) back to the Arduino โ€” it sends 1 if the LDR reading is less than a threshold value (indicating low light).
  4. Arduino uses this bit to toggle Digital Pin 7 high or low.
  5. Digital Pin 7 controls the relay, which switches the bulb on/off.

This setup effectively demonstrates bi-directional communication (Tx & Rx) using the Serial Port component โ€” making it a powerful example of real hardware-software integration in CircuitVerse.


๐Ÿงฉ Circuit Diagram

Circuit Diagram


๐ŸŽฅ Demo Video: Serial Port in Action

Hardware Demonstration


โœ… Other Progress

At the end of the week, I also raised a Pull Request for the documentation of the Bit Extender component, which was developed and finalized in the previous week.

Looking Ahead

In the coming week, I plan to write the documentation for the Serial Port component and begin designing the next component: a FIFO Queue, which will enhance data handling capabilities within the simulator.

Thanks for reading.

Top comments (1)

Collapse
 
snorri1986 profile image
Denys Shabelnyk

@nihal Rajpal did you connect a bulb to 220 V socket or I understood the sketch not correct ?
Thank you for your explanation.