Can someone help me with this l298n? I have a Tinkcad simulation

I am struggling to work out the problem with the simulation is. I imagine it is easy to figure out but as a noob, i am struggling.

Thanks in advance

Please post your sketch and a schematic of your project here

Sorry, I forgot to attach

Are you really using a 9V battery of that type ?

The circuit looks fine

What about the code?

potentially?

What about it ?
I can't see it, which is why I asked for it to be posted here. Don't forget to use code tags when you post it

Sorry. I was supposed to be replying to @abheek275. I apologise that you couldn't see the code. I thought that on Tinkercad the "code" button displayed the code.






int pump1duration = 3000;

int pause1 = 1000;

 


int pump2duration = 3000;

int pause2 = 1000;


 

 

int pump1pin1 = 3; 
int pump1pin2 = 4; 
int pump1pwm = 9;

 


void setup () {


pinMode(pump1pin1, OUTPUT);

pinMode(pump1pin2, OUTPUT);
  
pinMode(pump1pwm, OUTPUT);


 

}

 

 

void loop() {

 
analogWrite(pump1pwm, 255);
  
digitalWrite(pump1pin1, HIGH);
  
digitalWrite(pump1pin2, LOW);



delay(pump1duration);

digitalWrite(pump1pin1, LOW);
digitalWrite(pump1pin2, HIGH);


delay(pause1);



 
}

 


I can't see a code button, probably because I don't have an account

What problems are you having ?

When I start the simulation, the motor does not spin - that is all.

No, sorry, it doesn't.
The 5V connection to L298N pin 8 is missing, so internal circuits won't be powered and nothing happens. And pin 16 should go to 5V not 9V.
Then, the wires should be drawn with some more curves to let us see the connected pins, and with a color for a better representation (e.g. red wires for 5V, black for GND, and so on).

See this example, made from the original schematic:

Please note the 5V and 9V red wires to pins 8 and 16 on my schematic....

PS: this schematic works...

Thank you very much for your help. I ahve it working

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