Hi everyone.
So I’ve spent the last couple of days glued to my computer reading everything I can about the Arduino and it’s uses.
So, I’ve had a project in mind for the last couple of years, and it seems as if the Arduino is the answer to my questions! Now, I have not yet ordered my Arduino Starter Kit, nor do I know a lot about coding or electronics, but I intend to learn a lot and build this thing on my own!
The forum is quite awesome and I can see that there’s a ton of knowledge and people willing to help, and I would like to thank everyone in advance.
So, on to my project :
In essence it’s a machine that dispenses 25ml of liquid at a time.
Stage 1
Basic Components :
1 x Arduino Uno R3 (the brains)
1 x 12v 500mA Solenoid (releases fluid)
1 x Tip120 Transistor (controls solenoid)
2 x 1k Resistor (pulls switches to ground to prevent bouncing)
1 x 1N4004 Diode (to prevent spikes)
1 x Push Button (For input from user)
1 x Push Button (to determine the presence of a glass)
So this is the core of the machine, but I plan a LOT of expansion on it, including IR sensors, more solenoids, LCD touch screen interface and display, 220v mains supply with battery backup, data logging, wifi/BT communication etc etc…
So I’m basically following this tutorial http://www.instructables.com/id/Controlling-solenoids-with-arduino/?ALLSTEPS to build the circuit for the relay and this also helped Arduino Playground - SolenoidTutorial and http://wiki.bildr.org/index.php/Controlling_a_solenoid_(TIP120_Arduino) .
So, onto my code :
/*
Fluid Dispenser v1.0
written by : Theo Gresse
Date : 15/10/2012
*/
int buttonPress = 1;
int glassSensor = 2;
int relayOut = 13;
void setup() //setup
{
pinMode(buttonPress, INPUT); //buttonPress defined as an input
pinMode(glassSensor, INPUT); //glassSensor defined as an input
pinMode(relayOut, OUTPUT); //relayOut defined as an output
}
void loop() //start of loop
{
if (digitalRead(buttonPress) == HIGH //if the signal from the button is HIGH (or pressed)
&& //and
(digitalRead(glassSensor) == HIGH)) //if the signal from the glassSensor is HIGH (or pressed)
{ //then
digitalWrite(relayOut, HIGH); //activate the relay
delay(1250); //keep relay activated long enough to dispense certain volume
digitalWrite(relayOut, LOW); //deactivate the relay
}
else
{
digitalWrite(relayOut, LOW); //no button pressed, no action taken, relay deactivated
}
} //end loop
Any comments so far? It compiles fine, but as stated, I haven't ordered the Arduino yet, so can't upload it yet ![]()
I would truly appreciate any and all help with my project!