8 bit ADC Voltage measurement?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

8 bit ADC Voltage measurement?

Post by gilanetugila »

Good evening!
I am doing an example of a project on AT mega 8 - measuring the voltage at pin An5.
The voltage comes through a divider of 4.7 by 2, 2 kom.
Voltage display on LCD indicator 16 * 2. For some reason, it constantly shows instead of the measured voltage "U = 4.99V" And did not apply the voltage. help me please.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 8 bit ADC Voltage measurement?

Post by medelec35 »

Hi gilanetugila.
Welcome to Matrix TSL forums.
Please don't hijack other peoples threads.
I have started a new thread for you.
Within Pot properties, Try changing the Vref option from AREF to AVCC.
Also, if ADC varies too much then try changing Conversion speed to Fosc / 64 or Fosc / 128
Martin

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

Excuse me! I didn't know how to send a message. I can just reply to your letter. Or you need to enter another topic or section. You wrote that it is necessary to change the Vref parameter from AREF to AVCC in the properties of the potentiometer.But I have (in flowcode 8) only the VDD option on Vref+pin ? Or am I looking for that there? See in the attached file.
Attachments
parametr Vref.jpg
parametr Vref.jpg (110.33 KiB) Viewed 9524 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 8 bit ADC Voltage measurement?

Post by medelec35 »

gilanetugila wrote:
Tue Nov 23, 2021 4:38 pm
only the VDD option on Vref+pin
Yes, sorry I was thinking of a different target device, VDD requires selecting.
Have you measured the voltage directly across An5 (pin 28 if 28dip) and GND?
Martin

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

Yes, I measured the voltage at 28 pin-about 0.25 volts on it.

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

I have a Flowcode 8 . 2 program , I just like this color scheme. I measured the voltage at 28 pin, but no voltage is applied to the voltage divider that is connected to this pin. I tried your option, the one that you suggested changing the Vref parameter. Nothing has changed in the real diagram with the indicator.

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

On the attached file there is a screenshot from the screen with the program properties
Attachments
Снимок.JPG
Снимок.JPG (78.92 KiB) Viewed 9499 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 8 bit ADC Voltage measurement?

Post by medelec35 »

Can you post your flowchart please, as the generated code looks OK
Martin

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

I have a diagram drawn in the sprint layout program (drawing of an electronic board) and a drawing from the site where I connected the elements to atmega8. See in the attached file.
Attachments
theoretical scheme.JPG
theoretical scheme.JPG (80.68 KiB) Viewed 9490 times
real scheme.JPG
real scheme.JPG (87.9 KiB) Viewed 9490 times

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

I misunderstood you. Do you need this program in a different form? look in the attached files
Attachments
2.JPG
2.JPG (103.36 KiB) Viewed 9486 times
1.JPG
1.JPG (95.37 KiB) Viewed 9486 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 8 bit ADC Voltage measurement?

Post by medelec35 »

gilanetugila wrote:
Tue Nov 23, 2021 8:51 pm
Do you need this program in a different form? look in the attached files
The file required has the fcfx extension, which is your flowchart project file.
Martin

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

Good morning! I am sending the required file.
Attachments
na_primere_resistivnuy_sensor.fcfx
(9.36 KiB) Downloaded 107 times

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

Do you have any ideas for solving the problem I wrote about?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 8 bit ADC Voltage measurement?

Post by medelec35 »

Hi, it is currently being looked into.
As soon as we have an answer, you will be notified.
Martin

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

Well, I hope you have a solution to the problem.

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

Good evening ! I went through various sources and found out that: using the program that I made is difficult, because it is impossible to average the voltage values and there is no way to take into account the value of the reference voltage, in addition, I found out that using the reference voltage from the power supply on the LM7805 is more preferable than using the internal reference voltage. I also found out that in order for the VDD mode to work as a reference, you can connect the pin Aref through a 10 nf capacitor to the ground (or you can not connect it) and leave Vref option=VDD in the potentiometer settings. Despite all the manipulations done on a real device, 4.99 is still hanging on the An5 output under test. In this connection, the question arises to the specialists-where did I make a mistake?
Attachments
1.JPG
1.JPG (115.72 KiB) Viewed 9392 times
1_na_primere_video_pro_opornoe_U.fcfx
(10.2 KiB) Downloaded 84 times

gilanetugila
Posts: 109
Joined: Thu Jul 30, 2020 2:01 pm
Contact:

Re: 8 bit ADC Voltage measurement?

Post by gilanetugila »

Good afternoon! I found a malfunction in the real circuit tonight-the voltage divider resistor connected to the ground was not soldered. This was discovered by chance, when measuring the voltage on the divider using another voltmeter.(tester).
Attachments
где был не пропой.JPG
где был не пропой.JPG (120.16 KiB) Viewed 9118 times

Post Reply