SIMPLE Arduino Float Switch Tutorial!!

  Рет қаралды 20,076

Christopher’s Electronics

Christopher’s Electronics

4 жыл бұрын

Very simple Arduino float switch tutorial to light up an LED light.
Copy and paste code into Arduino IDE
Code for project:
------------------------------------------------------------------------------------------------------------------------------------
//Set the LED light to pin 8
int LED = 8;
//Set the float sensor to pin 3
#define Float_Switch 3
void setup() {
// initialize digital pin 8 as an output.
pinMode(LED, OUTPUT);
pinMode(Float_Switch, INPUT_PULLUP);
}
void loop() {
if(digitalRead(Float_Switch) == HIGH)
{
digitalWrite(LED, HIGH); //Turn LED on
}
else
{
digitalWrite(LED, LOW); //Turn LED off
}
}
---------------------------
Song: Cartoon - Immortality (feat. Kristen Aaslaid) [NCS Release]
Music provided by NoCopyrightSounds.
Watch: • Cartoon, Jéja - Immort...

Пікірлер: 32
@robertbuckles3596
@robertbuckles3596 3 жыл бұрын
I'm sorry, I just wanted to clean up your code a little bit. int LED = 8; //Set the LED light to pin 8 int float1 = 3; //Set the float sensor to pin 3 void setup() { pinMode(LED, OUTPUT); // initialize digital pin 8 as an output. pinMode(float1, INPUT); } void loop() { if (digitalRead(float1) == HIGH) { digitalWrite(LED, HIGH); //Turn LED on } else { digitalWrite(LED, LOW); //Turn LED off }
@dogeeatsveggies
@dogeeatsveggies 3 жыл бұрын
im subbing cause its simple yet very useful. great job. i love the music also.. not annoying.. also the way you presented it was clear even if there was no voice over. greatjob man thanks
@christopherselectronics7153
@christopherselectronics7153 3 жыл бұрын
Thank you for subbing! I’m glad you enjoyed the video!
@connorbannochie9014
@connorbannochie9014 2 жыл бұрын
Thank you Christopher!
@basted1598
@basted1598 Жыл бұрын
This video is legit, but it only works for simple check of the float switch. Still it works
@electricalcoder3025
@electricalcoder3025 4 жыл бұрын
awesome and pretty cool smart work christopher.👍👌👍👌👍....keep creating.....as we share the same passion and channel contents thats arduino and programming i will suppourt you as much as could... and i SUBSCRIBED yours too ...anyways ALL the very best dude
@christopherselectronics7153
@christopherselectronics7153 4 жыл бұрын
Thanks a lot, I appreciate the support. I subscribed to you too. You have some awesome content. Nice job!!
@leokaban461
@leokaban461 2 жыл бұрын
where can i download Ball Float Liquid Level Sensor library for fritzing software???
@apo.exoworlds
@apo.exoworlds 3 жыл бұрын
Great content for those new to Arduino, tnx! If you have time to spare, I would love to see this used in an automated irrigation system (I'm asking this for a friend 😁).
@christopherselectronics7153
@christopherselectronics7153 3 жыл бұрын
Thanks, glad it was helpful! I am always open to video suggestions. Would you mind letting me know a few more specifics about what type of irrigation system and for what purpose? Thanks!
@emilperijocable
@emilperijocable 3 жыл бұрын
Great video Chris. quick question, do you have any experience with that type of sensor? can it be submerged all the way for longer periods of time? Cheers
@christopherselectronics7153
@christopherselectronics7153 3 жыл бұрын
I have used them, but only above water/ on the surface. I do believe they can be submerged, but I am not aware to what depth. It might be helpful to check data sheets or manufacture specs to be sure
@brianalaba970
@brianalaba970 Жыл бұрын
what if i used buzzer or horn instead of bulb what is the code? and the diagram
@gitanjalivijaydevanand3957
@gitanjalivijaydevanand3957 3 жыл бұрын
Hi! Wonderful job!!! I am really looking forward to using this for my project.... Is it possible to connect three float switches to a single arduino...if so can u explain how it can be done?
@christophersaquariums659
@christophersaquariums659 3 жыл бұрын
Thank you! Yes, it is certainly possible to use three or more float switches. If you intend to have each float switch control one led, simply follow the steps in the video, but for each led and float switch, plug them into different pins. Then if you understand how the code works, simply define each new led and float switch, define the pins, and rewrite the loop for each new float switch (just remember to change its name for each loop). If this doesn’t make sense I can send you an example code.
@gitanjalivijaydevanand3957
@gitanjalivijaydevanand3957 3 жыл бұрын
@@christophersaquariums659 Thank you very much for your reply. Will try to follow the steps that you have mentioned...
@christopherselectronics7153
@christopherselectronics7153 3 жыл бұрын
Gitanjali Vijaydevanand I’m glad he could help! Let me know if you have any other questions.
@cake2277
@cake2277 Жыл бұрын
Is there one for the software?
@miteshbhaliya2561
@miteshbhaliya2561 3 жыл бұрын
Hello cristo ... i got error during upload of the programme ..its showing ( micro names must be identifiers)
@christopherselectronics7153
@christopherselectronics7153 3 жыл бұрын
I haven’t had that error before. Make sure you only have the code copied and nothing else. Also, try searching that error in an Arduino forum online and see if there’s any info on it. Sorry, and I hope that helps!!
@scarlettirons6790
@scarlettirons6790 Ай бұрын
Where did you get the water level sensor from please?
@christopherselectronics7153
@christopherselectronics7153 Ай бұрын
I bought mine off amazon. I can't post a link, but if you look up "float switch", you get a lot of results to chose from.
@lukemark157
@lukemark157 Жыл бұрын
Hello bro, can I used piezo buzzer for warning? If it is yes, how? Thank you
@christopherselectronics7153
@christopherselectronics7153 Ай бұрын
Yep you can! Replace the led with a buzzer and it should work. No code changes needed
@amkkosa
@amkkosa 2 жыл бұрын
Where can I buy such a sensor? I did not find any which works on 5V on eBay...
@christopherselectronics7153
@christopherselectronics7153 2 жыл бұрын
Here is a link to some on amazon. These are what I used: www.amazon.com/Anndason-Pieces-Plastic-Switch-Liquid/dp/B07211T6Y6/ref=sr_1_3?crid=3VQOMBUN2HFMP&keywords=5+volt+float+sensor&qid=1641770367&sprefix=5+volt+float+sensor%2Caps%2C76&sr=8-3
@vhonthugzadventures
@vhonthugzadventures 2 жыл бұрын
sir where did you order/buy your floater switch
@christopherselectronics7153
@christopherselectronics7153 2 жыл бұрын
I bought mine off of amazon
@vhonthugzadventures
@vhonthugzadventures 2 жыл бұрын
@@christopherselectronics7153 thank you sir,
@user-zm5so7rm8z
@user-zm5so7rm8z 4 ай бұрын
No pull up resistor?
@christopherselectronics7153
@christopherselectronics7153 Ай бұрын
One isn't necessarily needed, but in practice a pull up resistor would be used. I was trying to keep everything as simple as possible!
@E3CB
@E3CB 3 жыл бұрын
Kas see on Eesti kanal?
Float switch |
0:20
#LearningElectronics
Рет қаралды 20 М.
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 11 МЛН
Water Level Control Arduino || Dengan Float Sensor
8:29
Fadli Fitriansah
Рет қаралды 2,2 М.
How to Use Arduino Interrupts The Easy Way
33:28
Rachel De Barros
Рет қаралды 76 М.
Arduino Automatic WaterPump System.. //Save Water💧
5:38
Arduino Experiment
Рет қаралды 116 М.
How To Wire It! Buttons & Switches
9:52
ItKindaWorks
Рет қаралды 130 М.
How to Use a Button with an Arduino (Lesson #5)
20:57
Science Buddies
Рет қаралды 64 М.
MOSFETs and Transistors with Arduino
40:50
DroneBot Workshop
Рет қаралды 1 МЛН
ARDUINO FLOAT SENSOR
9:04
M WIKI
Рет қаралды 47 М.
How To Use Float Magnetic Sensor or Reed Liquid Level Sensor
7:30
Innovative Indian Projects
Рет қаралды 43 М.
How to Use Millis to Master Arduino Multi-tasking
50:17
Rachel De Barros
Рет қаралды 48 М.