Arduino Illustration:
Project Demo:
249a2f5d7ff3421c96cd2bb558d8e46d
Concept
In this project, I combined both digital and analog inputs in one system, and the difference between them becomes really clear through how each LED is behaving.
The button is a digital input, so it only has two states. It’s either pressed or not pressed. Because of that, the red LED is either fully on or fully off, and there’s no in between state, which makes it binary and feel very direct.
The potentiometer works differently because It’s an analog input, so instead of just two states, it produces a whole range of values. That’s why the yellow LED doesn’t just turn on or off, it gradually changes brightness and dimness depending on how much I turn the knob.
Seeing both of these side by side made the difference between digital and analog feel a lot clearer. Basically, one is fixed, and the other is adjustable.
Code Snippet I’m Proud Of
int potValue = analogRead(potPin); int brightness = map(potValue, 0, 1023, 0, 255); analogWrite(yellowLed, brightness);
This part looks simple, but it took me a second to actually understand what was happening. The potentiometer gives a value from 0 to 1023, which is way bigger than what the LED can use. The map function basically translates that into a range the LED understands, from 0 to 255.
Once I understood that, the analog part finally clicked in my head.
Problems Encountered
Honestly, most of my problems came from the breadboard. Everything can look right, but if a wire is even one row off, nothing works. That was probably the most frustrating part because it’s such a small detail but it affects everything.
The button was also confusing at first. It didn’t respond at all, and I eventually realized it was because of how it was placed. The rotation and position of the button actually matters, and once I adjusted which rows I was using, it started working immediately.
The analog side was also a bit tricky. At one point the LED was just always bright, which made it seem like nothing was changing. That ended up being a problem with a mix of wiring and how the values were being read and mapped.
Reflection
This project was frustrating at times, but it definitely helped me understand what I’m doing instead of just following steps. The biggest thing I learned is how sensitive circuits are to small details.
I also feel like I understand the difference between digital and analog input way more now. Before, it was just a definition, but now I’ve actually seen how they behave differently in the same system.
If I were to improve this, I would make the wiring cleaner and more organized, because that would make debugging way easier, and also maybe try a more creative approach the more i get the hang od the ardunio board.
Overall, I feel like I moved from just trying to get it to work to actually understanding why it works, which I’m really proud of.
Refrences
https://docs.arduino.cc/tutorials/uno-rev3/AnalogReadSerial/
https://docs.arduino.cc/learn/electronics/potentiometer-basics/
AI Usage
ChatGPT was used to help identify what was going wrong when my LEDs wouldn’t turn on, and to address any confusion or debugging needed in my code.


