Go Down

Topic: Arduino Nano 33 IoT Common Ground (Read 152 times) previous topic - next topic

jjunki20

Aug 03, 2020, 04:37 am Last Edit: Aug 03, 2020, 05:16 am by jjunki20
Hello,

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

Op-AMP is AD623ANZ which has 8 pins.


https://ibb.co/MRpfKD3
(Image insert is not working)

Above is the pinout of AD623ANZ.

Below diagram is my full schematic of my circuit.


https://ibb.co/Hq9sVJd
(Image insert is not working)

And the Arduino code I wrote down is as below.

Code: [Select]
// 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).


https://ibb.co/9tLVsyh
(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

TomGeorge

#1
Aug 03, 2020, 04:43 am Last Edit: Aug 03, 2020, 04:43 am by TomGeorge
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... :)
Everything runs on smoke, let the smoke out, it stops running....

TomGeorge

#2
Aug 03, 2020, 04:47 am Last Edit: Aug 03, 2020, 04:51 am by TomGeorge
Hi,
You are best to attach then insert your images into your post.
OPs pictures



What gain do you expect from the op-amp without any feedback components?
Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

jjunki20

#3
Aug 03, 2020, 04:50 am Last Edit: Aug 03, 2020, 04:52 am by jjunki20
What gain do you expect from the op-amp without any feedback components?
Tom... :)
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)

TomGeorge

#4
Aug 03, 2020, 04:54 am Last Edit: Aug 03, 2020, 04:54 am by TomGeorge
Hi,


Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

TomGeorge

#5
Aug 03, 2020, 04:58 am Last Edit: Aug 03, 2020, 05:00 am by 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... :)

Everything runs on smoke, let the smoke out, it stops running....

jjunki20

Hi,


Tom... :)
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.

jjunki20

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

jjunki20

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... :)


Any more comments? :(

SJ

TomGeorge

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...
Everything runs on smoke, let the smoke out, it stops running....

TomGeorge

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... :)
Everything runs on smoke, let the smoke out, it stops running....

jjunki20

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

Wawa

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..

TomGeorge

#13
Aug 03, 2020, 07:23 am Last Edit: Aug 03, 2020, 07:24 am by TomGeorge
Hi,
Can you post a  picture of your project please?
What voltages do you measure on the analog pins of the 33?

Quote
Any more comments? :(
I seem to be the only time zone awake.

Thanks.. Tom.... :)
Oops. So is @Wawa
Everything runs on smoke, let the smoke out, it stops running....

SteveMann

Hi,


Tom... :)
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.
I am usually so far out of the box that most people don't know what I am talking about.

Please do not ask for help by PM. I will not respond.
If you need help, post a question on the appropriate forum.

Go Up