Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the attached circuit diagram Vout = VL VR = Vin ( (R2 / (R1 + R2)) (R4 / (R3 + R4)) ) Write an

Given the attached circuit diagram

image text in transcribed

Vout = VL VR = Vin ( (R2 / (R1 + R2)) (R4 / (R3 + R4)) )

Write an Arduino program to calculate Vout and display it on the serial monitor

a. The voltage (Vin) is input via a potentiometer attached to analog pin 0. The program

must read the pot and convert the raw analog to digital converter value to volts, range =

0.00 to 5.00V. Note: you must keep the decimal fractions.

b. The four resistances are input via four potentiometers. Use the raw analog to digital

values (0 to 1023) as the resistances in ohms. Note that none of the resistances should

be 0. Check each pot input and change all 0 values to 1.

i. Pot on analog pin 1 inputs the value for R1

ii. Pot on analog pin 2 inputs the value for R2

iii. Pot on analog pin 3 inputs the value for R3

iv. Pot on analog pin 4 inputs the value for R4

c. The output on the serial monitor must read:

Vin = x.xx volts

Vout = y.yy volts

R1 = a ohms

R2 = b ohms

R3 = c ohms

R4 = d ohms

Most of the message is text except for x.xx, y.yy a, b, c and d which are the values of the

variables:

x.xx is the value of volts input by the user

y.yy is the value of volts output by the circuit

a, b, c and d are the values of the resistances input by the user in ohms

d. The program repeats endlessly at 1 Hz.

e. Explain you program via comments in the code.

R3 Ri R3 Ri

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions