Arduino Nano 33 IoT Common Ground

Hello,

I am working on the Light detector combined with op-amplifier.

Op-AMP is AD623ANZ which has 8 pins.

(Image insert is not working)

Above is the pinout of AD623ANZ.

Below diagram is my full schematic of my circuit.

(Image insert is not working)

And the Arduino code I wrote down is as below.

// the setup routine runs once when you press reset:
void setup() {
 // initialize serial communication at 9600 bits per second:
 Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
 // read the input on analog pin 0:
 float sensorValue = analogRead(A0);
 float potentiometerValue = analogRead(A1);
 float amplifiedValue = analogRead(A2);
 // print out the value you read:
 Serial.print("raw value: "); // print it
 Serial.println(sensorValue);
 
 Serial.print("potentiometer value: "); // print it
 Serial.println(potentiometerValue);

 Serial.print("Gain is: ");
 Serial.println(amplifiedValue/(potentiometerValue-sensorValue));
 
 Serial.print("amplified value: "); // print it
 Serial.println(amplifiedValue);
 delay(1000);        // delay in between reads for stability
}

So basically, A0 is Vout from the photoresistor, LDR. A1 is Vout from potentiometer and A2 is Vout from the OP-AMP.

If I connect all the wires and upload the code into Arduino UNO, it perfectly reads all the signals and shows how the light detection varies along with the light condition.
However, if I only change from Arduino UNO to Arduino NANO 33 IoT, all analog inputs are oscillating and reading totally different values from Arduino UNO (I got negative gain).

(Image insert is not working)

I just hooked up Supply voltage to 3.3v pin (Second pin from left top) and ground to GND Pin (Second pin from left bottom) of Arduino Nano 33 IoT. And A0, A1, A2 respectively.

Many answers for similar problems say that it is because of common ground in the circuit.
However, I am not 100% sure what that means and how actually I can fix it.

Please advise me guys!

Thanks
Best

AD623ANZ.jpg

Hi,

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
NOT a fritzy picture.

Thanks.. Tom... :slight_smile:

Hi,
You are best to attach then insert your images into your post.
OPs pictures
AD623ANZ.jpg

What gain do you expect from the op-amp without any feedback components?
Tom... :slight_smile:

AD623ANZ.jpg

TomGeorge:
What gain do you expect from the op-amp without any feedback components?
Tom... :slight_smile:

Actually, I didn't connect any resistor between OP-AMP pin 1 and 8 "yet"
Even without gain, as the Arduino Nano board cannot read the analog inputs, I did not include it.

If analog inputs circuits are not the problem, it should be something related to the voltage out and ground of arduino nano 33. Thus, more essential question to me for now is why I can power up and ground the breadboard with Arduino UNO but not with Arduino Nano 33 IoT. (Or maybe the other reason)

Hi,

Tom... :slight_smile:

Hi,
Have you written a simple bit of code to JUST read the pot and see what you get?

Is the Opamp happy with 3.3V supply?

Tom... :slight_smile:

TomGeorge:
Hi,

Tom... :slight_smile:

I have uploaded corrected schematic. Yes it should be definitely connected to the GND and Vcc
But still, I cannot insert the attached images. I do not have that icon.

TomGeorge:
Have you written a simple bit of code to JUST read the pot and see what you get?

Is the Opamp happy with 3.3V supply?

Hi Tom,
could you be more specific about what "the pot" means?
And yes. Op-amp I am using takes 3.3V supply

Thanks
SJ

TomGeorge:
Hi,
Have you written a simple bit of code to JUST read the pot and see what you get?

Is the Opamp happy with 3.3V supply?

Tom... :slight_smile:

Any more comments? :frowning:

SJ

jjunki20:
could you be more specific about what "the pot" means?

Pot == Potentiometer..
See if you can read the pot with a simple bit of code.
Thanks.. Tom...

Hi,
If you look here and in sections 8 and 9, they will show you how to insert an image.

http://forum.arduino.cc/index.php/topic,148850.0.html.

Thanks.. Tom... :slight_smile:

TomGeorge:
Pot == Potentiometer..
See if you can read the pot with a simple bit of code.

With Arduino UNO, I can read all three analog inputs.
But with arduino Nano 33 IOT, all three inputs are oscillating. And even I change the pot, it is just fluctuating within the same range

1k pull up for the LDR is for strong sunlight.
You might not need amplification if you use the right value pull up resistor.
What are you measuring.

Seems you didn't power the op-amp (+Vs is grounded),
and you did leave gain at 1x (no resistor, no amplification).
But Fritzing is toddler art, and usually misleading in the hands of a beginner.
Learn to draw real circuit diagrams, with pencil and paper.

Did you look at the input common mode ranges at 3.3volt supply.
The LDR/amplifier might not do what you hope it will do.
Leo..

Hi,
Can you post a picture of your project please?
What voltages do you measure on the analog pins of the 33?

Any more comments? :(

I seem to be the only time zone awake.

Thanks.. Tom.... :slight_smile:
Oops. So is @Wawa

TomGeorge:
Hi,

Tom... :slight_smile:

This is why I hate Pretty (useless) Fritzing pictures.
A hand drawn schematic on the back of an envelope is far superior to any Fritzing picture.