CoolKid42Everelk1Kurtpattison
Published © GPL3+

Project Rising Water

Make water defy gravity, all while creating fantastic lighting effects!

AdvancedFull instructions provided3,759
Project Rising Water

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Custom PCB
Custom PCB
×1
Water Pump
×1
Water Tube
×1
Bucket/Reservoir
×1
Ethernet Breakout Board
×1
Wire, Wrapping Wire
Wire, Wrapping Wire
×1
Funnel
Any funnel Will do as long as it's 5.5 inches in diameter
×1
General Magnets
×1
On/Off switch for power
×1
Waterproof RGB light strip
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×2
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Pushbutton Switch, Momentary
Pushbutton Switch, Momentary
×1
12C LCD Backpack
×1
Ac/Dc 12v power supply
×1
Ethernet Cable, 1 m
Ethernet Cable, 1 m
×1

Software apps and online services

Arduino IDE
Arduino IDE
Inkscape
A free software that we used to design svg. files for our laser cutter.

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
Table Saw
Drill / Driver, Cordless
Drill / Driver, Cordless
Hot glue gun (generic)
Hot glue gun (generic)
Nail Gun
Caliper
Computer

Story

Read more

Custom parts and enclosures

Head and Base Boards

The top and bottom boards that cover the electronics on the top, and the water bucket and cords on the bottom.

Bucket Holder and the top of a box that fits the LCD screen

This is a simple design for holding our water bucket in place while allowing us to remove it for maintenance. It also includes the top of our head unit that fits the LCD screen into it.

Schematics

project_rising_waters_-_schematic_SluQOnzFf6.fzz

This is the schematic for our circuit. It should be known that the four wires connected to the LCD screen are make shift. Our LCD has a I2C backpack with only four pins. They are ground, power, and the last two are sending and receiving serial pins.

Code

Scrolling LCD

Arduino
This is our basic code for scrolling our LCD screen without delay allowing us to implement it into final code without breaking it.
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

const int  buttonPin = 2;    // the pin that the pushbutton is attached to
const int ledPin = 13;       // the pin that the LED is attached to
int buttonState = 0;         // variable for reading the pushbutton status

unsigned long previousMillis = 0;        // will store last time LED was updated
const long interval = 700;           // interval at which to blink (milliseconds)

int mode = 0;

void setup()
{
  int previousMillis = 0;
  int interval = 500;

  pinMode(ledPin, OUTPUT); // initialize the LED pin as an output:
  pinMode(buttonPin, INPUT_PULLUP); // initialize the pushbutton pin as an input:

  lcd.init(); // initialize the lcd 
  
  lcd.backlight();  // Print a message to the LCD.
    lcd.setCursor(5,0);
    lcd.print("Project:");
    lcd.setCursor(3,1);
    lcd.print("Rising Water");
    lcd.setCursor(19,0);
    lcd.print("Creators:Kurt,Kian");
    lcd.setCursor(20,1);
    lcd.print("Cole,Evan,Taylor");
}

void loop()
{
  if ( millis()- previousMillis >= interval ){ //autoscroll function...
    previousMillis = millis();                 //You can do any multitasking bit here in this loop
    lcd.scrollDisplayLeft();                   //It will function without stopping the program
                                               //The interval variable is your delay                      
}
  buttonState = digitalRead(buttonPin); // read the state of the pushbutton value:

if (buttonState == LOW) // check if the pushbutton is pressed. If it is, the buttonState is LOW:
 {

if (mode == 0) {
  lcd.setCursor(5,0);
  lcd.print("Project:");
  lcd.setCursor(3,1);
  lcd.print("Rising Water");
  lcd.setCursor(19,0);
  lcd.print("Creators:Kurt,Kian");
  lcd.setCursor(20,1);
  lcd.print("Cole,Evan,Taylor");
  }
if (mode == 1) { // Mode 1
  lcd.clear();
  lcd.setCursor(5,0);
  lcd.print("Mode: 1");
  lcd.setCursor(3,1);
  lcd.print("No Seizure");
    delay(3000);
}
else (mode == 0);
}

if (mode == 2) { //Mode 2
  lcd.setCursor(5,0);
  lcd.print("Mode: 2");
  lcd.setCursor(3,1);
  lcd.print("Visonary");
  lcd.setCursor(25,0);
    delay(3000);
}
else (mode == 0);
if (mode > 3){ // Resets the button presses
mode = 0;}
}

Final Code for Project Rising Water

Arduino
the mapping function for Khrono is a little finicky and can be played with to find the correct frequency.
#include <Wire.h>  // importing LCD libraries
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

unsigned long previousMillis = 0; // millis needs unsigned log not int
float Red = 0; // output pin 11
float Blue = 0; // output pin 10
float Green = 0; // output pin 9
float bright = 0; // mapped color, sets brightness of led
float colouer = 0; // for picking color, input a3
float chrono = 0; // for picking frequency, input a2
float khrono = 0; // mapped timing, sets the blink rate
float ness = 0; // brightness of the colors
bool flip = true; // Bad variable name squad
// Thanks to paulS for cyberbullying some guy one arduino forums and also giving us a problem fix

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  int previousMillis = 0;
  // serial begin for debugging purposes
  lcd.init(); // initialize the lcd 
  lcd.init(); // Second init is required
  // Print a message to the LCD.
  lcd.backlight();
    lcd.setCursor(4,0); // printing out the desired text.
    lcd.print("Project:");
    lcd.setCursor(2,1);
    lcd.print("Rising Water");
}

void loop() {
   /* One loop reads and sets each LED brigtness equal to the value read by the potentiometer, the seconds turns the LED off after the interval is met.
     The variable flip is used to track which loop must run next. Millis is used to determine the interval of time before running each loop. */
  chrono = analogRead(A2); //reading the frequency off the potentiometer
  khrono = map(chrono, 0, 1023, 1, 100); // mapping the input into out actual frequency. Second number pair sets high and low for frequency
  khrono = ((khrono / 100) + 5.4);
  colouer = analogRead(A3); //FLIP WILL NOT FLIP FROM TRUE TO FALSE ayay it works now
  Serial.println(khrono);

  
  if ( ((millis() - previousMillis) >= khrono) && (flip == false )) { // Turning the colors off when the interval is met AND the other loop has run through first
    analogWrite(10, 0); //Turning off each color
    analogWrite(11, 0);
    analogWrite(9, 0);
    previousMillis = millis(); // Resetting the interval
    flip = true; // Switching to use the other loop next run through
  }

  if ( ((millis() - previousMillis) >= khrono) && (flip == true)) {
     previousMillis = millis(); // Resetting interval
     

  /*The midpoint of each color range is where the color is the brightest. Overlap allows the colors to blend together.
 Subtraction is used to force the brightness into fitting the values needed.*/
  if (colouer > 111 && colouer < 573){ //Working 
     Blue = colouer-111; // Detecting and displaying blue, interval 111 to 573 on the pot
      if(Blue <= 231){
        bright = Blue; // Setting the LEDs brightness
      }
      if(Blue >= 232){
        bright = 462 - Blue; // accounting for the midpoint so the LED dims.
      }
        ness = map(bright,0,231,0,255); // Setting the brightness to send to the LED
        analogWrite (10,ness); // LED on
  }
  /* Red has its highest brightness set at zero, so it wraps around the circle and allows red to blend with green and blue.
  2 loops were needed to create the desired effect. */
  if (colouer > 793) { // First half of red loop.
    Red = colouer - 793;
    bright = 1024 - Red;
    ness = map(bright, 0, 174, 0, 255);
    analogWrite (11, ness); // Turning the LED on
  }

  if (colouer < 231) { // low end of red loop
    Red = 231 - colouer;
    bright = Red;
    ness = map(bright, 0, 341, 0, 255);
    analogWrite (11, ness); // LED on
  }
  if (colouer > 453 && colouer < 913){ // Setting up green, interval is 453 to 913
     Green = colouer-453; // Brininging the value into the range we need to map. This line starts at zero and goes up.
      if(Green <= 190){
        bright = Green;
      }
      if(Green > 341){ // When green passess the midpoint of its range it begins to go down to zero.
        bright = 913 - Green;
      }
        ness = map(bright,0,213,0,255);
        analogWrite (9,ness); // Turning the LED on
  }
  flip = false;
     }
}

Credits

CoolKid42
0 projects • 0 followers
Contact
Everelk1
1 project • 0 followers
Contact
Kurtpattison
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.