instead of the relay you can just use a voltage divider as a level shifter to get the voltage down to the proper voltage for the arduino digital input pin 5 or 3.3 volt depending in which arduino you use.
@DuctTapeMechanic2 жыл бұрын
A optocoupler would also work
@meloconza77183 жыл бұрын
this input_pullup function was new to me, verry usefull , thanks a lot
@DuctTapeMechanic3 жыл бұрын
Yes its a great function. Before I knew about it, I used to use actual pullup resistors to achieve this. Thanks for watching!
@AlexPrivett3 жыл бұрын
I am designing and building a laser cutter, this was exactly what I was looking for, thanks for uploading.
@DuctTapeMechanic3 жыл бұрын
Thanks for watching!
@etiennedejager58212 жыл бұрын
Very well explained. Thanks. I just bought an arduino uno and a proximity sensor. I would like the buzzer however to only go off when something passed by the sensor every say third time. Basically have the arduino count the amount of times the sensor is triggered and buzz when it reaches the set amount like with every third item. Is that possible and how would you do that? Would you do a video on that for us?
@alo12365462 жыл бұрын
Npn sensor will pull ground when activate. Direct connet pull up input arduino.
@markmeme28 Жыл бұрын
thank you I have a small question what should i do to make a counter to count the number of metals ?
@DuctTapeMechanic Жыл бұрын
Check out my video "Speed bag punch counter" in which I use this same sensor in a counting application
@markmeme28 Жыл бұрын
@@DuctTapeMechanic thank you 🙏🏻
@jawadmazher56214 жыл бұрын
That's really cool! What do we do if we want the sensor to beep before the object gets too close, do we just get a stronger sensor or can this be controlled with Arduino code?
@DuctTapeMechanic4 жыл бұрын
Thanks. This sensor has a screw on the top which allows for some variation of the sensitivity but a better sensor would be the way to go.
@scottbechdolt65869 ай бұрын
Hi, I don't understand what you meant by connecting to the anode if you want the relay to do the opposite. Anode of what? . Does a coil have an anode?
@DevilFreakShow Жыл бұрын
If i want to take count of pulses of a rotating shaft of motor and show or store it on my server what can i do should i use something else ?
@JimBeshears Жыл бұрын
Be careful with cheap sensors unless the application isn't critical. They usually have EMC and temperature drift problems.
@DuctTapeMechanic Жыл бұрын
Thanks for the heads up. I mostly use them for non vital "fun" projects
@JimBeshears Жыл бұрын
@@DuctTapeMechanic nice job on the video also!
@justlutfi28903 жыл бұрын
you can simplify using BC547
@DuctTapeMechanic3 жыл бұрын
Yes that will probably work. I recommend us pc817 for an alternative way to do this
@qqmayakashi Жыл бұрын
Is there a way to control the sensitivity of the proximity sensor using arduino code? if not what should i find to be able to do it?
@DuctTapeMechanic Жыл бұрын
You can adjust the sensitivity on the sensor itself using the set screw
@sye79692 жыл бұрын
have you also connected the arduino board to laptop/pc along with the battery ? does it cause any harm ?
@BigBang11n70 Жыл бұрын
Hi Man, nice video! Does it work the same way for a 24v light barrier sensor if you get a 24V relais? Cheers
@thomas32363 жыл бұрын
Thanks, that was really helpful.
@fadelcmd99693 жыл бұрын
Hi, can you tell me what kind of part that you use or maybe you can send me the link to buy that part. Cause I need that so much, I need to connect my capacitive sensor to the arduino. Btw thank you for making the videos, it helps me a lot.
@DuctTapeMechanic3 жыл бұрын
Its called a 12v dpdt relay. Thank you for watching. www.amazon.com/Electromagnetic-Socket-Mechanical-Indicator-LY2N-J/dp/B07SYYP41M/ref=mp_s_a_1_7?dchild=1&keywords=DPDT%2BRelay&qid=1604236771&sr=8-7&th=1&psc=1
@toddmaggio20322 жыл бұрын
Thank you for sharing your knowledge. My question is whether it is possible for a sensor to reverse the current in a circuit any time it detects a target. And if so how can it be done?
@DuctTapeMechanic2 жыл бұрын
Just hook up the dpdt relay with a cross pattern this will reverse polarity when something is detected. You don't even need an Arduino. Just go from sensor to dpdt relay to dc motor (I presume)
@farahnasir50234 жыл бұрын
😎 cool
@kevinpiot7317 Жыл бұрын
What is the relay for?
@DuctTapeMechanic Жыл бұрын
Just a rudimentary way to interface the 12 volt sensor with the arduino a PC817 optocoupler would be a more elegant choice
@mftest1002 жыл бұрын
Hey, great video - I've missed this, (I am a total beginner) what is the purpose of building in the relay ? Hope you can enlighten me :-)
@DuctTapeMechanic2 жыл бұрын
Good question. The relay acts as a switch. Basically when the sensor is triggered (something is detected) it "turns on" the relay which in turn grounds out the arduino pin. And the pin going to ground can be coded for (i.e. sensed by the arduino). The relay helps integrate the sensor with the arduino while keeping them electrically isolated, a more elegant (more proper) way to do this would be to use a PC817 optcoupler instead of a relay (but this does work). I was kind of working with what I had at the moment.
@mftest1002 жыл бұрын
@@DuctTapeMechanic Tx very much - I had thought of the PC817, because I have seen that on other project - much obliged for your very relevant feedback - Michael
@iamax83072 жыл бұрын
How can I use this to make the buzzer louder as object gets closer? Welp
@mohammedkhallaf64784 жыл бұрын
What if I want to use an analog sensor?
@DuctTapeMechanic4 жыл бұрын
Perhaps you could try using a optocoupler pc817
@DuctTapeMechanic4 жыл бұрын
Dividing the voltage with resistors would work as well
@nizarfahimi7 ай бұрын
What is the function of the relay in this project?
@DuctTapeMechanic7 ай бұрын
In a nutshell, it serves as a voltage isolation mechanism. There are probably a lot of better ways to do it. Just what I thought of at the time.
@nizarfahimi7 ай бұрын
@@DuctTapeMechanicwhen connecting the output of the sensor does the voltage need to be stepped down?
@nizarfahimi7 ай бұрын
@@DuctTapeMechanicwhat power source did you use in the video?
@jaredyuri38843 жыл бұрын
hi, I have a retroreflective NPN sensor and have the same diagram like yours proximity sensor , but after many attempts it doesn't work at all
@DuctTapeMechanic3 жыл бұрын
If you get me the part number maybe I can look up the wiring schematic to get a better idea of your problem.
@jaredyuri38843 жыл бұрын
@@DuctTapeMechanic for first Thank you for your answer and the part number is : Omron e3jk-rn12
@rajarshigiri16642 жыл бұрын
I am trying to build a proximity sensor project where if you are too far away from your ba while travellin it buzzes or sends a notification. will this be possible in audrino or I need rasberry and what kind of proximity sensor should i use for that?