Teaching DC RL circuit

Hi everyone, i need some help because i'm not expert at Arduino.
Is it possible to study dc RL circuit with Arduino ? I'm a Physics teacher and i'm triyng to preparare a coding activity for my students .
best regards
Carlo

it depends what you have in mind.

You can use the analog pins of an arduino to monitor voltage change over time. it's not as fast as a scope though.

Do you expect the Arduino to generate the DC signal sent into your RL circuit? ➜ You could generate 0V/5V square wave (bit banging or PWM or timers) but having an Arduino with a real DAC would help if you want something smoother (sine wave) or you'll need an external DAC or specific IC to generate various waves if you have a standard Arduino like the UNO

thanks a lot
I'd like monitor the voltage using 0 V / 5V square wave generated by Arduino .
Is it possible ?

Welcome to the group.

Please explain exactly what you are trying to accomplish.

The Arduino UNO (for example) is very versatile, however, one limitation you might find is there is no analog output just PWM.

thank you Larry
normally we study dc rl circuit only in theory or using oscilloscope but we have only one oscilloscope. So i'd like to use arduino to study the rl transient response . each student could use an Arduino example.

you can indeed send a signal / pulse and also read the analog value using the Arduino

for example sending a 0.5s long 5V pulse and then trace in the loop() what's happening to the voltage somewhere in the circuit

const byte pulsePin = 2;
const byte measurePin = A0;

void setup() {
  Serial.begin(115200);  // speed in bauds
  Serial.println("\nA0"); // label if using the Serial plotter
  pinmode(pulsePin, OUTPUT); // LOW by default
  delay(1000); // pause for 1s
  digitalWrite(pulsePin, HIGH); // 5V out
  delay(500); // pause for 0.5s
  digitalWrite(pulsePin, LOW); // 0V out
}

void loop() {
  Serial.println(analogRead(A0)); // print voltage at ~20Hz
  delay(50); // 50 ms break
}

that's something you can see in the Serial Monitor or Serial plotter

The Arduino can produce square waves 0 to 5v.

Slow interval electrical signals can be plotted to the IDE serial monitor.

One example using google:


And

image

thanks a lot.
my doubt is. if , for example , inductance L = 1mH and R = 1kOhm, tau = 10^(-6)s
is it that transient of RL circuit to fast to detect for Arduino ?
best regards

Larger inductor and larger resistor :wink:


BTW
You could use a capacitor and resistor circuit too.

Yes way too fast for small arduino

@giovannimichele, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

It appears that forum seriously needs to be meaningfully re-named. People are clearly not inclined to read the About the Installation & Troubleshooting category description any more than how to use this forum.

I suggest "Installing/ Troubleshooting the Arduino IDE", because according to the "about", that is what is is intended to be, but it needs to be up front. :face_with_raised_eyebrow:

Maybe it shouldn't be troubleshooting but something less enticing like using.

The IDE: Installation and operation.

Or

The IDE: downloading, installation and use.

OTOH it's only about 10 times a day, so. :expressionless:

I wonder in print whether discord could be configured to pop up one of its annoying advisorys… y'all may have seen "don't comment on a solved thread" or "you have made 22 % of the posts, let someone else have a chance"

"You are posting to a forum that addresses blah blah blah…"

but the noobs would prolly only clock right through that like so much end user license contractual noise.

a7

That is the "cry wolf" situation, isn't it? :grimacing: