Need help with schoolwork, appreciated

Hi,
To make you code more readable, use pin names that describe their function,

int a=12;
int b=11;
int c=10;

TO;

int doorlatchPin=12;
int dooropenPin=11;
int doorclosePin=10;

Also in the IDE press CTRL T
It will auto format your code and make it easier to read.

THIS IS AN IMPORTANT BIT;
To add code please click this link;

You can also bump up the monitor speed too.

Serial.begin(115200);

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

1 Like

Third and last..

I am connecting Relay 3&4 COM to GND (Computer Power Supply) via connectors
I am connecting Relay 1&2 COM to 5V (Computer Power Supply) via connectors

I am connecting Relay 1 NO & Relay 3 NC to one pin of the motor (via soldering)
I am connecting Relay 2 NO & Relay 4 NC to another pin of the motor (via soldering)

Also the solution was.. one of the relay wasn't working quite good,I tried changing it and now it works.. and about the arduino input its via 6 battery holder approximately 7.4v with the 1.2v batteries.

Thanks in advance to everyone trying to teach me new stuff, I am still young 18y/o.. I can do it better next time with this help.. when the project is fully I will do a short video about the work I've been doing.

Your drawing is not bad... obviously it helped the guys address your questions.

Try as hard as you can to expose the images properly, and if you want to move on in electronics design, read up on schematic layout.

Good practice has signal flowing from left-to-right, and current flow from top to bottom.
This as much for future repair & troubleshooting, as it is for initial development.

1 Like

Whoah!

That's a total disaster! :astonished:

Any glitch in the relay operation will short out the 5 V computer power supply!

I didn't look at it earlier, but that is a terrible blunder!

You need two relays, not four. The commons of the relays go to the two motor wires. The NC of both relays goes to ground and the NO of both relays goes to 5 V.

Please fix this mistake before going any further. :woozy_face:

Hi,
You can FWD/REV with two relays and safely so you cannot short the supply.

RELAY1 OFF RELAY2 OFF MOTOR OFF
RELAY1 ON RELAY2 OFF MOTOR FWD
RELAY1 OFF RELAY2 ON MOTOR REV
RELAY1 ON RELAY2 ON MOTOR OFF

I hope this helps..

Tom... :grinning: :+1: :coffee: :australia:

That's a nice diagram - I'm saving that! :+1:

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.