I plan on posting this device to a friend which when opened from the box and the light sensor is engaged the pump begins to pump and inflate the ballon then they can then remove the ballon and tie a knot.
So when its taken out from the box for x amount of time it begins to inflate. I plan on timing how long it takes before and making a delay of the correct amount of seconds then it stops and the recipient of the project can remove the ballon and tie a knot in it. I also plan on giving them so light instructions so it goes according to plan.
Its for an art project, Ive never done anything like this before but would need guidance on which light sensor which Arduino and which pump would be suitable. The ballon is a small latex 8" ballon.
Ive made a few projects but not much else any help would be appreciated and if you need to know anything else ask and tell me if ive made an oversight.
First I think you should find a suitable pump and power supply/batteries to get the balloon inflated to the size you require.
An Arduino NANO would do the job and is small in size as your controller.
You will need some extra components to switch the pump on and interface the LDR.
But you need to establish the pump and how much current it will need before deciding on any other components.
How much pressure does it take to inflate the balloon? You need to answer that question before you can start to choose a pump. Then how much volume per unit time or how fast do you need to inflate the balloon? Once you have pressure and flow then you can decide what pump that you need. You then need to power the pump motor. What is the stall current of the motor? Need to know that to choose a motor driver. A simple logic level MOSFET usually works for a pump motor. Choose a MOSFET that can handle the stall current of the motor. Don't forget a flyback diode. Google "arduino dc motor" for more information.
A Light Dependent Resistor (LDR) would be a fine light sensor for this application. Search for "arduino ldr".
TomGeorge:
An Arduino NANO would do the job and is small in size as your controller.
Wrong module!
You would need a Pro Mini with regulator and pilot light removed in order to put it to sleep with essentially no current draw. 6 V battery pack with a series diode to drop the voltage a little for the Arduino.
Conveniently, while the LDR is in the dark, it passes no current so that does not become a problem.
You can get the logic working without actually worrying about the specifics of driving the pump; for testing purposes that can just be getting an led to work, and in the long run that may actually be all you do to switch a mosfet.
I personally have no experience of putting an Arduino to sleep and waking it up (which I guess you would want to do), but assuming it's awake....
Continually monitor millis() and after what you called "x" earlier, turn the led on
Continually monitor millis() and after x + however long it takes to inflate, turn the led off.
From a practical point of view, when you box this for the mail, you will need to power it on before you pack it away, but with the ldr in darkness so it doesn't inflate in the box. So you will need some kind of cover on the ldr which you will then slide out as you close the box else the ldr will see the light...
There will be some kind of battery in there: is it ok to mail them?
Note that the pressure in the balloon is the highest as you start inflating, it decreases as the balloon increases in size, until the rubber reaches its limit and then the pressure starts to increase again until the balloon bursts (which you probably want to prevent).
Indeed you have to start finding an air pump that can build enough pressure, and run off a 6V battery pack. Good luck with that... I had a hard enough time finding aquarium pumps running on 12V!
Alternative: CO2 cartrige with small solenoid valve.
Code can be super simple. Forget about deep sleep, have the LDR switch a MOSFET to the power supply of your Arduino (and the pump or solenoid).
Code can be as simple as this:
const byte outputPin = 4; // for your solenoid or air pump.
void setup() {
pinMode(outputPin, OUTPUT);
digitalWrite(outputPin, HIGH);
delay(3000); // The time you want to continue filling the pump.
digitalWrite(outputPin, LOW);
}
void loop() {}
Heck, you could even replace your whole Arduino with a 555 in monostable mode for this, the LDR triggering the 555, it's output pulse triggering the filling of the balloon for the required time.
wvmarle:
until the balloon bursts (which you probably want to prevent).
OP didn't say just how good a friend the recipient is
FWIW OP, because my wife gave my the arvie off from the garden, I have written a sketch that has the Arduino doing the whole thing, powered the whole time, and starting the pre-inflation delay when the box is opened. I'll post it if you want it, but no point complicating things if you go the route above with the ldr actually controlling the Arduino power.
you have to start finding an air pump that can build enough pressure
There are a fair number of pumps aimed at home blood pressure monitoring systems that will generate enough pressure, probably. Easy to find surplus, eBay, or aliexpress...