Caleb AshleyAndrew ChapmanSpencer Huffines
Published

The Uncle Bob Shot

Do you have that one uncle that pours the perfect shot? The problem he's not always around for a shot. Introducing the Uncle Bob Shot!

IntermediateShowcase (no instructions)Over 2 days124
The Uncle Bob Shot

Things used in this project

Hardware components

Argon
Particle Argon
×3
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Chenbo 1kg Load Cell HX711 A/D
×1
Humphrey 120v Solenoid Valve
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
SmartThings service
IFTTT SmartThings service

Hand tools and fabrication machines

Drill / Driver, 20 V
Drill / Driver, 20 V
Hand Saw

Story

Read more

Schematics

LCD

Solenoid

Load Cell(Argon 1)

Code

Load Cell(Argon 1)

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <HX711ADC.h>



#define DOUT  0
#define CLK  2
HX711ADC scale(DOUT, CLK);
float temperature;

void LED(const char *event, const char *data)
{
    String pew = data;
    temperature = pew.toFloat();
}
 float calibration_factor = 535; // this calibration factor is adjusted according to my load cell
float units;
float units1;

void setup() {
    int ledB=D6;
    int ledG=D7;
    int ledR=D8;

pinMode(ledB,OUTPUT);
pinMode(ledG,OUTPUT);
pinMode(ledR,OUTPUT);


 Serial.begin(9600);  
 Serial.println("Press T to tare");
scale.set_scale(calibration_factor); //Adjust to this calibration factor
 scale.tare(); 
}



void loop() {
units = scale.get_units(), 5;
 if (units < 0)
 {
   units = 0.00;
 }

 units1 = (units/29.57);
 
 
    Particle.publish("Ounces", String(units1),PUBLIC);  //subscribe to this mouse event.
    delay(1000);  //delay to prevent overloading the cloud communication.
   Particle.subscribe("LED_Caleb",LED);
   if (temperature<1.1) {
            digitalWrite(D6,HIGH);
            digitalWrite(D7,LOW);
       digitalWrite(D8,LOW);
   }
 else if (temperature<2.1){
  digitalWrite(D6,LOW);
       digitalWrite(D7,HIGH);
            digitalWrite(D8,LOW);
  }
  else {
           digitalWrite(D6,LOW);
                digitalWrite(D7,LOW);
      digitalWrite(D8,HIGH);
  }


 
 if(Serial.available())
 {
   char temp = Serial.read();
   if(temp == 't' || temp == 'T')
     scale.tare();  //Reset the scale to zero      
 }
} 

Solenoid (Argon 2)

C/C++
int solenoid = D2;
int pushbutton = D3;
int val = 0;


void setup() {
pinMode(solenoid, OUTPUT);
pinMode(pushbutton, INPUT);

}

void loop() {
val = digitalRead(pushbutton);
if (val == HIGH)
    {
        digitalWrite(solenoid, LOW);
    }
    else 
    {
        digitalWrite(solenoid, HIGH);
    }
}

LCD (Argon 3)

C/C++
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(5,4,3,2,1,0)

;void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.clear();

}

void loop()
{
lcd.setCursor(0,0); // Sets the cursor to col 0 and row 0
lcd.print("SensorVal1: "); // Prints Sensor Val: to LCD

lcd.setCursor(0,1); // Sets the cursor to col 1 and row 0
lcd.print("SensorVal2: "); // Prints Sensor Val: to LCD

}

Credits

Caleb Ashley

Caleb Ashley

1 project • 0 followers
Andrew Chapman

Andrew Chapman

1 project • 0 followers
Spencer Huffines

Spencer Huffines

1 project • 0 followers

Comments