I performed different experiments to familiarize myself with Arduino Nano 33 board. I tested the GPIO pins of the microcontroller as analog and digital input/output pins. I used phototransistor, force sensor and potentiometer for giving the variable analog inputs. I used the changing brightness of the LED as the parameter to measure variable output. The pushbuttons and LEDs ON/OFF are used as digital input and output respectively. I also wrote the program to detect pushbutton press type. Lastly, I wrote a program for peak detection of force sensor input.

Digital IO with Arduino Nano 33

I used D2 as digital input pin and D3, D4 as the digital output pin. The program is written such that the LED switches alternately on pressing the pushbutton.

Digital IO testing circuit

Digital IO testing circuit

Code Snippet : Digital IO testing code

Code Snippet : Digital IO testing code

Digital IO testing circuit

Digital IO testing circuit

Digital IO testing circuit

Digital IO testing circuit

Analog IO with Arduino Nano 33

I connected potentiometer variable voltage input to A0 (analog input channel) and changed the brightness of the LED using PWM pin D9.

Potentiometer input to change the brightness of LED through Arduino

Potentiometer input to change the brightness of LED through Arduino

const int ledPin = 9;     //Digital output pin
int analogValue = 0;      //Analog input from potentiometer
int brightness = 0;       //Output to control brightness of LED

void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:

  analogValue = analogRead(A0); //Read analog input
  brightness = analogValue/4;   //To fit in byte
  analogWrite(ledPin, brightness);    //PWM LED with brightness value
  Serial.println(brightness);   //Brightness value

}

Potentiometer input to change the brightness of LED through Arduino

Potentiometer input to change the brightness of LED through Arduino

Potentiometer input to change the brightness of LED through Arduino

Potentiometer input to change the brightness of LED through Arduino

Potentiometer input to change the brightness of LED through Arduino

Potentiometer input to change the brightness of LED through Arduino

Potentiometer used to control LED brightness

Potentiometer used to control LED brightness