CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

read change of voltage from 24v to 12v

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
delene



Joined: 13 Oct 2003
Posts: 32

View user's profile Send private message Send e-mail

read change of voltage from 24v to 12v
PostPosted: Mon Jul 16, 2007 12:15 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 16, 2007 12:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 16, 2007 1:01 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 16, 2007 2:22 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 16, 2007 6:18 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jul 17, 2007 8:38 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Tue Jul 17, 2007 10:45 am     Reply with quote

Can you post the driver circuit "belt weigher"?
delene



Joined: 13 Oct 2003
Posts: 32

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 17, 2007 10:53 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group