# Help In My School Work...

Discussion in 'The Projects Forum' started by woon_h88, Mar 25, 2009.

1. ### woon_h88 Thread Starter Active Member

Mar 25, 2009
46
2
I need to come out with a design circuit that the the force sensor analog volt is at 3V there will be a LED light up...And also when its 3.5V another LED will light up...

This is my circuit i try to design use UA741 and 1 Xnor and 1 And gates...

The Xnor is for the 3V and the And gates is for the 3.5V...

When force is apply to the sensor, there will be a volt at the Ain...I tested the range is 0V to 5V...This is the link of the Force Sensor...
http://www.phidgets.com/products.php?category=2&product_id=1106

Sorry for my bad english....my teacher only give me a block diagram and ask me to design a circuit...I try to design it but i not really very sure is it going to work..>.< Can someone help if see...Pls tell me where i go wrong...Wish to learn from my mistake....Thank You...

2. ### beenthere Retired Moderator

Apr 20, 2004
15,815
282
An op amp and logic gates are not going to work. Look into voltage comparators, like the LM339. They are made to do that kind of sensing.

3. ### woon_h88 Thread Starter Active Member

Mar 25, 2009
46
2
Hmm...I will try use Lm 339 to design a circuit see see...But LM339 only have 1 Output...If its cant work with logic gate...Then Is there any ICs can have the same function as the logic gates?? Sorry...im dumb, i dont really know how to build a circuit from start..>.<

4. ### gotumal Active Member

Mar 24, 2008
99
0
You need to have two comparators. Feed one end end of each with the output of a force sensor; which is 0-5V. Tie other ends of comparator with fixed voltages to compare with; 3 and 3.5V in this case. LEDs can be driven directly from comparators.

Can add hysterisis if you want.

5. ### woon_h88 Thread Starter Active Member

Mar 25, 2009
46
2
Sorry Sorry...i try using a software (Circuit Maker) to test before use the practical work...no matter how i try, the output voltage always stuck at the range of 17mV to 18 mV...1st time using LM 339...the voltage comparator cant be use the same way as a op-amp?

6. ### beenthere Retired Moderator

Apr 20, 2004
15,815
282
No, the function is quite different, as is the pinout. By the way, I should have recommended the LM393 dual comparator.

Have you looked at the datasheet for a comparator? This is for the 393 - www.national.com/ds/LM/LM193.pdf

Last edited: Mar 25, 2009
7. ### SgtWookie Expert

Jul 17, 2007
22,182
1,728
LM393 would work fine for this application, but if the software our OP is using is Circuitmaker Student, it is not in the library, and it can't be added.

The LM339 is a quad comparator, meaning that there are four comparators in one IC package. If you select the LM339 comparator from the library and place it in a diagram, you will notice that the first instance will be U1A, the next U1B, etc. to U1D. Then it'll start over with U2A, U2B, etc.

The outputs of the LM339 are open-collector; that means the output can sink current, but cannot source it. So, connect the cathode of an LED to an output, and then a current limiting resistor (Rlimit) to +V.

The red LEDs in the library have a Vf (forward voltage) of 1.7v. I suggest using 15mA for the LED current.
Rlimit >= (Vsupply - Vf(LED)) / DesiredCurrent, so
Rlimit >= (5v - 1.7v) / 15mA = 3.3/0.015 = 220 Ohms.
This is lucky, as 220 Ohms is a standard value of resistance.
A table of standard resistance values can be found here: http://www.logwell.com/tech/components/resistor_values.html
The E24 values (green columns) are typically available to hobbyists.

You will need to use two of the four comparators in the LM339.

8. ### woon_h88 Thread Starter Active Member

Mar 25, 2009
46
2
This my latest Design i try...

The bottom comparator Vref is 2.7V+ and the Top comparator Vref is 3.3V+....Hope this is the right 1...I will try it out when i reach school...Thank For The Help...

9. ### SgtWookie Expert

Jul 17, 2007
22,182
1,728
You are getting close... BUT!
1) Your "Force Sensor" should have one side grounded, and the other side goes to both comparator inputs.

2) You want the LEDs to come ON when their respective voltage threshold is exceeded.
To turn the LEDs on, the comparator needs to sink current (go low).
This means the logic needs to be inverted. Your reference voltages (threshold) should be on the non-inverting (+) inputs, and the output from the force sensor on the inverting (-) inputs.

3) You selected LED0 from the library. This is an infrared LED with a Vf of 1.2v. You should have selected LED1 instead, which is a red LED with a Vf of 1.7v.

4) The resistors you selected result in incorrect reference voltages.
One reference voltage needs to be 3.5v, or 70% of 5v.
The other needs to be 3v, or 60% of 5v.
Can you calculate better standard values of resistance to use in order to make your reference voltages more accurate?
Here is a table of standard resistance values: http://www.logwell.com/tech/components/resistor_values.html
Use the E24 values (green columns).

Suggestion: current in the resistance divider should be somewhere between 0.1mA and 1mA; this is a total resistance value of 5k Ohms to 50k Ohms.
Hint: 5v, 3.5v and 3v are all divisible by 0.5.
Tip: if you cannot find the resistance value you need in the standard table, you can combine resistors in series and/or parallel. For example, if you needed a resistance of 500 Ohms, you could connect two 1k Ohm resistors in parallel, or 200 and 300 Ohm resistors in series, or many other combinations.