Need help to amplify a signal of 250mv to 5v

Thread Starter

ktt858

Joined Nov 12, 2020
5
Hello,
I need help to create a simple circuit to amplify a small signal of 300mv to 5v so I can read it from the Arduino.
The signal comes from a camera hotshoe. Everytime the camera takes a picture, this signal goes from 0v to about 300mv, and back to 0v after the picture has been taken.
I tried using this board, https://www.amazon.com/LM-YN-Millivolt-Amplifier-Instrumentation/dp/B01MRJKY2V to amplify my signal. It did not seem to work at all i.e. output voltage is always at 4.8v. Could you suggest a simple circuit?
Thank you so much for your help.
Kiet
 

dl324

Joined Mar 30, 2015
13,142
Welcome to AAC!

You don't need an amplifier. You just need a comparator. I'll post a circuit for you shortly.

Is there a reason why you didn't consider reading the 300mV signal with an analog input?

This circuit will output 5V when the shoe input is above 0.2V:
1605231766810.png
The LM339 will operate from the 5V supply. You need to put a decoupling cap on the power pins.
 
Last edited:

Thread Starter

ktt858

Joined Nov 12, 2020
5
Hi Dennis,

Thanks for the reply. I tried to read 300mv on one of the analog pins of the Arduino, but it was not reliable. One of the problems which I encountered was as soon as I connected my circuit to the Arduino, the voltage at the analog pin (where I was supposed to read my 300mv input) jumped from 0v to 400mv with the input signal at 0v. I am not sure what caused this jump. That is why I decided to amplify the input signal instead.

Regards,
Kiet
 

dl324

Joined Mar 30, 2015
13,142
That is why I decided to amplify the input signal instead.
The circuit I posted isn't an amplifier; it's a comparator. When the shoe voltage is above about 0.2V, the output will be 5V. When the voltage is lower than that, the output will be 0V.

The threshold voltage is determined by the voltage divider of R1 and R2 and assumes a stable 5V supply.
\(V_{thresh}=5V*\frac{R2}{R1+R2}=5V*\frac{420}{10420}=0.20V\)
 

djsfantasi

Joined Apr 11, 2010
7,842
Hi Dennis,

Thanks for the reply. I tried to read 300mv on one of the analog pins of the Arduino, but it was not reliable. One of the problems which I encountered was as soon as I connected my circuit to the Arduino, the voltage at the analog pin (where I was supposed to read my 300mv input) jumped from 0v to 400mv with the input signal at 0v. I am not sure what caused this jump. That is why I decided to amplify the input signal instead.

Regards,
Kiet
There is a trick to using an analog input on an Arduino. It’s buried in the documentation and most users miss it.

Before you get a reliable input from an analog pin, you have to read it twice. And throw away the first result. You’ll get much more reliable data that way.

You don’t always need to do a double read, but if the operation isn’t too expensive in your application, you just might as well always do a double read.

It’s an initialization problem with the internal ADC on Arduinos. Let’s say you only use one analog pin. Then, include the throwaway read in setup().

But the Arduino has several analog pins (the actual number depends on the model of the Arduino you’re using). Every time you read a different analog pin, you need to include the double read. That’s because the internal ADC shares some components with the other pins. So every time you use a different pin, you need to initialize the ADC with a double read.

In your application, you are only using one pin. So including the throw-away read in setup() when you initialize the analog pin should be sufficient.

Plus, using a 5V reference gives you ~5mV accuracy. So 0V should return a value near 0; 300mV should return a value near 60. You have some headroom there. A read returning a value <50 means no picture. A value >50 means that a picture has been taken.

You can also implement a rolling average of the results, which will stabilize your readings.

Hope you find this helpful.
 

Thread Starter

ktt858

Joined Nov 12, 2020
5
Hi Dennis,
Thanks again for the comparator circuit. This is exact what I need. I will give it a try.

Regards,

Kiet
 

Thread Starter

ktt858

Joined Nov 12, 2020
5
Hi djsfantasi,
Thank you for your suggestion. I will be sure to incorporate the double read logic into my sketch. The problem I encountered however is that the voltage on the analog pin would suddenly jump from 0v to 300mv when I applied power to the Uno board (even when the voltage from the camera hotshoe is 0v). Since it was already at 300mv, an analogRead on that pin always returned a value greater than 50. I tried other analog pins, and they all give me the same problem. I wonder if the Uno is at fault, or I have too much interference. Any suggestions?

Regards,

Kiet
 

Beau Schwabe

Joined Nov 7, 2019
100
Alternatively you could do something like this. The Caveat is that it takes about 1 second for the 10uF Cap to charge, and as long as you check the input within half a second of the 200mV trigger this circuit should do what you want.
 

Attachments

LesJones

Joined Jan 8, 2017
3,498
With the schematic provided by Dennis in post #2 why do you want to feed it to an analogue input on the Arduino ? Feeding the output of the comparator to a pin configured as a digital input on the Arduino would make the software simpler and the response faster.
If your Arduino is one one that uses the ATmega328P chip that contains a single analogue comparator that could be used in place of an external LM393N

Les.
 
Last edited:

andrewmm

Joined Feb 25, 2011
1,757
I suggest you sort out the voltage changing when you connect the Arduino problem,
its likely that an amplifier / comparator will at best confuse the problem, at worse amplify the problem,

One other thought,
hot shoes on cameras in the old days always used to be opto isolate into the computer .
 

Kjeldgaard

Joined Apr 7, 2016
453
Can it be true that a Camera Hotshoe signal is only 300 mV?

If it's just a fairly new camera, I'd rather believe in a 3 Volt signal - something with a power supply from a Lithium battery.
 

djsfantasi

Joined Apr 11, 2010
7,842
Hi djsfantasi,
Thank you for your suggestion. I will be sure to incorporate the double read logic into my sketch. The problem I encountered however is that the voltage on the analog pin would suddenly jump from 0v to 300mv when I applied power to the Uno board (even when the voltage from the camera hotshoe is 0v). Since it was already at 300mv, an analogRead on that pin always returned a value greater than 50. I tried other analog pins, and they all give me the same problem. I wonder if the Uno is at fault, or I have too much interference. Any suggestions?

Regards,

Kiet
I assume that’s without the double read. What happens when you throw away the first result?
 

Thread Starter

ktt858

Joined Nov 12, 2020
5
Hi all,
Thanks again for your help.
Beau Scwhabe: Thanks for your circuit. 0.5 seconds delay would be too long for my application. I am reading the input voltages at a higher rate with about 50micro second delay in between.

LesJones: You are right. If the output voltage is 5V, I would certainly read it from one of the digital pins instead. This would make the code much easier.

Kjeldgaard, andrewmm: The attachment is the voltage measured between the center pin and ground of the hotshoe when I took an 8sec exposure. As long as the mirror stays open, this voltage reads at 563mv. When the mirror is closed, it goes back to 0v. My camera in Nikon D800.

Dennis: From the circuit which you provided, I can change R2 to a pot so I can configure for different input voltage. Is this correct?

Thanks,

Kiet
 

Attachments

dl324

Joined Mar 30, 2015
13,142
From the circuit which you provided, I can change R2 to a pot so I can configure for different input voltage. Is this correct?
Yes. I'd insert a resistor between the pot and ground so you can't set the threshold voltage too low. From your original requirements, you wanted to detect 300mV, so I set the voltage at 200mV to give you some noise immunity.
 

LesJones

Joined Jan 8, 2017
3,498
The circuit Dennis provided will give yo a 5 volt swing on it's output. In post #13 Andrewmm told you that the hot shoe is designed to behave like a switch contact between tne metal of the hot shoe and the pin. The link he provided to wikipedia confirms this is still the case with modern cameras but the switching is done electronically. If you connect a pullup resistor (Say 10K) between the pin on the hot shoe and +5 volts you should get a voltage transition from 0 to close to +5 volts. This should drive a digital input pin directly. (Or an analogue input as you seem to want to that for some reason that you have not explained.)

Les.
 

Beau Schwabe

Joined Nov 7, 2019
100
Thanks for your circuit. 0.5 seconds delay would be too long for my application. I am reading the input voltages at a higher rate with about 50micro second delay in between.
You misinterpreted what I was trying to say.... Let me say it a different way. If you wait longer than 0.5 seconds to read the pin, then what you read could be invalid.

However if Les is correct in his assumption from post #16, then this is all a moot point anyway and you should use a different approach.
 
Top