Close
0%
0%

Arduino Wave Generator Tank

Personalized Water Wave Generator Tank, Ya Bilge Scum

Similar projects worth following
Personalized Water Wave Generator Tank, Ya Bilge Scum

Welcome me matey to Davy Jones' miniature locker. To analyze yer wave and buoyancy mechanics while we plunder wenches, drink Rum and supplement with vitamin C, we rigged an Arduino Micro, (2) servos and potentiometer with if and for codes to generate various wave frequencies upon the sovereign seas (in a small acrylic case cast from a picture frame). Arrr--gh!

http://tvmiller.com/index.php?entry=entry160108-064656

ino - 2.25 kB - 01/07/2016 at 23:16

Download

View file

  • 1 × Arduino Micro
  • 2 × Servo
  • 1 × Potentiometer
  • 1 × RGB LED
  • 1 × Acrylic from binned Picture Frame
  • 1 × Silicone Breast Impants
  • 1 × Water, The Wet Kind
  • 1 × Scurvy
  • 1 × Mizzen Mast

  • Arduino Sketch II (Speed Only)

    VijeMiller01/09/2016 at 01:21 0 comments

    // Arduino Wave Tank II
    // TVMiller
    
    #include <Servo.h>
    
    Servo left;
    Servo right;
    
    int pos = 20;
    int back = 20;
    int forward = 160;
    int spe = 15;
    
    int red = 6;
    int green = 5;
    int blue = 4;
    
    void setup() {
    
      Serial.begin(9600);
    
      left.attach(2);
      right.attach(3);
    
      pinMode(red, OUTPUT);
      pinMode(green, OUTPUT);
      pinMode(blue, OUTPUT);
    
      left.write(back);
      right.write(back);
    
      digitalWrite(green, HIGH);
      delay(1000);
      digitalWrite(green, LOW);
      delay(1000);
      digitalWrite(red, HIGH);
      delay(1000);
      digitalWrite(red, LOW);
      delay(1000);
    
    }
    
    void loop() {
    
      int pent = analogRead(A0);
      Serial.println(pent);
      spe = map(pent, 0, 1023, 15, 1);
    
      if (spe >= 10) {
        digitalWrite(green, HIGH);
        digitalWrite(blue, LOW);
        digitalWrite(red, LOW);
      }
      else if (spe < 10 && spe >= 5) {
        digitalWrite(green, LOW);
        digitalWrite(blue, HIGH);
        digitalWrite(red, LOW);
      }
      else if (spe < 5 && spe >= 1) {
        digitalWrite(green, LOW);
        digitalWrite(blue, LOW);
        digitalWrite(red, HIGH);
      }
    
      for (pos = back; pos <= forward; pos += 1) {
        left.write(pos);
        right.write(pos);
        delay(spe);
      }
      for (pos = forward; pos >= back; pos -= 1) {
        left.write(pos);
        right.write(pos);
        delay(spe);
      }
    }

  • 8-076

    VijeMiller01/08/2016 at 12:19 0 comments

    This mini-build was to me a lesson on how to manipulate numerous servos with in the same parameter to create a near unison effort. Looking at the Arduino sketch you will note that in the oscillating between left and right for function, we mapped the other position for the second servo so that the initial position defined by the for is then manipulated in to a value that we want mirrored by the second servo. You get all that? If you are a beginner (as I attest I am) then that sketch is a good cheat sheet on how to add more servos to a smooth movement.

  • Arduino Code

    VijeMiller01/07/2016 at 23:17 0 comments

    // Arduino Wave Tank
    // TVMiller
    
    #include <Servo.h>
    
    Servo left;
    Servo right;
    
    int pos = 20;
    int post = 160;
    int back = 20;
    int forward = 160;
    
    int red = 6;
    int green = 5;
    int blue = 4;
    
    int slow = 8;
    int fast = 4;
    
    void setup() {
    
      Serial.begin(9600);
    
      left.attach(2);
      right.attach(3);
    
      pinMode(red, OUTPUT);
      pinMode(green, OUTPUT);
      pinMode(blue, OUTPUT);
    
      left.write(back);
      right.write(back);
    
      digitalWrite(green, HIGH);
      delay(1000);
      digitalWrite(green, LOW);
      delay(1000);
      digitalWrite(red, HIGH);
      delay(1000);
      digitalWrite(red, LOW);
      delay(1000);
    
    }
    
    void loop() {
    
      int pent = analogRead(A0);
      Serial.println(pent);
    
      if (pent < 200) {
        digitalWrite(blue, HIGH);
        digitalWrite(red, LOW);
        digitalWrite(green, LOW);
        for (pos = back; pos <= forward; pos += 1) {
          left.write(pos);
          right.write(pos);
          delay(slow);
        }
        for (pos = forward; pos >= back; pos -= 1) {
          left.write(pos);
          right.write(pos);
          delay(slow);
        }
      }
      else if (pent > 200 && pent < 450) {
        digitalWrite(blue, LOW);
        digitalWrite(red, HIGH);
        digitalWrite(green, LOW);
        for (pos = back; pos <= forward; pos += 1) {
          left.write(pos);
          right.write(pos);
          delay(fast);
        }
        for (pos = forward; pos >= back; pos -= 1) {
          left.write(pos);
          right.write(pos);
          delay(fast);
        }
      }
      else if (pent > 450 && pent < 700) {
        digitalWrite(blue, LOW);
        digitalWrite(red, LOW);
        digitalWrite(green, HIGH);
        for (pos = back; pos <= forward; pos += 1) {
          post = map(pos, 20, 160, 160, 20);
          left.write(pos);
          right.write(post);
          delay(slow);
        }
        for (pos = forward; pos >= back; pos -= 1) {
          post = map(pos, 160, 20, 20, 160);
          left.write(pos);
          right.write(post);
          delay(slow);
        }
      }
      else if (pent > 700 && pent < 1023) {
        digitalWrite(blue, LOW);
        digitalWrite(red, HIGH);
        digitalWrite(green, LOW);
        for (pos = back; pos <= forward; pos += 1) {
          post = map(pos, 20, 160, 160, 20);
          left.write(pos);
          right.write(post);
          delay(fast);
        }
        for (pos = forward; pos >= back; pos -= 1) {
          post = map(pos, 160, 20, 20, 160);
          left.write(pos);
          right.write(post);
          delay(fast);
        }
      }
    
    }

View all 3 project logs

Enjoy this project?

Share

Discussions

Ho wrote 04/19/2016 at 14:37 point

Hello, I have  questions.

what is the scurvy in component? 

How to control not to bend the wire to connect the servo motor with an acrylic plate?

  Are you sure? yes | no

VijeMiller wrote 04/19/2016 at 16:48 point

I just realized you meant literally "Scurvy" I had forgotten I put in components. It was a joke. Scurvy is a condition commonly suffered by sailors from a Vitamin C deficiency. 

The other question though, I am not certain from your wording but if you are asking about the steel wire connecting the acrylic to servo, it was a stiff steel wire (I don't remember the gauge) but nothing special as the pressure against the water was not immense because the volume of water was low.

  Are you sure? yes | no

texane wrote 01/09/2016 at 08:04 point

Great Project ! However, I wonder how accurate it is compared to actual ocean waves, given the waves you create necessarly have to bounce back at the end of the tank ... which is not the case in a real ocean. Have you some comments on that ? How hard would it be to damp the wave energy at the end of the tank, simulating a coast ? Cheers !

  Are you sure? yes | no

VijeMiller wrote 01/09/2016 at 10:28 point

It is a good question but we have to examine utility of the desk top wave generator. I built it to examine reflection actually (side note, the ocean does bounce back but on (perceptible) scales applicable to more confined areas, say a harbor or inlet, and technically globally but that's broader than applied here in discourse, of course, famous Mr. Ed.) I am researching a physics problem beyond the water and box it's in and I needed to see visually wave interaction in order to let my brain wrap around a problem I am having in my theory (which this DID help). I'm not a linguistic person, left brained, so I require spatial. My personal reason aside, this desk top model could have a series of channels at the end to dissipate some of the energy and better wave paddles that lift more than push, but for scalability to testing fluid dynamics around say a hull of a ship, it would have to be an impractically small model. Honestly, if the servos were quiet and I added some RGBs, it would make a soothing paper weight. Cheers indeed.

  Are you sure? yes | no

texane wrote 01/09/2016 at 10:37 point

Thanks for the reply. Clearly, it helps to visualize what happens ...

  Are you sure? yes | no

VijeMiller wrote 01/09/2016 at 10:54 point

I prefer the tangible over numeric probability...is what I told an angry professor of mathematics girl friend I once had a long time ago :)

  Are you sure? yes | no

Zdenek Hurak wrote 11/10/2016 at 23:21 point

Well, one possibility is to implement a "beach" at the end of the tank. That is, instead of the wall against which the waves are hitting, a very mild slope would have to be realized. This would be a passive solution. An active one (built using actuators, sensors and a computer) would be a lot more interesting. I feel like going for it :-) 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates