Page 1 of 1

AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 1:07 am
by Derrihj
Hi every one,Ever since Benj updated the common cathode 7 segment to allow for a HIGH on the output i really wanted to test this and see the new tricks Ben added, i really like the part that says (common Type) were you get to choose if you are gong to use a high or low on the output and also there is ZERO half lit LEDS as you can see my images below, Thanks Benj.So i designed a simple circuit which happens to be an auto Sanitizer, my goal is if an object comes close to the IR-LED/Photodiode pair i get an output on the LM358 which in turn gives me a LOW signal on RA5 of 16f88 through an NPN transistor.Now with a LOW on RA5 variable object is no more equal to ONE so a 1 is added onto variable named PERSON which is also displayed on the 7seg, and then sanitizer is activated to sanitize the user.But i don't know if am doing something wrong because my variable PERSON is raised to 1 before RA5 becomes LOW and keeps on raising without a low on RA5 please take a look at my flowchat and see if am doing something wrong and at this point, the != , <> (NOT EQUAL TO) command don't seem to work correctly.This project is to record upto arround 998 people being sanitized and it will have a record keeper thanks to the Eeprom and many more that it will have to do but now it's still basics with few tasks.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 1:11 am
by Derrihj
Images

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 1:12 am
by Derrihj
More

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 9:49 am
by medelec35
Hi Derrihj,
The issue with your flowchart is you are masking bit 5 of the whole port.
That means when port RA5 = 1 the

Code: Select all

Object
variable will have the value of 2^5 = 32
Therefore you either need to change

Code: Select all

If:Object != 1
to

Code: Select all

If:Object != 32
or you can change it to

Code: Select all

If:Object = 0
etc.
Alternatively, instead of using the whole port and masking 1 pin, just use Single bit option, then you can leave

Code: Select all

If:Object != 1
as it is.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 11:13 am
by Derrihj
Hi Martin nice to see you and thanks for the quick response ok another thing is when Benj updated this 7seg I guess he deactivated the option of disabling the common pin inorder to use the output instead to trigger the digits yet that option is really helpful for low space chips like am using here.I realized using component macro to trigger digits takes much more mcu space than when you use the output and port masking Dear Ben could you please reactivate that option too cause I tried it with this updated version and it didn't work it would be of great help in this simple project like mine since i only have the 16f88 with me because when I upload my finished code with outputs and port masking it fits into the chip "right on the money" but doesn't work and when I load the same code but with component macro for digit triggering Bom i get this annoying message of low space i find my self cutting out my important code trying to fit it in there Thanks Benj for the good work i hope you are somewhere looking at what am trying to say.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 11:57 am
by medelec35
Hi Derrihj,
Your're welcome.
Derrihj wrote:I guess he deactivated the option of disabling the common pin inorder to use the output instead to trigger the digits yet that option is really helpful for low space chips like am using here
This could easily be missed on this topic.
If i was you, I would edit your post to remove all the reference to the component and start a new topic.
Here is the properties to the 7seg display:
7Seg properties.png
(93.11 KiB) Downloaded 119 times
The option to have pin a common pin is still there, unless I have misread your post?
If there is an issue with your display and its down to the component rather than coding, then best to start the topic in the V8 bugs section.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 1:08 pm
by Derrihj
Thanks Martin i used != 32 and it worked like a humble dog.Now the option for common pin is there but when you disabled the common pin so that to use your old trick and activate the digit via the output port masking like you did on my old project of battery charger here it does not work that is what i meant.Maybe i did something wrong let me try it again and see.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 2:05 pm
by Derrihj
Here it is with port masking it doesnot work but the good side of it is that the code size reduces, pliz take a look at the flowchat below.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 2:59 pm
by medelec35
Glad its working like a humble dog for you.
Derrihj wrote:Now the option for common pin is there but when you disabled the common pin so that to use your old trick and activate the digit via the output port masking like you did on my old project of battery charger here it does not work
I don't believe that is what the common select is for.
What I believe is if common pin is set to No then anodes (common anode) or cathodes (common cathode ) of all 7seg's used will be connected to VCC or GND depending if common anode or cathode.
With common pin set to Yes, common of all 7seg displays are connected to separate pins to allow display multiplexing.
So you need to make sure common pin of all displays is set to Yesin order to use the component macros for your setup.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 3:19 pm
by Derrihj
I would like to use output icon with port masking like we did in the charger instead of using compenent macro inorder to reduce on code size.

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 4:29 pm
by medelec35
Derrihj wrote:I would like to use output icon with port masking like we did in the charger instead of using compenent macro inorder to reduce on code size.
Then you need to delete all the 7seg components from the 2D panel

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 10, 2020 7:31 pm
by Derrihj
Ok got you loud and clear Mr Martin.

Re: AUTOMATIC SANITIZER

Posted: Thu Jun 11, 2020 8:36 pm
by Derrihj
Ok ive added custom characters, that is PE (people), on Start up display shows 0PE (0 people),now as an object comes close to the sensor, a 1 is added then display shows 1PE (1 person) and so on as the count comes to 10 and above it changes to say 10P, 20P, 99P then 100 without (P) upto 999.Now the code works well in flowcode but on Hardware it doesn't please take a look at my flowchat and help find the "BAD guy" in my code thanks allot.

Re: AUTOMATIC SANITIZER

Posted: Thu Jun 11, 2020 9:49 pm
by kersing
It helps if you tell what part of the program doesn’t work.

Re: AUTOMATIC SANITIZER

Posted: Thu Jun 11, 2020 10:05 pm
by Derrihj
At first i used a decimal point to separate the zeros from numbers of people like 1.00, 2.00, 10.0, 99.0 and then 100 till 999.and the program works very well after Martin told me to use <>32,But now i wanted to replace the decimal point with characters like PE that is 1PE , 2PE, 10P, 99P and then 100 til 999, but when i load the code into the chip i get a funny display with no increasing numbers even with the object close to my IR-LED/Photodiode sensor pair.I get a funny display which is shown below.Remember my PE character is now sitting in place of the two zeros in case of (ones) and only a P in place of the one zero incase of (Tens) which should work exactly as in the first place with the zeros in place but it doesn't.

Re: AUTOMATIC SANITIZER

Posted: Sat Jun 13, 2020 2:33 am
by Derrihj
Ok i managed to work it out and now it's working with my characters after making seg1=1 instead of 0x73 ,seg2= 2
instead of 0x79 and a 2ms for each digit update interrupt having a total of around 165 flames/sec all together to minimize on the half lit led on my Characters as the reference 1 and 2 was reflecting allot on my characters so reducing the interrupt frequency to 165 helped reduce on the intensity of the half lit led. Using component macro takes more space BUT produces better display with totally zero half lit LEDs, so my conclusion is that if i want better display with totally zero half lit LEDs it's better to use the component macro for the digits common pin triggering and a spacious MCU but also the output port masking method helps when you are in a dangerous low mcu space "front line" haha. So using the output port masking all my code was able to fit it the 16f88.

Re: AUTOMATIC SANITIZER

Posted: Tue Jun 23, 2020 10:33 am
by Derrihj
Ok i have managed now to make my display look really beautiful with totally zero and i mean totally zero half lit LEDs even with port masking method, this is a great achievement for me as i don't have to use the component macro that take allot of my MCU space. I have managed to do this by clearing all port bits used just before the next digit to be displayed on each 7 seg Digit.I tell you i now have a nice and beautiful display that don't irretate the eyes.

Re: AUTOMATIC SANITIZER

Posted: Tue Jun 23, 2020 11:13 am
by Derrihj
Totally zero half lit LEDs only a reflection of a close camera.

Re: AUTOMATIC SANITIZER

Posted: Tue Jun 23, 2020 11:39 am
by medelec35
Hi Derrihj,
That's great!
Well done.
Display is looking looking really good. :)

Re: AUTOMATIC SANITIZER

Posted: Wed Jun 24, 2020 11:23 pm
by Derrihj
Well Martin thats all your hadwork,you really did what you could to make me understand the 7seg which proved to be big headed to me in the first start, i really like you mr Martin, wish u could visit me in my country but the bad thing am not that rich to transport u down here.Keep the good work mr Martin. May GOD BLESS you richly.

Re: AUTOMATIC SANITIZER

Posted: Thu Jun 25, 2020 4:17 pm
by medelec35
Thank you Derrihj,
Very kind words indeed.
All very much appreciated.