Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Ask questions about projects relating to: aerodynamics or hydrodynamics, astronomy, chemistry, electricity, electronics, physics, or engineering

Moderators: kgudger, bfinio, MadelineB, Moderators

Post Reply
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

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
IMG_7350.jpg (1.85 MiB) Viewed 121381 times
Screenshot 2024-01-07 235911.png
Screenshot 2024-01-07 235911.png (122.97 KiB) Viewed 121381 times
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

Pictures that weren't included:
Attachments
arduino img.jpg
arduino img.jpg (1.56 MiB) Viewed 121380 times
bred.jpg
bred.jpg (2.21 MiB) Viewed 121380 times
bfinio
Expert
Posts: 761
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by bfinio »

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.
bfinio
Expert
Posts: 761
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by bfinio »

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.
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

Hello, I followed your instructions and switched it but the pump still does not work
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

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.
bfinio
Expert
Posts: 761
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by bfinio »

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.

What did you do to get the pump working?
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

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?
bfinio
Expert
Posts: 761
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by bfinio »

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.
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

For some reason the time doesn't show in the serial monitor, only the voltage. And how would i use longer delays in the program?
bfinio
Expert
Posts: 761
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by bfinio »

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.
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

I'll try it out right now, I will let you know how it goes.
warmFlower
Posts: 8
Joined: Sun Jan 07, 2024 9:41 pm
Occupation: Student

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by warmFlower »

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?
bfinio
Expert
Posts: 761
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff
Project Question: Expert
Project Due Date: n/a
Project Status: Not applicable

Re: Dealing with Diabetes: The Road to Developing an Artificial Pancreas. Pls help asap!

Post by bfinio »

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

Return to “Grades 9-12: Physical Science”