JCA34F:
And ANOTHER thing , you are powering the HESs with 5V and connecting the signal to 3.3V (I think) inputs. Those HESs MAY be the kind you need, I can't say, 'cause I don't know how your project / device is supposed to work.
Oh, you are right, may that's the reason two of my MKR boards are not functional anymore.
The problem is sensors need 5V and the pins to the MKR board need to be 3.3 V. I think it is not a problem for UNO. However, relays can be powered by 3.3 V.
@Aarg and JCA34F thank you so very much guys for your help. After your handy comments and suggestions, I have finally made it work the way I wanted it to be.
@JCA34F regarding the sensors, I checked the voltage difference between ground and data pin of the sensor and it was 2.6 volts, so, I think that's fine and therefore, it is working even though I am powering it with 5 V. The minimum I can provide is 4.5 V to the sensor.
Regarding the 2 MKR boards, I thought they have been burned or something as they were not flashing and the computer was not recognizing them anymore. I am thankful to the guys on this forum because I learned in previous posts that if I put the board in bootloader mode, and flash a program it might work. And luckily it worked for me. So, my 2 MKR boards are working again
Will keep you guys posts regarding the progress and will let you know if I confront any issue again
Regarding my current project, I have an additional task to add to this project. I have a second button (red_button) that will turn ON or OFF the motor at any time, in other words, it would be the manual rotation of the motor. With the code that has to drive the motor automatically works fine. But the addition of the red_button is not working properly. I have attached the schematic of it to this comment.
What is the purpose of the red_button? Generally, when I press the red_button and the motor is not in motion, it should start rotation of the motor in the forwarding direction. And if it is already in rotation either forward or reverse direction, pressing the red button should stop the motor. So, pressing the button will stop the forward and the reverse motion, but it only allows the motor to rotate in the forwarding direction.
The issue I face is when I press the button it will start the motor in the forwarding direction. But when I want to stop the forward rotation the relay ticks very fast and makes that abrupt ticking sound. Sometimes it will stop and sometimes it won't the motor. Regarding the reverse rotation, if I press the red_button, it will stop the reverse rotation but (SOMETIMES) at the same time it starts the forward rotation.
Can you guys please tell me if I have done something wrong in the code or in the hardware?
Hi,
I am currently using this schematic in my current project. I want to know the limitations of this schematic. Additionally, can it affect the operation of Arduino and my code? Any tips to improve it. Currently, I have only 5 VDC and 24 VDC available.
Thank you!