I am doing this project without the multimeter and everything is fine, except for the pump. I have been working on this for hours and when I thought my about giving up, i unclipped by alligator wires from the sensor and all of a sudden the pump started working fine. For context the sensor I made works fine with the calibration code that was given. I will attach a picture of my breadboard, arduino, and code. Is there anything wrong with my breadboard? I've been looking at the diagram for hours and cant seem to get the pump to work the way I want to
Attachments
IMG_7350.jpg (1.85 MiB) Viewed 121263 times
Screenshot 2024-01-07 235911.png (122.97 KiB) Viewed 121263 times
Hi - at a glance, if you were following our breadboard diagram exactly then your MOSFET is backwards and that will prevent the pump from working properly. In the last picture you uploaded, the large metal tab on the MOSFET is facing to the right. It should be facing to the left. I can see how this might not be totally clear from the 2D diagram in Figure 6 in the project, and the MOSFET appears pretty small in Figure 7, so I will add a note to the instructions clarifying this. Let us know if that fixes your problem.
edit - just realized this is already included in the written instructions. See step 2e: "Put the MOSFET in the breadboard with the large metal tab facing to the left, and the writing on the front facing to the right. Each pin on the MOSFET should be in a different row of the breadboard." Again please let us know if that solves your issue.
I got the pump to work! but after the pump turns off after reaching the threshold, the serial monitor on the arduino code doesn't stop, so i cant copy and past anything.
You should be able to turn off the "autoscroll" option in the serial monitor which enables you to copy and paste more easily. I think you can also just unplug the USB cable and it will stop printing.
I just had to switch around the alligator cables that were connected to the pump. I copied everything from the serial number into google sheets, but how do I add the time into the sheets so I can correctly make a graph? I have about 6000+ rows of numbers in my google sheets, is that normal or no?
The data you copied from the serial monitor should already include a time stamp with numbers that look something like 20:39:10.723. That's hours (24-hour format), minutes, and seconds. You should be able to use that directly, but you could make the data neater by making a new column in your spreadsheet and calculating time in seconds starting at zero (this may require some looking into how time formats work in your spreadsheet program and using them in equations).
And yes, since the data prints to the serial monitor pretty quickly, depending on how long you run the experiment you can easily get hundreds or thousands of data points. You can slow down the data collection and get fewer data points by using longer delays in the program.
There is a "toggle timestamp" button toward the right side of the serial monitor, it looks like a little clock (I am running version 2.2.1 of the IDE).
For longer delays you would need a "delay(x)" command inside the program's main loop, where "x" is a number in milliseconds (for example, you would enter 10 for 10 milliseconds). Note that the disadvantage to adding a delay like this is that there's a delay before each new sensor reading, so your pump might not stop as quickly when you reach the threshold.
I forgot to respond last night, but that worked and I made my graph. I realized that the pump stopped a little bit before it reached my threshold by about 50. Was this because of the delay command I added? I'm at the step on how to improve the model but I am not sure what I should do. I can't change the pump speed since in the code I have it at the max, so how can I improve the model?
Hi - we don't want to give away exact answers for how you could improve your model, as thinking of that is part of the project. In general, think about what the goal of the project is, and how you could accomplish that goal better, faster, more efficiently etc by changing things in either the physical setup or the code.