SVHANS
Jun 21 2008, 5:25 AM
Firstly id like to say i know nothing about microcontrollers etc...
so my question may sound really basic and stupid, so I'll apologise up front.
Basically i want to make a circuit that will count down from 100 to 0. When it gets to 0 I want some part of the circuit to go 'open' until it is reset. Also I was hoping to have the LCD display being able to be connected remotely (as in I can have several 'counter' units and 1 display unit that can be connected to any counter unit telling me the position of the count).
I understand this should be quite simple for a MICRO I just need to know how to do it and from the very beinging, including the control circuit and the software etc. I do have a PIC programmer and someone who knows how to; at my disposal.
Hopefully there is someone out there in 'forum land' who would be willing to help me I am happy to reimburse people for their time and effort.
Regards,
Stu
so my question may sound really basic and stupid, so I'll apologise up front.
Basically i want to make a circuit that will count down from 100 to 0. When it gets to 0 I want some part of the circuit to go 'open' until it is reset. Also I was hoping to have the LCD display being able to be connected remotely (as in I can have several 'counter' units and 1 display unit that can be connected to any counter unit telling me the position of the count).
I understand this should be quite simple for a MICRO I just need to know how to do it and from the very beinging, including the control circuit and the software etc. I do have a PIC programmer and someone who knows how to; at my disposal.
Hopefully there is someone out there in 'forum land' who would be willing to help me I am happy to reimburse people for their time and effort.
Regards,
Stu
Arun Kumar V
Jun 21 2008, 7:08 PM
Hello Stu,
Welcome to our forum !
No, you don't have to pay us for our time and efforts !
Yes, your project can be implemented, from what i understand from your post you want to have a MASTER Micro with LCD connected to it and Several Slaves connected to the master.
Master selects the Slaves Randomly or in particular Sequence and reads their Counter values and displays each slaves reading on LCD.
If you are not very particular about type of Micro - you could also use 8051 like 20 pin AT89C2051 which has Serial port and would be economical than PIC that have Serial Port.
you just need a long pair of twisted wire to connect to the master and slaves.
each slave is given a unique ID to which it responds,whenever master wants data from a particular slave, it sends out the unique ID for that slave and gets the info to be displayed on lcd.
so theres the project outline, if you are with me till this point we can continue.....................
theres a Thanks button which you can use ,if this reply helped you.
Arun
SVHANS
Jun 21 2008, 11:52 PM
Arun,
thanks for your reply,
I am not particular at all about what I use to do it. As long as it works, lol.
I probably was not real clear in my description. what you have described is a bit more complicated than I need. All I want to be able to do is have the lcd display being able to be removed and applied to other counter units.
Basically I dont want the counter to have its own LCD display I just want to be able to connect one when I need to know what the count is up to.
It is required for several pieces of equipment that run through a process and when they have done so 100times I need to perform maintenance on them. So basically at 100 I want them to stop functioning and they will be replaced with an overhauled unit and the count reset.
Also they are all in different geographical locations so having them connected is not an option.
Hopefully this explains my project a bit better.
Again any help would be greatly appreciated.
Regards,
Stu
thanks for your reply,
I am not particular at all about what I use to do it. As long as it works, lol.
I probably was not real clear in my description. what you have described is a bit more complicated than I need. All I want to be able to do is have the lcd display being able to be removed and applied to other counter units.
Basically I dont want the counter to have its own LCD display I just want to be able to connect one when I need to know what the count is up to.
It is required for several pieces of equipment that run through a process and when they have done so 100times I need to perform maintenance on them. So basically at 100 I want them to stop functioning and they will be replaced with an overhauled unit and the count reset.
Also they are all in different geographical locations so having them connected is not an option.
Hopefully this explains my project a bit better.
Again any help would be greatly appreciated.
Regards,
Stu
Arun Kumar V
Jun 22 2008, 2:21 AM
Hello Stu,
your second post explains what you intend to do.
but an LCD display cannot be inserted just like a plug into a running circuit, by doing so you'd ruin the LCD.
bcoz LCD needs to be initialized first or say warmed up before usage, there are particular control signals that are to be sent to the LCD first and later the data can be displayed.
i feel what you need is a 3 digit 7 segment display module which can be inserted into a molex connector that should be provided on the circuit board of each counter.
this way only you can know/read the count by plugging in the display module.
my suggested layout is like this :
Arun
your second post explains what you intend to do.
but an LCD display cannot be inserted just like a plug into a running circuit, by doing so you'd ruin the LCD.
bcoz LCD needs to be initialized first or say warmed up before usage, there are particular control signals that are to be sent to the LCD first and later the data can be displayed.
i feel what you need is a 3 digit 7 segment display module which can be inserted into a molex connector that should be provided on the circuit board of each counter.
this way only you can know/read the count by plugging in the display module.
my suggested layout is like this :
Arun
SVHANS
Jun 22 2008, 3:10 AM
Arun,
This solution would be perfect, I assumed I would need some sort of circuit to go along with the LCD's rather than just plugging them in.
If it is possible to have a separate LCD circuit board that can be plugged into any counting unit it would suit my needs perfectly.
I guess I could probably get away with just 2 LCD segments if it is easier considering 99 to 00 is actually 100 increments.
Also once it has finished the cycle and requires a reset if it could display something like 'E' would be good but not essential.
Thank again for your help so far.
Stu
This solution would be perfect, I assumed I would need some sort of circuit to go along with the LCD's rather than just plugging them in.
If it is possible to have a separate LCD circuit board that can be plugged into any counting unit it would suit my needs perfectly.
I guess I could probably get away with just 2 LCD segments if it is easier considering 99 to 00 is actually 100 increments.
Also once it has finished the cycle and requires a reset if it could display something like 'E' would be good but not essential.
Thank again for your help so far.
Stu
sashijoseph
Jun 22 2008, 6:27 AM
The lcd unit can be done with an additional micro to handle the lcd.A serial link between the two would facilitate fetching counter data from the main micro.
In the tutorial section we have some nice writeups for interfacing the 8051 with lcd's,serial communication and lots more.There are 'skeletal' codes too which you may adapt for your needs (& if you're feeling lazy).
In the hardware part you must connect the counter trigger-source to an 'external interrupt' pin of the micro after proper conditioning.
The other micro would interface to the lcd and a serial link will run between the two.
Could you plz describe what will trigger the counter and what appliance you need to switch on/off?
In the tutorial section we have some nice writeups for interfacing the 8051 with lcd's,serial communication and lots more.There are 'skeletal' codes too which you may adapt for your needs (& if you're feeling lazy).
In the hardware part you must connect the counter trigger-source to an 'external interrupt' pin of the micro after proper conditioning.
The other micro would interface to the lcd and a serial link will run between the two.
Could you plz describe what will trigger the counter and what appliance you need to switch on/off?
SVHANS
Jun 22 2008, 1:40 PM
Arun,
I have re-read your posts and realise i have been using the term 'LCD' but meaning a 7 segment LED display. There is no need for an LCD and it would just over complicate things. Sorry for the confusion.
I think something like what you suggested in your first post would be good, I just dont need them connected all the time. So I may not need the complexity of having separate ID's etc.
I have re-read your posts and realise i have been using the term 'LCD' but meaning a 7 segment LED display. There is no need for an LCD and it would just over complicate things. Sorry for the confusion.
I think something like what you suggested in your first post would be good, I just dont need them connected all the time. So I may not need the complexity of having separate ID's etc.
Arun Kumar V
Jun 22 2008, 6:34 PM
Hello Stu,
here's what an LCD display with Molex connector looks like:
and here's a Plug-In type two digit 7 segment LED Display Module :
solution in my second post suits your needs, there can be ONE 2/3 digit 7 Segment Display module
and SEVERAL Counter circuits installed at several locations
the counter circuit board/s with microcontroller, power supply & connector would look like this:
Now can you tell me what triggers the counter : External or Internal Source
external source would include rotations of a motor/equipment, so that the counter decrements/increments on each rotation.
internal source would include timer inside the micro providing pulses - every micro second,millisecond second,minute,hour,day,year
Arun
here's what an LCD display with Molex connector looks like:
and here's a Plug-In type two digit 7 segment LED Display Module :
solution in my second post suits your needs, there can be ONE 2/3 digit 7 Segment Display module
and SEVERAL Counter circuits installed at several locations
the counter circuit board/s with microcontroller, power supply & connector would look like this:
Now can you tell me what triggers the counter : External or Internal Source
external source would include rotations of a motor/equipment, so that the counter decrements/increments on each rotation.
internal source would include timer inside the micro providing pulses - every micro second,millisecond second,minute,hour,day,year
Arun
SVHANS
Jun 22 2008, 10:23 PM
Arun,
I think an external trigger would be easiest to adapt to my current equipment.
Also is there any way to reduce the number of connections the 7 segment LED requires? such as giving it its own power supply and micro?
Thanks
I think an external trigger would be easiest to adapt to my current equipment.
Also is there any way to reduce the number of connections the 7 segment LED requires? such as giving it its own power supply and micro?
Thanks
Arun Kumar V
Jun 23 2008, 3:28 AM
Hello Stu,
Yes, its possible to reduce the connections to 3 wire if you are using separate power supply and dedicated micro on the display module.
3 wires would be : Rx, Tx, Gnd
the micros would communicate with each other using serial port. there would be a button or switch on the display module which when pressed would send a particular "character" to the micro on the counter board which then responds by sending the current counter value, after receiving the counter value the display micro puts it on the 7 segment display.
stu, you haven't cleared what is it you want to count, we surely know it has something to do with equipment. micro needs some sort of input so that it can increment/decrement the count.
for eg: lets assume we want to count the number of people entering a theater, the hall has only one
door way and a laser/light source is placed at one end of the door way and a phototransistor/LDR is
placed across the other end to which a micro is connected. when ever a person crosses the door way, he interrupts the light beam and the phototransistor would give a pulse to the micro which then increments the count and displays it on LCD/7 seg LED. finally before the show begins the door way can be closed and we can know how many people have come to the show
I hope you got my point
Arun
Yes, its possible to reduce the connections to 3 wire if you are using separate power supply and dedicated micro on the display module.
3 wires would be : Rx, Tx, Gnd
the micros would communicate with each other using serial port. there would be a button or switch on the display module which when pressed would send a particular "character" to the micro on the counter board which then responds by sending the current counter value, after receiving the counter value the display micro puts it on the 7 segment display.
stu, you haven't cleared what is it you want to count, we surely know it has something to do with equipment. micro needs some sort of input so that it can increment/decrement the count.
for eg: lets assume we want to count the number of people entering a theater, the hall has only one
door way and a laser/light source is placed at one end of the door way and a phototransistor/LDR is
placed across the other end to which a micro is connected. when ever a person crosses the door way, he interrupts the light beam and the phototransistor would give a pulse to the micro which then increments the count and displays it on LCD/7 seg LED. finally before the show begins the door way can be closed and we can know how many people have come to the show
I hope you got my point
Arun
SVHANS
Jun 23 2008, 6:32 PM
Arun,
the easiest way would be, it has a green led on when its running and the red one on when it stops. i want it to count when the red led comes on. Hopefully thats possible.
the easiest way would be, it has a green led on when its running and the red one on when it stops. i want it to count when the red led comes on. Hopefully thats possible.
Arun Kumar V
Jun 23 2008, 7:31 PM
Perfect !
thats possible, there are two ways to interface the Red LED on the equipment to
micro:
1) using a optocoupler like PC817/4N35, if LED can be removed from its hole/socket along with its wires.
2) using an LDR, a black opaque tube with LDR at one end is fixed onto the Red LED and when the red Led glows the LDR sends a pulse.
we have enough inputs to start the project.
before we proceed further you may want to check the availability of components in your local electronics stores,
first would be the micro : Atmel's 20 pin AT89C2051,
second - suitable Programmer which can program the AT89C2051( i remember you saying you have a person who knows stuff at your disposal) ask him if At89C2051 can be programmed by his programmer..........................
once you confirm these i can proceed to write code for your task.
Arun
thats possible, there are two ways to interface the Red LED on the equipment to
micro:
1) using a optocoupler like PC817/4N35, if LED can be removed from its hole/socket along with its wires.
2) using an LDR, a black opaque tube with LDR at one end is fixed onto the Red LED and when the red Led glows the LDR sends a pulse.
we have enough inputs to start the project.
before we proceed further you may want to check the availability of components in your local electronics stores,
first would be the micro : Atmel's 20 pin AT89C2051,
second - suitable Programmer which can program the AT89C2051( i remember you saying you have a person who knows stuff at your disposal) ask him if At89C2051 can be programmed by his programmer..........................
once you confirm these i can proceed to write code for your task.
Arun
SVHANS
Jun 23 2008, 8:22 PM
Arun,
i can easily access the LED and its wires.
I can also source the At89C2051 and our programmer is capable of progamming it.
Thanks.
i can easily access the LED and its wires.
I can also source the At89C2051 and our programmer is capable of progamming it.
Thanks.
Arun Kumar V
Jun 23 2008, 10:37 PM
Right O, then !
i' ll give you full code and schematic in a day or two - so stay tuned ..............
and don't forget to press the Thanks button, if the replies helped you !
Arun
SVHANS
Jun 23 2008, 10:40 PM
Arun,
If you can provide me with the code and schematic, there wont be enough thanks buttons!!!! LOL
If you can provide me with the code and schematic, there wont be enough thanks buttons!!!! LOL
Arun Kumar V
Jun 24 2008, 1:38 AM
Hello Stu,
as promised, heres my Schematics for both Counter board and Display Module:
2-digit_counter.rar
i am writing the code for both the circuits, i need few inputs like :
1) when you say the RED LED glows on when the machine stops, does it stay that way till the machine is started again or it just comes on and goes off after few seconds ?
2) do you want to count down ( 99 to 00 ) or count up (00 to 99), with the count up timer (00 to 99) you have a added benefit to display "E" on 100th count.
Arun
as promised, heres my Schematics for both Counter board and Display Module:
2-digit_counter.rari am writing the code for both the circuits, i need few inputs like :
1) when you say the RED LED glows on when the machine stops, does it stay that way till the machine is started again or it just comes on and goes off after few seconds ?
2) do you want to count down ( 99 to 00 ) or count up (00 to 99), with the count up timer (00 to 99) you have a added benefit to display "E" on 100th count.
Arun
SVHANS
Jun 24 2008, 2:55 AM
Arun,
the LED goes on then turns off after a while.
I'd like it to count from 99 to 0 then instead of an E maybe - - the centre LED segment on both LED displays?
thanks heaps foir your help so far!!
the LED goes on then turns off after a while.
I'd like it to count from 99 to 0 then instead of an E maybe - - the centre LED segment on both LED displays?
thanks heaps foir your help so far!!
Arun Kumar V
Jun 25 2008, 6:40 AM
Hello Stu,
after 2 days of hardwork on your project here are the pics of the project, i have tested the project on the test bench:
since i had only one 7 seg display at the time of testing, i used a SPDT switch to flip between 1st digit and 2nd digit.
i made some abbreviations on the display like:
1) nC = not connected
2) En = End, needs to be reset.
the codes on the two micros worked well but, i am having second thoughts on the serial link .
3 wires between the two cannot be interrupted i,e if the link is pulled out and reconnected the count doesn't advance and both micros have to be reset.
after seeing this practical problem i suggest the solution in my second post with 12 pin connector or you can have display and counter on one single board and each one of these boards on each machinery.
let me know your opinion and don't worry about my time and efforts spent on this solution .
Arun
after 2 days of hardwork on your project here are the pics of the project, i have tested the project on the test bench:
since i had only one 7 seg display at the time of testing, i used a SPDT switch to flip between 1st digit and 2nd digit.
i made some abbreviations on the display like:
1) nC = not connected
2) En = End, needs to be reset.
the codes on the two micros worked well but, i am having second thoughts on the serial link .
3 wires between the two cannot be interrupted i,e if the link is pulled out and reconnected the count doesn't advance and both micros have to be reset.
after seeing this practical problem i suggest the solution in my second post with 12 pin connector or you can have display and counter on one single board and each one of these boards on each machinery.
let me know your opinion and don't worry about my time and efforts spent on this solution .
Arun
SVHANS
Jun 25 2008, 7:01 PM
Arun,
That looks great, thank you very much.
Is there no way that a serial interface can be made so that it can be disconnected then reconnected?
That looks great, thank you very much.
Is there no way that a serial interface can be made so that it can be disconnected then reconnected?
Arun Kumar V
Jun 27 2008, 7:32 AM
hi stu,
i' ll try my best to find a solution to this practical problem, there's no going back after bringing the project to this level !
Arun