View previous topic :: View next topic |
Author |
Message |
delene
Joined: 13 Oct 2003 Posts: 32
|
read change of voltage from 24v to 12v |
Posted: Mon Jul 16, 2007 12:15 pm |
|
|
How do I read a change of state when the voltage is changing from 24v to 12v and not from 24 to 0v.
When the voltage changes to 0v I can read the change of state without a problem. In this application the voltage changes from 24v to only about 12v. How do I read this change of state?
All help greatly appreciated
Delene |
|
|
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Mon Jul 16, 2007 12:56 pm |
|
|
You could use a 18-volt Zener diode. It will pass current only when the voltage is above 18 volts. Then run that current into a fairly large resistor to generate a voltage 0-12volts. Then limit the current into a digital input on the PIC with a series 100k resistor. Total number of parts: 3.
Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 16, 2007 1:01 pm |
|
|
1. What device is producing this signal ?
2. Is it a DC or an AC signal ?
3. What's the purpose of reading the signal ?
4. Do you want to read the signal with the A/D module, or the
comparator module, or with just an ordinary PIC i/o pin ?
5. What PIC are you using ? |
|
|
delene
Joined: 13 Oct 2003 Posts: 32
|
|
Posted: Mon Jul 16, 2007 2:22 pm |
|
|
The zeneir diode sounds interesting - I will do some investigations into it - thanks Robert.
What PIC are you using ?
I am using a 16f877A or 18f452.
What's the purpose of reading the signal ?
The application is for connecting to a belt weigher. The belt weigher generates a signal that to represent a 1 ton being weighed. I need to count the number of tons and turn it into a readable value for my customer.
Do you want to read the signal with the A/D module, or the
comparator module, or with just an ordinary PIC i/o pin ?
I was using an ordinary i/o pin and would rather use this, as I have boards designed for this purpose. But am desparate and am willing to try all other options
Is it a DC or an AC signal ?
DC
What device is producing this signal ?
Do not know the exact part name/relay - will have to come back to you.
Why what are you suggesting?
Many thanks |
|
|
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Mon Jul 16, 2007 6:18 pm |
|
|
delene wrote: | ...The belt weigher generates a signal that to represent a 1 ton being weighed. I need to count the number of tons and turn it into a readable value for my customer....
|
This sounds like an analog signal. Doesn't it register fractions of a ton too? Then you need to treat this as an analog signal. Divide the voltage down to the Vcc range of your PIC with a resistive divider and then use an analog input to read it.
Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Tue Jul 17, 2007 8:38 am |
|
|
Be sure to read the spec. sheet on the MAX value that can be input into the PIC. Calculate your voltage divider carefully so you don't exceed the MAX value into the PIC or the magic smoke may very well leak out.
Ronald |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Jul 17, 2007 10:45 am |
|
|
Can you post the driver circuit "belt weigher"? |
|
|
delene
Joined: 13 Oct 2003 Posts: 32
|
|
Posted: Tue Jul 17, 2007 10:53 am |
|
|
Thank you all for your help, but possibly the problem has been solved.
I will know for definite tomorrow. When it is tested further.
We connected at TLP512 - as a sort of opto isollator. This is then connected to my input pin. I ran it for most of today and it seems right. Tomorrow it is going to be tested properly. Will keep you posted |
|
|
|