Pages: [1]   Go Down
Author Topic: Comparators  (Read 803 times)
0 Members and 1 Guest are viewing this topic.
Kuala Lumpur, Malaysia
Offline Offline
Full Member
***
Karma: 0
Posts: 106
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What are comparators?
Logged

arduino-freelancer.blogspot.com

Montreal
Offline Offline
Faraday Member
**
Karma: 30
Posts: 2610
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are google and wiki. smiley-cool
In short comparators are device to compare
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34725
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Two types digital and analogue.
1) Digital two groups of four bits input. When the binary value is the same on both the equals output goes high. There is also a greater than and less than output, these can be cascaded to any width you want.
2) Analogie or voltage comparator, two inputs if the + one is higher than the - one the output is high otherwise it is low.
Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Like Grumpy_Mike said. The digital type and the analogue type. I don't know what type you want to know, but if you mean analogue... Well it basically two Voltage divider and one op-amp.   

Here is example:  +5 V -- 10 K ---to "plus" side of op-amp ---- 10 K -- GND  <--- V1 is 2.5 V
                         +5 V  -- 47 K --- to "minus" side of op-amp --- 10 K  --- GND <--- V2 is 0.877 V
  The op-amp output will be a HIGH or + 5 V  <--- hope I am right.

Use a LM339  <----- It will work.  BUT do not use the following... LM741, LF071, LF072, LM1458 ... they did not works. I try. My raison is they need  dual power ( plus / GND / minus ). The LM339 do not need dual power only one. ( plus / GND )

Analogue comparator are usefull if you need two state ( HIGH or LOW ) 
Logged

Kuala Lumpur, Malaysia
Offline Offline
Full Member
***
Karma: 0
Posts: 106
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Above is the internal circuit of the LM339. I want to compare 2 inputs, I will put the Higher Voltage on +Input 1 and the Lower Voltage on -Input 1. Do I need to connect VCC and Ground to 5V and GND from the Arduino? The Output 1 will be HIGH, right?
Logged

arduino-freelancer.blogspot.com

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34725
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do I need to connect VCC and Ground to 5V and GND from the Arduino?
Yes.

Quote
The Output 1 will be HIGH, right?
Yes BUT this has an open collector output, that means you have to have a pull up resistor from the output to the +5. This can either be a real resistor (about 3K3) or the internal pull resistors in the arduino. (enable them with a digitalWrite HIGH once you have defined the pin as an input)
Logged

Pages: [1]   Go Up
Jump to: