Skip to main content
12 votes
Accepted

Two batteries sharing ground?

Not only can you share the grounds - sharing the grounds is required for there to be any form of meaningful circuit for signals to get around the place. To copy-and-paste a blog post I wrote some time ...
Majenko's user avatar
  • 105k
3 votes

maximum interrupt-based PWM frequency at 500 Hz

You wrote: Using [...] the atmega's hardware pwm is not very suitable because I need two 50/50 square waves with a phase difference of pi I believe hardware PWM is the best solution to your ...
Edgar Bonet's user avatar
  • 43.3k
3 votes
Accepted

H Bridge for microcontroller power management?

While it may be possible to bend one of those to your proposed usage, it's far from ideal, for a number of reasons: It's far more expensive than the single P-FET that you need to get the job done It'...
Majenko's user avatar
  • 105k
2 votes

Making an H-bridge with transistors

There is a few possible scenarios to create a H-bridge: with NPN transistors only or PNP mix of PNP and NPN You have to be careful to not mix the types and inputs. See pictures below:
smajli's user avatar
  • 472
2 votes
Accepted

maximum interrupt-based PWM frequency at 500 Hz

what exactly is it that makes a simple function like digitalWrite() so damn slow??! Why isn't it just a wrapper function for direct port manipulation? Well, it can take a variable as an argument. And ...
Nick Gammon's user avatar
  • 38.4k
2 votes
Accepted

Connecting Seeeduino XIAO 3.3 V out to dual H-bridge driver module (L298N) with TTL compatible inputs

Am I correct to assume that I do not need to step-up the logic signal (from 3.3V to 5V) for this to work, but can connect straight to the input? You are correct. The input has to be above 2.3V to ...
Majenko's user avatar
  • 105k
2 votes

How to tri-state an output circuit?

The simplest solution could probably be an H-bridge, like the ones you have on motor driver shields. Actually you only need half an H-bridge. You will typically be driving two inputs of the chip: “...
Edgar Bonet's user avatar
  • 43.3k
2 votes

L298N Dual Motor Controller Enable Pin has power but motors not working

I found this thread for a similar problem, I realized that my scratch (taken from here) wasn't able to works.. After many and many tries, I found that: the scratch works only using Serial Plotter, and ...
Marco's user avatar
  • 21
1 vote

What are the Vs and Vss pins on an L293D chip for?

As you can see in the linked L293D PDF VS is Supply Voltage (here connect the power source for motor) VSS is Logic Supply Voltage (here connect the power source for the L293D chip logic - usually the ...
gilhad's user avatar
  • 1,420
1 vote

Arduino H-bridge for rc car

Just a comment about your diagram. The two transistors should not share an Arduino pin in that way. If the pin is pulled high the transistors saturate and your current 'shoots through' from supply ...
markcra's user avatar
  • 21
1 vote
Accepted

How To Activate H-Bridge?

There was no common GND between the H-Bridge and the Arduino. The question has been solved.
GeorgeWTrump's user avatar
1 vote

How do I create a state machine for my purpose?

Creating a few boolian variables could help with this. bool opening = 0 bool closing = 0 const int Switch = 2; const int hbridge1 = 13; const int hbridge2 = 12; const int threshold = 400; int ...
Kevin Coleman's user avatar
1 vote

DC motor with L289N driver cannot set RPM lower than 130

Looks like you are controlling two motor outputs via the H-bridge, where the logic inputs are in1,in2 and in3,in4. First of all, you need pinMode(in1,OUTPUT); pinmode(in2,OUTPUT); One reason why ...
MichaelT's user avatar
  • 887
1 vote
Accepted

Multiple power supply for arduino controlled dc motor

According to the datasheet on the L298 IC the connections you described should be right. First I would recommend to connect 10v to the + and - rails and measure the voltage on the logical inputs if it ...
Coder_fox's user avatar
  • 688
1 vote

sending 16 bit command via SPI to a NCV7719 (half bridge)

SPI writes in 8-bit bytes. So the writes need to look like this: SPI.transfer(0b00000100); // first byte SPI.transfer(0b00000000); // second byte Possibly in the other order depending on which ...
Nick Gammon's user avatar
  • 38.4k
1 vote
Accepted

motor hard stop vs coasting

You are trying to use a mix of delay and millis Instead you will want a proper state machine: void loop(){ switch (state){ case GOING: go(); state = WAIT_FOR_COAST; ...
ratchet freak's user avatar
1 vote

How can I alter my program to read PWM signals from Arduino Mega?

It looks like the code in the ISR is slow and it may compute incorrect results. It is slow because of using floating point arithmetic in throttle_pwm and aileron_pwm calculations. It may be so slow ...
James Waldby - jwpat7's user avatar
1 vote
Accepted

How can I connect H-Bridge motor driver (using four 2n222 transistors) to Arduino?

I am not an electronics guru yet either so others might give you a better answer, but this is one circuit I have messed with a lot because I keep trying to build robots, so I will take a shot at an ...
ThatAintWorking's user avatar
1 vote

Arduino Driver can I use only PNP?

When connecting together several circuits that have different supply voltages, common practice is to make them all have a common negative supply rail. This is called “common ground”. As explained in ...
Edgar Bonet's user avatar
  • 43.3k
1 vote

Arduino Driver can I use only PNP?

Despite the fact that the circuit you have is completely wrong, there is one fundamental thing that is stopping you using a PNP transistor. With an NPN transistor you have to raise the voltage on the ...
Majenko's user avatar
  • 105k
1 vote

Arduino Driver can I use only PNP?

You need an NPN transistor to run a motor like that off of an arduino. Take a look at this article: https://learn.sparkfun.com/tutorials/transistors Similar to the NPN circuit, the base is our input, ...
Mension1234's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible