20mV DC to ~5V DC - Page 1
Forum section: electronics / beginners

author: Saulius
author_rank: Newbie
timestamp: January 05, 2016, 11:33:37 pm
content: Hello, Very green electronics guy here XDCan I use some opamp to boost 20mV signal to 5V and than send these 5V directly to an arduino? If yes do you have any suggestions for what opamp would suit best for this application? Or maybe I should use an inamp or some other device?Thanks

author: djacobow
author_rank: Super Contributor
timestamp: January 05, 2016, 11:40:38 pm
content: Quote from: Saulius on January 05, 2016, 11:33:37 pmOf course you can... in general.Quote from: Saulius on January 05, 2016, 11:33:37 pmUnfortunately, you have told us nothing about your application, so it's hard to make a circuit recommendation. What is the signal source? Is this a differential signal? What is the source impedance? What frequency range and bandwidth are we talking about? Does it need to go to DC? What are your noise requirements?Wiring up an ordinary, cheap (or fancy, pricey) opamp (or maybe better, two) for a total of 250x gain is not a big deal, but it might not work for your app, depending...

author: bugs
author_rank: Contributor
timestamp: January 05, 2016, 11:48:44 pm
content: I think you have to be a bit more specific. What is the application? What is the signal or sensor you want to use? What do you want to do with it? What is your power source / what voltages do you have?Perhaps you already know some part numbers?What you now ask is the equivalent of: What tires do I need for my car, it's red.

author: Saulius
author_rank: Newbie
timestamp: January 06, 2016, 02:15:14 am
content: Quote from: bugs on January 05, 2016, 11:48:44 pmThanks for reply,The signal is from the force gauge. After certain force threshold is reached the signal jumps from 0 to 20mV and stays at 20mV until the force goes down below the threshold, than the signal drops back to zero again.It's going to be used in the laboratory press to control the applied force.

author: Falcon69
author_rank: Super Contributor
timestamp: January 06, 2016, 02:19:28 am
content: i am guessing this is part of his other thread "A simple delay circuit". Someone in that thread mentioned to him that he should use an MCU like an Arduino or something. Perhaps changing the 20mV to ~5volt is easier to interact with the Arduino?

author: AlfBaz
author_rank: Super Contributor
timestamp: January 06, 2016, 02:27:16 am
content: Quote from: Saulius on January 06, 2016, 02:15:14 amSounds like a job for a comparator.

author: bugs
author_rank: Contributor
timestamp: January 06, 2016, 08:47:52 am
content: We are getting closerDo you have a part number for the pressure gauge?Having a 20mV on-off signal sounds strange. Perhaps it is an open-collector? Did you try a 10k pullup to 5v on it?

author: Psi
author_rank: Super Contributor
timestamp: January 06, 2016, 08:58:56 am
content: I guess if you had an 'Arduino Mega 2560' you could put the ADC into differential mode with the gain set to x200.Then feed the signal straight into the arduino with no opamp or anything.Might need a voltage divider as well. Im not sure how well differential mode works at the rails.Also not sure if the arduino library supports changing the adc gain.

author: andybarrett1
author_rank: Regular Contributor
timestamp: January 06, 2016, 08:23:23 pm
content: If the 20mA is just a simple on/!off control why not use it to saturate a transistor2n2222 or maybe even a fet 2n7000

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 06, 2016, 09:07:01 pm
content: Are we quite sure that the sensor isn't a 4-20 mAloop device?At any rate, if the sensor signal is indeed just going from 0 to 20 mV, then it is trivial to implement this using a LM358 op-amp as comparator. Feed the op-amp with regulated voltage from a 78L05 regulator. Make a voltage divider of 100K and 401R, from Vreg to Gnd, and feed the 20 mV reference signal from this divider into the inverting input of one of the op-amps in the 358. Feed the sensor signal voltage into the non-inverting input. The output will then flip from Low to High when the input signal exceeds the reference voltage from the divider. This output signal can then be read easily by the Arduino, using either an analog or digital input pin. Then the Arduino can do whatever is needed as far as switching mosfets or transistor+relay or whatever.

author: Seekonk
author_rank: Super Contributor
timestamp: January 06, 2016, 10:01:40 pm
content: You started out asking for a simple delay. Everyone starts out saying they want ato device to just do this. I have a simple pholosiphy, The customer is always wrong.This is not to be rude, the customer just does not see the total system. Trippingat 20mv sounds simple, but on that signal there is noise. Amplifying that signal allowsyou to filter out higher frequency noise and get a voltage level a microprocessor canuse. Averaging over several A/D readings gives a more reliable value. Any amplifieroffset can be subtracted out in software and the range can be linearized if that isneeded. Latching, delays and timed periods are easily set up in software. More important,they are easily changed when what you thought you wanted isn't what you wntede at all.What you appear to want isn't simple. Those here that are capable of doing an all hardwaredesign are unlikely to put that much effort into giving a turnkey design. Learning towrite some simple Arduino software is your best chance of completing this project.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 06, 2016, 10:26:51 pm
content: While I agree with most of that... here's some evidence that the LM358 can do the trick.Without even using a trimmer, just fixed resistor values in the divider for the inverting input of the LM358N, I was able to achieve the results below, highly repeatable.Fluke DMM indicates "signal" voltage (from PSU through another divider). Discriminability is OTOO 0.2 mV, hysteresis about the same. A more accurate tripping closer to 20.0 mV can be achieved by using a trimpot finely to adjust the setpoint divider, if actually needed.(Pay no attention to the green paper. It is covering up another circuit on the same breadboard, not in use or powered for this test.)

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 07, 2016, 12:11:05 am
content: Here, I give you this for nothing. What can I say... it works. At least it does what I think Saulius wanted in that other thread.The sketch waits for the signal at Pin 7 to go from Low to High ( connected to the Output of the LM358n comparator) then it pulses an output for 100 ms (or whatever length of time is desired) then pauses for one second (or whatever) then pulses the output again, and goes back to waiting for another transition from Low to High on the comparator output.Code:/*---------------------------------------------------------------------------//simple timer program to work with LM358n comparator circuitto trigger relay or mosfet when 20 mV signal level is reached//---------------------------------------------------------------------------*/int relayOn = 100; // set relay ON time in ms hereint pause = 1000; // set pause in ms between relay actuations herevoid setup() {pinMode (10, OUTPUT); // connect relay driver or mosfet Gate herepinMode (7, INPUT); // connect Output from comparator here}void loop() {while (digitalRead(7)==LOW) {// do nothing, wait for signal to go HIGH}// when signal goes High, actuate relay for relayOn timedigitalWrite(10, HIGH);delay(relayOn);digitalWrite(10, LOW);delay (pause); // pausedigitalWrite(10, HIGH); // actuate relay again for relayOn timedelay(relayOn);digitalWrite(10, LOW);while (digitalRead(7)==HIGH) {// do nothing, wait for signal to go LOW again to reset cycle}}