Imitation of water levitation on Arduino



Good evening! In this publication I will talk about my homemade, which I had conceived for a long time. But realized just now.

I first saw this effect in childhood. I was asked to help, hold and shine a car strobe on the flywheel of a car engine. The motor was started and after that I saw on a rotating flywheel, an almost non-moving notch that stood in one place, and the flywheel at the same time rotated. After that, the idea was born to make a fan and stop it with a strobe. After some time he realized the idea, on the IFK-120 lamp, the KU202 thyristor with strapping, played and threw it into the far corner, but about 6 years ago I saw a Japanese video with water levitation. So the idea was born to repeat this trick with levitation drops. Long did not reach the realization of the hand and finally, the dream came true ...

Watch a video of what I did:




How it works


In YouTube there are several videos in which they try to dissect water into drops, flowing from a silicone hose, using an audio column or a dynamic head. But in this way there are several drawbacks.

1 - bulkiness of the structure (column, amplifier, frequency generator, strobe)
2 - the subwoofer cannot reproduce the square wave, because of its mechanical design and at the output it turns out something like a sinusoid. As a result, water is not dissected into drops, but wriggles like a snake.
3 - The frequency generator each time you have to adjust to the frequency of the stroboscope. The frequency will float away.

In my design, everything is simple and cheap. This design can be repeated by anyone, at home.

It works like this:

The stroboscope and electromagnet from the automobile relay, work at one frequency. The electromagnet breaks the flow of water into droplets, and the stroboscope illuminates these droplets at some point. Since the drops fall with a frequency equal to the stroboscope, the effect of droplets hanging in the air is obtained.

Scheme


I had KT972 transistors on hand, so I set them up. You can put any other transistors designed for a voltage of at least 30V and a current of at least 2A. Resistors in the bases of transistors limit the current to 40mA, so as not to damage the controller output. The LED element I used is from an old faulty LED lamp. To reduce the supply voltage of the element to 24 V. I divided the element into two parts, cutting one track and paralleling these two arrays of LEDs. Since the LED element is powered by short pulses, and the supply voltage is equal to the drop voltage on the LEDs, I did not limit the current. A diode parallel to an electromagnet protects against negative emissions of an electromagnetic coil. You can put a diode from the same disassembled LED lamp. Electromagnet made from automotive relays. My relay was already broken, so I had to use it for what it is. If I had a working relay, I would first try to connect a Chinese stick to anchor the relay. To ensure the gap between the permanent magnet and the electromagnet, you can put a piece of foam rubber between them, or move the stick with the magnet to the side. As I did.



Components used in the diagram:


Arduino nano - 1 pc.
Encoder - 1 pc.
Development Board - 1 pc.
Old LED lamp - 1 pc.
Transistor KT972 - 2 pcs.
Automotive relay - 1 pc.
120 ohm resistor - 2pcs.

Details on the Arduino code


I use Arduino Nano because I have a lot of them and they fit perfectly on the breadboard. But you can use absolutely any Arduino controller and even Digispark. The encoder uses the INT1 interrupt. If you rotate the encoder without pressing, then the frequency of the stroboscope flashes and the frequency of the electromagnet are adjusted in increments of 0.1 Hz. If you rotate with a click, then the duration of the flashes of the LED is regulated, for photographers this is called the exposure time. In this case, the frequency does not change. The control of the LED element, for convenience of debugging, I connected to D13, but you can change all the connection pins for any other. Only you can not change the pin D3 (INT1) encoder.

Sketch for Arduino
//   #define CLK 3 // Clock   INT1,   #define DT 4 //    #define SW 5 // switch   #define led_pin 13 //   #define coil_pin A0 //  #define Min 1 //   #define Max 20000 //  #define step_freq 1 //     0,1 #define step_freq_rough 10 //     1 #define step_timelght 100 //     volatile int freq = 250; //      10,     volatile uint32_t paus, time_light=2000; //        uint32_t oldcount; boolean DT_last; //    void setup() { pinMode(CLK,INPUT_PULLUP); // Clock   INT1,   pinMode(DT, INPUT_PULLUP); //    pinMode(SW, INPUT_PULLUP); //   pinMode(led_pin, OUTPUT); //   pinMode(coil_pin, OUTPUT); attachInterrupt(1, encoderTick, CHANGE); //    DT_last = digitalRead(CLK); //   CLK Serial.begin(115200); //   } void loop() { paus=5000000/freq; digitalWrite(coil_pin, 1); digitalWrite(led_pin, 1); oldcount = micros(); while( (micros() - oldcount) < time_light){} //    digitalWrite(led_pin, 0); while( (micros() - oldcount) < paus){} //   digitalWrite(coil_pin, 0); oldcount = micros(); while( (micros() - oldcount) < paus){} //  } //********************  ******************************* void encoderTick() { uint8_t DT_now = digitalRead(CLK); //    CLK if (DT_now != DT_last && digitalRead(SW)) //       ,    { if (digitalRead(DT) != DT_now) //  DT   CLK,      { if( freq < Max ) freq += step_freq; //  } else { //  DT  CLK,     if( freq > Min ) freq -= step_freq; //  } } else if (DT_now != DT_last && !digitalRead(SW)) //      { if (digitalRead(DT) != DT_now) //  DT   CLK,      { if( time_light < paus ) { time_light += step_timelght; } //   } else if( time_light > 0 ) time_light -= step_timelght; //    / } DT_last = DT_now; //   CLK    } 



Levitron setting


The basic setting is reduced to adjusting the flow of water. It is necessary to adjust the flow rate of water so that the electromagnet can consistently break the flow of water into droplets. I think that it is very simple and you will immediately see visually where the golden mean is. Also adjust the frequency of the strobe flashes to be more comfortable for your eyes. Flash rate affects
the distance between the drops, and if the drops begin to break without synchronization, then re-arrange the flow of water. If you want to shoot video on the camera, then you need to adjust the stroboscope to the frequency of the camera, so that the camera does not have flicker

What's next?
I plan to buy a pulse pump and, on its basis, make a levitating rain from a shower watering can. So there will be another small article and a video on the topic "Water Levitation"
Subscribe not to miss a new article and video.

There will be questions ask, do not hesitate.
I will answer them with pleasure

Source: https://habr.com/ru/post/411221/


All Articles