It all started with a simple question: Can I control the lamp in my room wirelessly using just my laptop?As someone deeply interested in both software development and embedded systems, I decided to combine the best of both worlds.
So, I picked up my Arduino Nano, paired it with an HC-05 Bluetooth module, and decided to write a C#.NET Windows Forms application as the remote controller. My goal was to build something real, useful, and fun — and most importantly, something that could inspire others to explore the exciting intersection of hardware and software.
🧠 What I Did:I designed a simple UI in Windows Forms with ON and OFF buttons.
- I designed a simple UI in Windows Forms with ON and OFF buttons.
Connected the HC-05 module to the Arduino, which communicates with the laptop wirelessly via Bluetooth.
- Connected the HC-05 module to the Arduino, which communicates with the laptop wirelessly via Bluetooth.
One of the trickiest parts of the project was managing the COM port assignment for the HC-05 Bluetooth module. Every time it paired with my PC, it could potentially be assigned a different COM port — which caused issues in my WinForms application since I had the port manually hardcoded.
Instead of coding a dynamic port selector, I took a more straightforward approach:
I opened Control Panel → Devices and Printers → Hardware Properties
- I opened Control Panel → Devices and Printers → Hardware Properties
Located the HC-05 module and checked the COM port assigned to it
- Located the HC-05 module and checked the COM port assigned to it
Then I updated my code to use that COM port value
- Then I updated my code to use that COM port value
This manual process worked well during development, but it taught me a valuable lesson — in real-world applications, dynamic port detection and proper error handling are essential for robustness and user-friendliness.
Comments