#avr Logs

May 22 2020

#avr Calendar

12:07 AM day_ is now known as day
04:32 AM Thrashbarg_ is now known as Thrashbarg
05:09 AM _ami_: I'd used voltage divider to create +V/VGND/-V rail to power up an op-amp, Now i want to measure the voltage at the output of op-amp using a 5V MCU. since for development, i'll be using PC usb port, therefore MCU and op-amp are in two different network.
05:10 AM _ami_: if i have to connect +V/VGND/-V Network to a V1/GND network, connect -V to GND. Will it be fine in this case?
05:17 AM matrixuser: it could be fine if v+-v- (so sum of absolute of both voltages) does not exceed MCU maximum voltage
05:18 AM matrixuser: so for example if you have isolated -5 and isolated +5 V
05:18 AM matrixuser: and you connect -5V to MCU Gnd together
05:18 AM matrixuser: then your V+ ist 10V for the MCU
05:52 AM Smidge204: The MCU max voltage will be the MCU's rail voltages plus/minus ~0.5v (check data sheet)
05:53 AM Smidge204: This is because there are protection diodes that clamp each pin to the power rails, so if your VCC is 3.3V, and voltage over about 3.8V will shunt out to the VCC rail through the protection diode
05:56 AM Smidge204: As for the mesurement question; since the ADC can't measure "negative" voltages you'll need to either reference the MCU to your "-V" (Making -V the "true ground" of your power supply and the midpoint of your voltage divider the "virtual ground" for your analog portion), or use another opamp to buffer and offset the signal
05:59 AM _ami_: thanks guys.
05:59 AM _ami_: it worked.
05:59 AM _ami_: i get nice output from 0 to 2v.
05:59 AM _ami_: at MCU adc
06:00 AM Smidge204: sweet
06:00 AM Smidge204: If you have an extra opamp, consider using that to be your voltage reference instead of a simple divider
06:01 AM Smidge204: Set it up with a gain of 0.5 and the op-amp output becomes your virtual ground
06:01 AM _ami_: Smidge204, yes, i could have used an op-amp to map the voltage range to 0 to 4.5v
06:01 AM Smidge204: That too.
06:02 AM _ami_: Smidge204, yes, i did that for voltage divider using 741, but i guess i should have used better op-amp.
06:02 AM _ami_: https://pbs.twimg.com/media/EXj79H-UcAANFw7?format=jpg&name=large
06:03 AM _ami_: http://tinyurl.com/ya3hu3bm
06:03 AM Smidge204: Wha
06:08 AM _ami_: it's been a while since i wrote code for avr.
06:10 AM _ami_: https://pbs.twimg.com/media/EYnfgUIU4AE_rCk?format=png&name=large <-- looks good.
06:10 AM _ami_: now i am going to write code for measuring frequency
06:10 AM Smidge204: Very good!
08:18 AM rue_mohr: 3rd person to write that in the last 4 months