Arduino Basics: How to use magnetic Sensors, Reed Switch vs Hall Sensor

  Рет қаралды 95,048

Mario's Ideas

Mario's Ideas

Күн бұрын

This video is the comparison of the two types of magnetic sensors:
- Reed Switch
- Hall Sensor
I am working on a POW display project and I wanted to decide which sensor to use.
Hope you will find this analysis useful. Also If you have any thoughts on this topics, leave your comments below.
The code and all the other details can be found under:
www.hackster.io/mdraber/magne...
Here is the list of used components:
- Arduino Nano
- standard LED
- 220Ohm resistor
- Reed switch
pl.aliexpress.com/item/328053...
- Hall Sensor
pl.aliexpress.com/item/326616...
If you like this content and you want to support me in creating similar videos go to my Patreon webpage
/ mariosideas
Or
www.paypal.com/cgi-bin/webscr...

Пікірлер: 84
@wing2999
@wing2999 Жыл бұрын
Very informative and helpful. Thank you a lot!
@urla.tejaswitaruneee2483
@urla.tejaswitaruneee2483 2 жыл бұрын
Excellent work and thank you for this valuable information about sensors.
@marios_ideas
@marios_ideas 2 жыл бұрын
Give video a like if you enjoyed it
@kiwinesss
@kiwinesss 3 жыл бұрын
Excellent, thank you! Keep them coming :)
@marios_ideas
@marios_ideas 3 жыл бұрын
Thanks:)
@thevastenigma2464
@thevastenigma2464 3 жыл бұрын
Great video!
@marios_ideas
@marios_ideas 3 жыл бұрын
Thanks man:)
@billgross3579
@billgross3579 3 жыл бұрын
You might consider doing your digital read only once and assigning it to a variable. Then use that variable rather than two digital reads in a row.
@marios_ideas
@marios_ideas 3 жыл бұрын
Thanks for the hint. I will keep it in mind when writing code for my next projects;)
@user-in8bz3kd7d
@user-in8bz3kd7d Жыл бұрын
@@marios_ideas Brother this is fun, if the iron is close, it will sound the alarm, it is even more perfect, because the thief will take the screwdriver, and the key to unlock
@Joseph-ei7gg
@Joseph-ei7gg 8 ай бұрын
Very helpful. Thanks
@marios_ideas
@marios_ideas 8 ай бұрын
Glad to gear. Consider supporting my channel:)
@brandonly27
@brandonly27 2 жыл бұрын
Thank you! I appreciate the review. I almost bought a reed switch but then I changed my mind upon watching this video.
@marios_ideas
@marios_ideas 2 жыл бұрын
please give the video a like. Helps with youtube algorith:)
@user-nd8rv4dz1c
@user-nd8rv4dz1c 4 ай бұрын
Thanks for your video, can you let me know the strength of the magnet, is it. N35 ?
@ningcao786
@ningcao786 Жыл бұрын
Regarding that the reed switch doesn't release on 3:14, the magnetic field should be parallel to the axis of the reed. If your magnet is axially polarized (instead of radially), then it needs to be rotated 90 deg.
@tydshiin5783
@tydshiin5783 6 ай бұрын
Dumb question, so does that mean that I can purposely make a reed switch(NO) stay on if I wave the magnet at an angle? Trying to make a project to that uses a magnet as a switch that stays on/off
@paulsharpe3794
@paulsharpe3794 2 жыл бұрын
Hi there I have been working with read switches for over 30 years and some times they can stick
@toqeerahmad7378
@toqeerahmad7378 Ай бұрын
Great Job....،,👍
@MrBobWareham
@MrBobWareham 9 ай бұрын
You should try the latching hall sensor!!
@ryans1972
@ryans1972 2 жыл бұрын
Have a GE cloths washer that used a reed switch encased in rubber. I am sure either the vibration or lid dropping broke it. Hall sensor would most likely not break.
@marios_ideas
@marios_ideas 2 жыл бұрын
Yes . It definetly seems more reliable
@bluehong2395
@bluehong2395 2 жыл бұрын
Hi Mario, that's a great comparison study you have performed here! I have a question, is it possible to use the Hall Sensor to detect the magnitude of Magnetic strength with respect to the distance between the sensor and magnet? Thanks for any replies!
@marios_ideas
@marios_ideas 2 жыл бұрын
Not the hall sensor module as this is digital returns 0 or 1. But the hall sensor . But if you use just plain hall sensor like this one pt.aliexpress.com/item/1005002422775127.html you can connect it to analog pin and see if based on the reading you can estimate the distance. Did not try it but should work. Just like using e.g. photoresistor. Let me know how it goes. In a meantime give video a like. Would help to grow my channel
@patrickmaartense7772
@patrickmaartense7772 2 жыл бұрын
yes you can, there are ANALOGUE hall sensor modules, these will output a value that determimes the fieldforce. the digital modules use a threshold value internally to report LOW or HIGH I used that te replace a noisy potmeter by mounting it between two magnets , the rotation it makes in the magnetic field can be easily translated to a rotaion value.
@Tyler-pj3tg
@Tyler-pj3tg Жыл бұрын
I am going to use a hall sensor to search for Josephson Junctions in aluminized mylar space blankets.
@tshxxmx
@tshxxmx 2 жыл бұрын
Hi. This is pretty helpful. Wanted to ask if I could use the Arduino Nano to implement 4 magnetic sensors.
@marios_ideas
@marios_ideas 2 жыл бұрын
You can have as many sensors as you have input pins available
@mikewelch3903
@mikewelch3903 2 жыл бұрын
Could you design an Arduino Nano/linear Hall Effect circuit (KY 024) that powers about 8-10 LEDs, one at a time, depending on how far the magnet is from the sensor? I need this circuit. It would be useful in showing exactly how far the magnet is in its movement. Each LED would indicate a different distance, as the distance changes.
@marios_ideas
@marios_ideas 2 жыл бұрын
You have to use just a plain hall sensor like this one pl.aliexpress.com/item/1005003406316017.html connect it to ananlog pin and read the value off that pin and then write few if statements saying if the value is in that range light up this led etc
@adhismandiri88
@adhismandiri88 2 жыл бұрын
Gimna cara sambungx alat itu dgn tombolnya jam DC mini bos ? ( Tombol / saklarnyanya di gnti Reed switch magnetikx bos )🙏
@patrickmaartense7772
@patrickmaartense7772 2 жыл бұрын
the biggest advantage of the hall sensor is frequency , I use the sensor to measure rpm as well, a reed switch would be useless for that.
@marios_ideas
@marios_ideas 2 жыл бұрын
Yes. In one of my videos I div POV display on the old fan using hall sensor. This would not work with reed switch
@sevdev9844
@sevdev9844 2 жыл бұрын
Could it be, that the repeated testing of the reed switch turned the metal magnetic for a certain amount of time, and it just didn't work because of that. In that case the sensor would still be useful in cases, where the sensor is only triggered occasionally (and safety doesn't matter).
@marios_ideas
@marios_ideas 2 жыл бұрын
That may very well be the case. This is also the cheapest one. I know they are used in e.g. watching machines
@rawyin
@rawyin 3 жыл бұрын
It's possible your problem with the reed switches was the strength of your magnet.
@marios_ideas
@marios_ideas 3 жыл бұрын
Not sure. If it got stuck moving magnet away did not fix it. Do you mean the magnet was to strong?
@rawyin
@rawyin 3 жыл бұрын
@@marios_ideas On small relays I've had a couple ruined by overly strong magnets. One that I use for a sensor I now have placed 3" away from the very powerful neodymium magnets in the application after destroying another.
@kiwinesss
@kiwinesss 3 жыл бұрын
Now I just bought a bunch of reed switches and hall sensors from aliexpress for my own experiments. They are ridiculously cheap there. I bought a few of each because you never know how many will work or not. Do you get yours from aliexpress too?
@marios_ideas
@marios_ideas 3 жыл бұрын
Thanks for subscribing:) Yes, I get most of my stuff from Aliexpress
@chrisvaccaro229
@chrisvaccaro229 3 жыл бұрын
@@marios_ideas How long does it usually take you to get stuff from AliExpress?
@marios_ideas
@marios_ideas 3 жыл бұрын
@@chrisvaccaro229 Anything from 30 to 90 days. If you order bulk of components for future projects it is ok but If you want something quick then not so much:)
@hendriokysafata2779
@hendriokysafata2779 2 жыл бұрын
permission to ask sir, if we want to make an object fall timer using a magnetic sensor, what is the program code like?
@marios_ideas
@marios_ideas 2 жыл бұрын
Not sure what you are trying to do. I can advice but I am not going to write the code for you
@hendriokysafata2779
@hendriokysafata2779 2 жыл бұрын
@@marios_ideas thanks sir... I will make a falling object time measuring device for viscosity practicum
@Crisdapari
@Crisdapari 3 жыл бұрын
I arrived here because I have reliability problems with magnetic switches too. I'm using a water switch level that worked fine with two small DC 3-6v motor pumps in series, but then I replaced with a brushless 12v 4.2w pump and now very often doesn't turn off. Both configurations draw similar current (less than 0.5A rated for the water switch). I wonder if it's some induction problem or just a mechanic problem inside the switch, but I tested with few different switches and the issue continues and I trying to find why... I wonder what kind of reliability problems did you had with your magnetic/Reed switch.
@marios_ideas
@marios_ideas 3 жыл бұрын
Have you tried to use Hall sensor instead. The problems I had are visible in the video. Reed switch is a mechanical switch and for whatever reason every now and then it was not releasing after removing magnetic field. With hall sensor I created POV clock on the old fan with 500RPM and hall sensor was properly switching 500 times a minute . So they seem to be much more reliable
@maxrizzato
@maxrizzato Жыл бұрын
What about using MR Sensor, instead? Low power compared to Hall sensor, and as rugged and reliable as Hall sensor, also has high sensitivity, and is reliable.
@marios_ideas
@marios_ideas Жыл бұрын
Can you provide to the link to the exact sensor you have in mind
@ianthehunter3532
@ianthehunter3532 2 жыл бұрын
What happens if you put a magnet directly on top of the hall sensor?
@marios_ideas
@marios_ideas 2 жыл бұрын
Hall sensor reacts the same way no metter which direction you you approach the magnet from
@KW-ei3pi
@KW-ei3pi Жыл бұрын
Thank you. Very good information, and very well presented. I've searched your videos and am surprised that you haven't made any videos of Arduino control of Stepper Motors and Drivers. A very common usage. Video suggestion: (My project 😊) Arduino control of NEMA 17 Stepper w/driver, ON/OFF switch to power the system, momentary switch for FWD Direction, momentary switch for REV Direction, Potentiometer to control motor speed, Rotary Encoder to rotate motor a given number of steps via code. Thanks
@kingsleykronkk3925
@kingsleykronkk3925 3 жыл бұрын
Many different reed switches I tested failed also. Some not go off, some not go on. 2 pin reed switches N/O and 3 pin N/O & N/I all failed approx 30 - 50 % of the time.
@marios_ideas
@marios_ideas 3 жыл бұрын
I also show in my video that they are not 100% reliable. In my projects I go with hall sensor. If you check one of my videos where I build POV display you would see that malfunction like this if I was using reed switches would completely mess up this project
@tihruytssgjjvsavcxtbvhj3429
@tihruytssgjjvsavcxtbvhj3429 2 жыл бұрын
Did you ever find reliable ones? I am in urgent need of a reliable reed switch.
@kingsleykronkk3925
@kingsleykronkk3925 2 жыл бұрын
@@tihruytssgjjvsavcxtbvhj3429 Don't trust them on critical curcuits. Reed switches are only reliable if you test many and discard the inferior. They are suspectable to quality mechanical variations when made. They only good for very small milliamps and when used in consistent repeated similar situations with no variations. Example if the magnet sits a long time beside the Reed .. or not .. it effects the magnetic effect sensitivity.. you got the picture.
@ianthehunter3532
@ianthehunter3532 3 жыл бұрын
How big is each of the boards you showed?
@marios_ideas
@marios_ideas 3 жыл бұрын
I am on holidays. When I am back I will try to measure them for you But I guess they would be something like 2x4cm 3x4cm
@ianthehunter3532
@ianthehunter3532 3 жыл бұрын
@@marios_ideas My goal is to make a matrix with them, you think using shift registers would be my best shot?
@Mr.ri4i
@Mr.ri4i Жыл бұрын
Is it possible to somehow do a kompass out of this
@marios_ideas
@marios_ideas Жыл бұрын
Not sure How this would work
@vasanthvijay6339
@vasanthvijay6339 2 жыл бұрын
Hi im vasanth from India I need your help if hall sensor contact with number of magnet its shown 7 segment display (like 1 magnet shown number 1 if i contact 3 magnet its shown number 3) please explain how is it and code
@marios_ideas
@marios_ideas 2 жыл бұрын
I do not believe this is possible as hall sensor reacts the same way to magnetic field so you cannot react differently to different magnets. Not sure ehat your project is. Normally it sounds like the use for RFID modules
@vasanthvijay6339
@vasanthvijay6339 2 жыл бұрын
@@marios_ideas thanks for reply and is it possible to do reed switch sensor
@marios_ideas
@marios_ideas 2 жыл бұрын
@@vasanthvijay6339 Same thing. You would have to do it other way around. Multiple sensors and one magnet. Then it would work
@vasanthvijay6339
@vasanthvijay6339 2 жыл бұрын
@@marios_ideas tq
@faysalmahamud6309
@faysalmahamud6309 3 жыл бұрын
How I get this two types of sensor?
@marios_ideas
@marios_ideas 3 жыл бұрын
There are links to Aliexpresss store in the description of the video
@mostafasohrabi5634
@mostafasohrabi5634 Жыл бұрын
exellent
@marios_ideas
@marios_ideas Жыл бұрын
THX:) Give the video a like if you enjoyed it
@johngrund2567
@johngrund2567 Жыл бұрын
Were you ever able to determine if the trouble with the LED remaining on was due to the sensor (quality) or a result of the way the hardware is interpreting & processing the code? I'm extremely new, but watched an amazing video on interrupts . . . and watching this did give me the thought that a possible solution could involve utilizing an interrupt. I'll link the video here: kzbin.info/www/bejne/aJzVZnRpapV7bac
@marios_ideas
@marios_ideas Жыл бұрын
The problem is strictly due to read switch not releasing . Maybe there are better quality parts out there . I bougth is from Aliexpress. But this shows that this can happen so it is not as reliable as Hall sensor
@marios_ideas
@marios_ideas Жыл бұрын
I have not worked with timer interrupts yet. I have on evideo on External interrupts but it is old and I would do it differently now. Got more profficient with video and sound editing:)
@uvwuvw-ol3fg
@uvwuvw-ol3fg Жыл бұрын
@@marios_ideas Could try adding some 1 kOhm resistor in series with it. Mine started to work with 100 Ohm but more is better theoretically. Decided to use 1 kOhm for better optimal input impedance and noise immunity. Seems weird that even the circuit provided with the reed switch might draw some capacitive inrush current which partially welds the contacts.
@Tyler-pj3tg
@Tyler-pj3tg Жыл бұрын
What about analog encryption for communications? Two of the same tape recordings on two nodes. Analog encryption saves a lot of energy for video transmissions. If you turn off encryption on your router. Your phone's battery will last twice as long.
@marios_ideas
@marios_ideas Жыл бұрын
This probably was meant for a fdifferent video. Right?
@mohammadsaiful5099
@mohammadsaiful5099 11 ай бұрын
Bm
@richardpetersen2747
@richardpetersen2747 Ай бұрын
You only used 5 mA instead of the 15 mA it recommends.
@marios_ideas
@marios_ideas Ай бұрын
Please Give me timestamp in the video So i can check. This is the very old video ,
@jacobclark89
@jacobclark89 2 жыл бұрын
☠️ I've been experiencing extremely dangerous episodes of the motor not stopping on my ebike as soon as I turn the throttle , related to high humidity conditions ! I think it's because the humidity increases conductivity of the hall sensors in the throttle . can you recommend a good throttle ? I think the manufacturers are going to have to make them water proof. I experienced the same issue with a different throttle , battery and controller. just using the bike after a rain storm is enough to cause the issue. We must have a throttle will a switch to cut power ! ☠️ Also stop using hot glue on the Hall sensors ! It melts were I live ! And make the throttle not Fall apart so easy , and they need to be made with softer grips or made to accept normal grip's.
@marios_ideas
@marios_ideas 2 жыл бұрын
Sorry I have no experience with Throttles. I might look at this topic in the future but am in no position to give any recomendations:) Especially if your life depends on them
@jacobclark89
@jacobclark89 2 жыл бұрын
@@marios_ideas Thanks, lm not at all asking for advice , but I would like to know if you were me what would you do ?
@jacobclark89
@jacobclark89 2 жыл бұрын
@@marios_ideas I'm going to try some dielectric greese between the magnet and sensor .
How to use millis() function to multitask in arduino code.
10:34
Mario's Ideas
Рет қаралды 58 М.
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 18 МЛН
Русалка
01:00
История одного вокалиста
Рет қаралды 6 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 56 МЛН
What is a Reed Relay? from Pickering Electronics
3:27
Pickering Electronics Ltd
Рет қаралды 110 М.
Reed switch motor
8:26
grain
Рет қаралды 534 М.
A3144 Hall effect switch - Simple Hall Effect Circuits You Can Build
7:08
LLG - Electrician
Рет қаралды 112 М.
HALL Effect SENSORS - Linear,UniPolar,BiPolar
11:52
Saravanan AL
Рет қаралды 80 М.
How Do Hall Effect Sensors Work? - The Learning Circuit
7:57
element14 presents
Рет қаралды 101 М.
Gas meter - Receive magnetic pulses with an ESP8266
12:57
MakerMeik
Рет қаралды 66 М.
Control a Stepper Motor with Hall Effect Switches
28:13
DroneBot Workshop
Рет қаралды 241 М.
Introduction to Reed Switches, Magnets & Magnetic Fields
8:41
Coto Technology
Рет қаралды 55 М.
Arduino Uno Tachometer RPM using 3144 Hall Effect Sensor
13:59
Clockatronic
Рет қаралды 102 М.
Effective Ways To Detect People With Common Sensors
7:43
Core Electronics
Рет қаралды 61 М.
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 8 МЛН
😱Хакер взломал зашифрованный ноутбук.
0:54
Последний Оплот Безопасности
Рет қаралды 703 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 3,4 МЛН