3 Digit 7 Segiment quad Display 0-55v Voltimeter
Moderator: Benj
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
3 Digit 7 Segiment quad Display 0-55v Voltimeter
Am trying to make a voltmeter ranging from 0-55v but this time using a 3digit 7seg Display,this meter has two LEDs that turn ON/OFF in an interval off two seconds,Delay obtained from Timer0 INT overflow with an offset of tmr0+=3;.This works well as desired,the only trouble am geting is displaying voltage on the 3digit 7seg that is why i really need your help.Voltages below 10v should be displayed on Digit1 eg 9.00v,8.03v,7.52v,5.00v,4.00v,3.00v,2.00v,1.00v but also float decimals should be displayed as well eg 23.8v, 54.5v, 30.0v i will not use Digit0,i only need to use Digit1,Digit2 and Digit3 to display voltage from 0-55v.Please help me on the part of displaying voltage on the 3digit 7seg display.Below is my flow chat.
- Attachments
-
- 3Digit 7seg 0-55v voltmeter.fcfx
- (19.81 KiB) Downloaded 279 times
Last edited by Derrihj on Sun May 12, 2019 12:28 pm, edited 2 times in total.
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Hi
Not got V8, but in V7 you can read the ADC using
"read as string" have you tried this ? then you can define the length of the string to 4
https://www.matrixtsl.com/wiki/index.ph ... #GetString
Steve
Not got V8, but in V7 you can read the ADC using
"read as string" have you tried this ? then you can define the length of the string to 4
https://www.matrixtsl.com/wiki/index.ph ... #GetString
Steve
Success always occurs in private and failure in full view.
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Thanks Steve but i would love to see how its done someone download my flowchat help work it out and repost it would be even more helping and quick learning that way.Thanks once again.
-
- Posts: 343
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Attached an example of voltmeter I found on this forum (I am not sure who is the author).
You can see the string manipulation...
You can see the string manipulation...
- Attachments
-
- pic-voltage_v7.fcfx
- (21.4 KiB) Downloaded 259 times
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Thanks so much Viktor but to make my understanding this better an example with a 3 digit 7 seg display would be better showing how to display voltages on it instead of an lcd.
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Is there no one here to help me work on my flowchat and show me how i can display DC voltage on a 7 segiment quard display?
-
- Valued Contributor
- Posts: 773
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 185 times
- Been thanked: 204 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Hi
I've just got back from travels and off again tomorrow so I'm sorry to be brief due to being a bit tired. I looked at your program and when simulated it didn't show any digits after the decimal point until in excess of 10v, and then only the decimal displayed.
In circuit debugger I displayed the variables being used (IntADC,Voltage, Digit1, Digit2, Digit3). It's always a good idea to do this to see if results are as expected. From there I saw that IntADC and Voltage appeared correct (Note that I assume you are using a divider circuit hence the Dvf multiplier of 11). Your calculations in the Seg macro don't seem correct to me. Modulus will give you the remainder after the division. You have for example, Voltage = 5.73 so for digit three you are (voltage/100)%10 which equals 0.0573 % 10.
If you multiply by 100 you would then get 573 %10 which equals 3. Changing your calculations to such then gives you the correct display up to 9.99v. To display 10v or greater you will need to add in an extra routine / branch / whatever to check if Voltage is greater than 10, and if so move the decimal point and digits accordingly.
Hope this helps,
Regards
I've just got back from travels and off again tomorrow so I'm sorry to be brief due to being a bit tired. I looked at your program and when simulated it didn't show any digits after the decimal point until in excess of 10v, and then only the decimal displayed.
In circuit debugger I displayed the variables being used (IntADC,Voltage, Digit1, Digit2, Digit3). It's always a good idea to do this to see if results are as expected. From there I saw that IntADC and Voltage appeared correct (Note that I assume you are using a divider circuit hence the Dvf multiplier of 11). Your calculations in the Seg macro don't seem correct to me. Modulus will give you the remainder after the division. You have for example, Voltage = 5.73 so for digit three you are (voltage/100)%10 which equals 0.0573 % 10.
If you multiply by 100 you would then get 573 %10 which equals 3. Changing your calculations to such then gives you the correct display up to 9.99v. To display 10v or greater you will need to add in an extra routine / branch / whatever to check if Voltage is greater than 10, and if so move the decimal point and digits accordingly.
Hope this helps,
Regards
-
- Valued Contributor
- Posts: 773
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 185 times
- Been thanked: 204 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Hi
Further to my last post I notice that you had IntADC set as a Byte which gives a range of values between 0 and 255, and when reading the ADC you were using GetAverageByte. This means that you could only ever obtain 255 as the maximum value of your potentiometer thus limiting the maximum voltage to around 13.x volts
Changing this to make IntADC an Unsigned Integer (UINT) gives you a range of 0-65535 and using GetAverageInt now allows you to read the full 1023 ADC range and thus the 55v you are after.
I changed your program to reflect all the above and also to display x.yy if under 10v and if over that value then xx.y There are other ways to do it, possibly more efficiently but this may help you.
Regards
Further to my last post I notice that you had IntADC set as a Byte which gives a range of values between 0 and 255, and when reading the ADC you were using GetAverageByte. This means that you could only ever obtain 255 as the maximum value of your potentiometer thus limiting the maximum voltage to around 13.x volts
Changing this to make IntADC an Unsigned Integer (UINT) gives you a range of 0-65535 and using GetAverageInt now allows you to read the full 1023 ADC range and thus the 55v you are after.
I changed your program to reflect all the above and also to display x.yy if under 10v and if over that value then xx.y There are other ways to do it, possibly more efficiently but this may help you.
Regards
- Attachments
-
- 3Digit 7seg 0-55v voltmeter - Update.fcfx
- (21.59 KiB) Downloaded 268 times
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Thanks a million times Chipfryer27 i was waiting for people like you to work out my flowchat.I love learning i will go thru it when i get back home today right now am on phone.
-
- Valued Contributor
- Posts: 773
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 185 times
- Been thanked: 204 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Hi
You are welcome.
Your program was quite easy to follow and it didn't need much to make it work as you wanted it to. Just an easy to overlook calculation, and we have all done that
Regards
You are welcome.
Your program was quite easy to follow and it didn't need much to make it work as you wanted it to. Just an easy to overlook calculation, and we have all done that
Regards
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter
Hi Chipfryer27 i saw your update of my flowchat and its exactly what i wanted now I've learnt how to play around with "MOD" thanks again now am going to build it and see how it goes on a real board next I will need to know how to go about a current meter like from 0-100 or 200A