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 support@ccsinfo.com

About HF-Pulse Sensor

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



Joined: 16 Apr 2011
Posts: 6

View user's profile Send private message

About HF-Pulse Sensor
PostPosted: Sat Apr 16, 2011 2:14 am     Reply with quote

Hi Everyone,
There is a pulse sensor attached in the picture. This sensor is connected to a gas meter and I do not want to count pulses pulse sensor on the LCD screen using pic 18f452. About the hardware, sample code, and I need to do to me Can you give an example. The picture is a red question mark over how to do a circuit. proteus show me if possible with the drawing.

temtronic



Joined: 01 Jul 2010
Posts: 9149
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Apr 16, 2011 2:09 pm     Reply with quote

? circuit is a very simple zero cross / level shifter needed to convert the +8 volt signal to TTL compatible level +5 V.
ANY book about opamps will have this circuit for you or google 'op amp comparator'.even the lowly 741 will do,just have a voltage divider on the output to make it TTL compatible( say 3K on the output in series with a 5k to gnd.

Not sure what you're supposed to do. You say you do not want to count pulses but that is what the sensor gives !!!
boybeyiv



Joined: 16 Apr 2011
Posts: 6

View user's profile Send private message

PostPosted: Sat Apr 16, 2011 2:39 pm     Reply with quote

We also check the Google. But there is more than one circuit diagrams and descriptions. I could not decide which of the circuit fits my my project. Can you give an example circuit diagram.
necati



Joined: 12 Sep 2003
Posts: 37
Location: istanbul

View user's profile Send private message

mpu
PostPosted: Sat Apr 16, 2011 2:57 pm     Reply with quote

magnetic pick up amplifier
temtronic



Joined: 01 Jul 2010
Posts: 9149
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Apr 16, 2011 5:00 pm     Reply with quote

Learn by doing. Grab a breadboard, ANY opamp(I used LM324), 2 resistors( those I suggested, though even a 4k7 and 10 k will do), download a 'opamp comparator' diagram and see what happens !
There's less than 10 connections to make, 4 components(5 if you include a 9 volt battery).
In less time than it's taken me to type this reply(should have learned touch typing in high school, back in 1968) I breadboarded what I've suggested and made it work fine.Total cost less than a dollar,total time less than 20 minutes,which includes cutting PIC code to display speed of sensor on an LCD.
boybeyiv



Joined: 16 Apr 2011
Posts: 6

View user's profile Send private message

PostPosted: Sun Apr 17, 2011 1:49 am     Reply with quote

I drew the following circuit according to the information I found on Google. I wonder do I correct?



Ttelmah



Joined: 11 Mar 2010
Posts: 19295

View user's profile Send private message

PostPosted: Sun Apr 17, 2011 2:45 am     Reply with quote

Not quite.

The problems relate to understanding what they show, and what is needed. They show the unit driving a unity gain buffer amplifier. For this, the second input on the amplifier can be connected to 0v, and the output will match the input. However the output will not give the swing needed to drive the PIC.
With an actual op-amp though, giving voltage gain, the -ve input needs to be biased to a voltage inside the range that the unit swings.
If you look at the waveform, the unit is shown giving a voltage swinging at least between 1.2v, and 2.1v. This is all that is guaranteed. So to generate an output, the -ve input of the LM324, needs to be biased to a voltage between these values. Say a 1.5KR resistor from the -ve input to 0v, and a 3.3KR resistor from the -ve input to 5v. This brings the -ve input pin to a nominal 1.5625v, and a square wave output will result with enough swing to drive the PIC.

Then you don't need a pull up resistor on the LM324 output.

However, it will be worth adding a tiny amount of hysteresis to the circuit. put a resistor inline from the input to the +ve input pin. Say 1KR. Then have a 5MR resistor from the LM324 output, back to the +ve input pin. This now ensures that when the output swings 'high', the input pin is fractionally pulled up, and when it swings low, fractionally pulled down, preventing oscillation, and helping to ensure that slow switching transitions are handled correctly. Only a couple of mV, but it should clean things up significantly.

Best Wishes
boybeyiv



Joined: 16 Apr 2011
Posts: 6

View user's profile Send private message

PostPosted: Sun Apr 17, 2011 4:54 am     Reply with quote

I'm sorry, I do not know too much about it. Marked with a red square somewhere, I could not find how to do an op-amp circuit. I have read dozens of articles, but there is no basis for Google also did not understand exactly explained.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Apr 17, 2011 10:14 am     Reply with quote

Your circuit has a wrong current threshold and won't work. As Ttelmah explained, the -ve OP input (pin 2 in your schematic) need to be connected to a voltage divider rather than to ground. Adding positive feedback to create a hysteresis is another suggestion, but it's not absolutely required.
temtronic



Joined: 01 Jul 2010
Posts: 9149
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Apr 17, 2011 11:28 am     Reply with quote

Another option is to just hook it up as the schematic says..
Then read the ADC pin.Compare to Ul and Uh parameters and do whatever you want.
In this case that simple opamp may not be required, or at most turn it into a voltage follower.

Another option...
If the PIC you're using has a 'voltage comparator' peripheral, you could do that as well...

So now you have 4 ways to read the signal....
boybeyiv



Joined: 16 Apr 2011
Posts: 6

View user's profile Send private message

PostPosted: Sun Apr 17, 2011 2:41 pm     Reply with quote

Hello everyone,

The software is a good think about the preparation. but I do not know much about the hardware preparation. Therefore, the sensor request information about the first mail I wrote I have found the information. Dear friends, taking into account the recommendations of the research and tried to learn. Can not go to the point where I must confess that I want. However, a circuit diagram of an example or an example of reference had been given a project could have a faster way. Op-amp circuit when there is initially only found out that now four different methods, but which I do not know how to handle that. Waiting for advice and solutions to other members of the proposal. Thank you in advance for the help you provide.
boybeyiv



Joined: 16 Apr 2011
Posts: 6

View user's profile Send private message

PostPosted: Tue Apr 19, 2011 11:18 am     Reply with quote

In another forum, I asked the question related to this sensor, the sensor can not read the pic with the processor, respectively.

How do I connect this sensor PIC processor. Do not have a friend give a circuit diagram?
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Apr 19, 2011 6:11 pm     Reply with quote

You need to read about how basic op amps and comparators work. A little time on this basic education will do you a world of good.

Do you know how to use Ohm's law to find the output voltage of your sensor?
_________________
The search for better is endless. Instead simply find very good and get the job done.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Apr 20, 2011 12:38 am     Reply with quote

The required modification of your circuit has been exactly given in the previous posts.
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