So, i wanted to improvise, since i just saw how a type of tranasistor works with DC motor. First, i dont know why the code is not printing the initial value of my pir motion sensor, and, how does this vibration motor work anyways
please, please never ever again post pictures of text... Not only they are not readable nor usable directly for copy&paste but they use up lots of storage and internet bandwidth which contributes to polluting the planet.
➜ do your part and do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).
pin #1 is Tx of Serial, you don't want to use it ...
Data sheets or other documentation for each component will also be very helpful.
The motor is missing the required flyback diode to protect the MOSFET and some optional resistors to limit gate charge current and keep the MOSFET turned off while the gate is floating. The cap will bypass brush noise and help to keep the power clean.
also, the vibration motor is working now, but it's doing the reverse. when motion is not detected, it is vibrating, but when motion is detected, its not vibrating
you are missing the code tags, please read how to use the forum and post code correctly
Edit your post using the in the tool bar just below your post
select the code part and press the <code/> icon in the tool bar to mark it as code. (also make sure you indented the code in the IDE before copying, that’s done by pressing ctrlt on a PC or cmdt on a Mac)
that's what you'll see if you look at your board up close
I mean pin #1 is the Tx pin of your Serial instance (it's used by Serial to transmit bits to your Serial monitor)
i did put any resistance. the two terminals are connected to battery and pin, i am just starting to learn arduino, i saw a video on this motor, and decided to put another one just to improvise.
i think itll be better to use same pins then. also, in the video i watched, i didnt get why we are using a transistor, the guy skipped it