BLDC Back EMF Detection

Hi, I’m trying to make a small brushless motor and controller using an arduino nano board. My problem is in understanding how to detect the back emf from the motor. Currently, I have the motor spinning relatively fast, too fast to measure it by eye, but I’d say 100-150 rpm. I’ve looked at some articles1 online for measuring back emf with arduino and some of them use a voltage divider connected to each of the three motor phases and then connected to the analog pins of the arduino. The article I linked uses the arduino as a comparator, but I don’t really understand how negative voltage into the pins is prevented? Or why the resistors used in the voltage dividers have such high resistance (33k)?

Code

#define A_POW 2
#define B_POW 3
#define C_POW 4
#define A_GND 5
#define B_GND 6
#define C_GND 7

int time_delay = 10;  //Milliseconds
int transistor_delay = 10;    //Microseconds

void allOff() {
  digitalWrite(A_POW, LOW);
  digitalWrite(B_POW, LOW);
  digitalWrite(C_POW, LOW);
  digitalWrite(A_GND, LOW);
  digitalWrite(B_GND, LOW);
  digitalWrite(C_GND, LOW);
}

void pulsePhase(int power, int ground) {
  digitalWrite(ground, HIGH);
  digitalWrite(power, HIGH);
  delay(time_delay);
  digitalWrite(power, LOW);
  digitalWrite(ground, LOW);
  delayMicroseconds(transistor_delay);
}

void setup() {
  pinMode(A_POW, OUTPUT);
  pinMode(B_POW, OUTPUT);
  pinMode(C_POW, OUTPUT);
  pinMode(A_GND, OUTPUT);
  pinMode(B_GND, OUTPUT);
  pinMode(C_GND, OUTPUT);
}

void loop() {
  allOff();
  
  pulsePhase(A_POW, B_GND);
  pulsePhase(C_POW, B_GND);
  pulsePhase(C_POW, A_GND);
  pulsePhase(B_POW, A_GND);
  pulsePhase(B_POW, C_GND);
  pulsePhase(A_POW, C_GND);
}

Additionally, I notice that when I reduce by time_delay and transistor_delay lower that the above values, the motor just vibrates. Even at the values above, I have to spin the motor manually to start it. I think this is because I don’t have BEMF sensing yet, but is there another reason?

Additional Details:

The motor has 4 rotor poles and 12 stator poles arranged in the following pattern:
ABC(A-)(B-)(C-)ABC(A-)(B-)(C-).

The three output wires come from the A+, B-, and C+ ends of the coils.

I’ve attached my circuit diagram. The mosfet model number is IRLB8748PbF.
Data Sheet: https://www.infineon.com/dgdl/irlb8748pbf.pdf?fileId=5546d462533600a401535660665b2595

1 Sensorless BLDC motor control with Arduino - DIY ESC - Simple Projects

150rpm is easy to detect by eye, its 2.5 revolutions per second.

The 3-phase bridge cannot output voltages outside its supply range (0..20V), and each MOSFET has
a body-diode built-in so you'll not see voltages more than 1 diode drop outside that range. The motor
is not referenced to ground, so you wouldn't expect to see negative voltages.

But more importantly your 3-phase bridge circuit is plain wrong and cannot work efficiently. The high-side
switches need their gates driven to 5V above the 20V supply to turn them on. You're using then as
source-followers, not switches, so they will get hot.

The 20 ohm safety resistor is a good idea for developing the circuit BTW, that will save you from blowing
up MOSFETs when you get things wrong.

I always recommend using driver chips for MOSFETs in all but the simplest situations. Checkout the datasheet
for the FAN7388 or FAN7888 for an example of a 3-phase driver: https://www.mouser.com/datasheet/2/149/FAN7388-92309.pdf

Additional Details:

The motor has 4 rotor poles and 12 stator poles arranged in the following pattern:
ABC(A-)(B-)(C-)ABC(A-)(B-)(C-).

The three output wires come from the A+, B-, and C+ ends of the coils.

Totally irrelevant to driving a BLDC - they are all electrically the same.

Thank you for the reply. I researched more on how to drive the mosfet gates correctly and I found several bootstrap circuit designs so I modified my circuit (attached). Would this work better and prevent the heating issue? I’m trying to build most of the circuit myself, but I will try to get the gate driver chips if the circuit below won’t work. According to the data sheet for the mosfets, the input capacitance is ~2100 pF so I’m planning on using some 10 uF capacitors in the bootstrap circuit. I have some PN22221 transistors I plan to use as well.

In regards to the negative voltage, I don’t understand your explanation. Why won’t I see negative voltage in the floating phase of the BLDC? I’m trying detect a zero-crossing on the floating phase to know when to switch the phases. Doesn’t that mean that either before or after the crossing, the voltage would be negative?

1 https://www.onsemi.com/pub/Collateral/PN2222-D.PDF