Week 9: Output Devices

Checklist for this week:

Group Assignments

Individual Assignments

Hero Shot

Various Output devices

As a group we test output devices for our learning, e.g. LED light strips, OLED, LCD, DC motor, stepper motor and servos. Most of the output devices are self-explanatory.

Adding servos to the microcontroller (Trouble-shooting)

Code reference from Arduino Servo library Example Knob (Potentiometer)

One important note for the servo to connect to the PIN is that it must be PWM enabled (Pulse Width Modulation), e.g. D0 ~ D9 only (not D10).

In this exercise, I try to power up two sets of servos. The signal pins from the servos connected to D4 and D9. The power connected to 5V instead of 3V3.

We import the "servo.h" library. Created functions for myservo, myservo2 and variables for potpin, val, servo, servo2. We used Serial.begin(9600) to read the value of the potentiometer (0 ~ 1023).

Min and Max Pulse Width of Servo

I have been working previously with servo in Arduino IDE but I have never encountered the servo limited to 90 degree of movement even though the servos are capable of 180 degree rotation. In my case, the specification of minimum and maximum pulse width in the code is compulsory to make it rotate up to 180 degree. More details to solve the issue in this youtube video.

Servo does NOT turn fully
Arduino IDE

Loading the code to the Pandas

The explanation for the rest of the code is written after the comments //.


Hero shot of my PCB Application of my PCB

Links to working files