8 bit ADC Voltage measurement?
Moderator: Benj
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
8 bit ADC Voltage measurement?
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.
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.
-
- 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?
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
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
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
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 only the VDD option on Vref+pin ? Or am I looking for that there? See in the attached file.
- Attachments
-
- parametr Vref.jpg (110.33 KiB) Viewed 16089 times
-
- 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?
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
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
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.
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
On the attached file there is a screenshot from the screen with the program properties
- Attachments
-
- Снимок.JPG (78.92 KiB) Viewed 16064 times
-
- 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?
Can you post your flowchart please, as the generated code looks OK
Martin
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
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 (80.68 KiB) Viewed 16055 times
-
- real scheme.JPG (87.9 KiB) Viewed 16055 times
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
I misunderstood you. Do you need this program in a different form? look in the attached files
- Attachments
-
- 2.JPG (103.36 KiB) Viewed 16051 times
-
- 1.JPG (95.37 KiB) Viewed 16051 times
-
- 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?
The file required has the fcfx extension, which is your flowchart project file.gilanetugila wrote: ↑Tue Nov 23, 2021 8:51 pmDo you need this program in a different form? look in the attached files
Martin
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
Good morning! I am sending the required file.
- Attachments
-
- na_primere_resistivnuy_sensor.fcfx
- (9.36 KiB) Downloaded 115 times
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
-
- 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?
Hi, it is currently being looked into.
As soon as we have an answer, you will be notified.
As soon as we have an answer, you will be notified.
Martin
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
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 (115.72 KiB) Viewed 15957 times
-
- 1_na_primere_video_pro_opornoe_U.fcfx
- (10.2 KiB) Downloaded 89 times
-
- Posts: 186
- Joined: Thu Jul 30, 2020 2:01 pm
- Has thanked: 7 times
- Been thanked: 1 time
- Contact:
Re: 8 bit ADC Voltage measurement?
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 (120.16 KiB) Viewed 15683 times