Design a schematic diagram for an Arduino-based system to run the code (below). The pinout of the Arduino is provided below, and you can determine the peripheral devices and connect them to the Arduino ports for performing the function.
int Collect = A1;
const int sampleWindow = 100;
unsigned int sample;
void setup() {
Serial.begin(9600);
}
void loop() {
unsigned long startMillis = millis();
unsigned int peakToPeak = 0;
unsigned int signalMax = 0;
unsigned int signalMin = 1024;
while (millis() - startMillis < sampleWindow) {
sample = analogRead(Collect);
if (sample > signalMax) {
signalMax = sample;
} else if (sample < signalMin) {
signalMin = sample;
}
}
peakToPeak = signalMax - signalMin;
Serial.print("Signal Value = ");
Serial.print(peakToPeak);
Serial.print("
");
delay(100);
}
AREF
GND
Ground Digital - D13 SPI-SCK Digital D12 SPI-MISO Digital PWM-D11 SPI-MOSI Digital PWM-D10 SPI SS Digital PWM-D9 Digital D8
OREF
RESET
11 UNO Digital D7 Digital PWM-D6 Digital PWM D5 Digital D4 Digital PWM-D3 Digital D2 XI Digital D1 UARTIn Digital DO UART-Out
3.3V 5V Ground Ground 5V
3V3
GND
Analog - A0 Analog - A1 Analog - A2 Analog - A3 Analog - A4 Analog - A5
CSP