diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Code/PMW3901_Direction_Indicator/PMW3901_Direction_Indicator.ino b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Code/PMW3901_Direction_Indicator/PMW3901_Direction_Indicator.ino new file mode 100644 index 0000000..d28f889 --- /dev/null +++ b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Code/PMW3901_Direction_Indicator/PMW3901_Direction_Indicator.ino @@ -0,0 +1,202 @@ +#include +#include +#include +#include +#include + +// OLED Display setup +#define SCREEN_WIDTH 128 +#define SCREEN_HEIGHT 64 +Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); + +// PMW3901 Sensor setup +#define CS_PIN 5 // Chip Select Pin for PMW3901 +Bitcraze_PMW3901 flow(CS_PIN); + +const unsigned char Start_icon [] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, + 0x80, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, + 0xe0, 0x07, 0xfc, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x3f, 0x80, + 0x03, 0xf8, 0x00, 0x00, 0x1f, 0xc0, 0x03, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0xe0, 0x00, 0x00, + 0x07, 0xe0, 0x0f, 0xc0, 0x00, 0x00, 0x03, 0xf0, 0x0f, 0x80, 0x38, 0x00, 0x01, 0xf0, 0x1f, 0x00, + 0xfc, 0x00, 0x00, 0xf8, 0x1f, 0x01, 0xff, 0x00, 0x00, 0x78, 0x3e, 0x01, 0xff, 0x80, 0x00, 0x7c, + 0x3c, 0x01, 0xff, 0xe0, 0x00, 0x3c, 0x3c, 0x01, 0xef, 0xf0, 0x00, 0x3e, 0x7c, 0x01, 0xe3, 0xfc, + 0x00, 0x3e, 0x78, 0x01, 0xe1, 0xfe, 0x00, 0x3e, 0x78, 0x01, 0xe0, 0x7f, 0x80, 0x1e, 0x78, 0x01, + 0xe0, 0x3f, 0xc0, 0x1e, 0x78, 0x01, 0xe0, 0x0f, 0xc0, 0x1e, 0x78, 0x01, 0xe0, 0x07, 0xc0, 0x1e, + 0x78, 0x01, 0xe0, 0x07, 0xc0, 0x1e, 0x78, 0x01, 0xe0, 0x0f, 0xc0, 0x1e, 0x78, 0x01, 0xe0, 0x3f, + 0xc0, 0x1e, 0x78, 0x01, 0xe0, 0x7f, 0x80, 0x1e, 0x7c, 0x01, 0xe1, 0xfe, 0x00, 0x3e, 0x7c, 0x01, + 0xe3, 0xfc, 0x00, 0x3e, 0x3c, 0x01, 0xef, 0xf0, 0x00, 0x3e, 0x3c, 0x01, 0xff, 0xe0, 0x00, 0x3c, + 0x3e, 0x01, 0xff, 0x80, 0x00, 0x7c, 0x1f, 0x01, 0xff, 0x00, 0x00, 0x78, 0x1f, 0x00, 0xfc, 0x00, + 0x00, 0xf8, 0x0f, 0x80, 0x30, 0x00, 0x01, 0xf0, 0x0f, 0xc0, 0x00, 0x00, 0x03, 0xf0, 0x07, 0xe0, + 0x00, 0x00, 0x07, 0xe0, 0x03, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x01, 0xf8, 0x00, 0x00, 0x1f, 0x80, + 0x01, 0xfe, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x7f, 0x80, 0x01, 0xfe, 0x00, 0x00, 0x3f, 0xf0, 0x0f, + 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, + 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +const unsigned char LEFT_arrow [] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, + 0xc0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, + 0x01, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x00, 0x00, + 0x01, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +const unsigned char UP_arrow [] PROGMEM = { + 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xff, + 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, + 0xff, 0xff, 0xfc, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00 +}; + +const unsigned char RIGHT_arrow [] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x80, + 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x03, 0xff, 0x80, + 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xfc, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +const unsigned char DOWN_arrow [] PROGMEM = { + 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00, 0x00, + 0x3f, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, + 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, + 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x07, + 0xff, 0xff, 0xe0, 0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x01, 0xff, 0xff, 0x80, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x07, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00 +}; + + + +// Arrow width & height +#define ARROW_WIDTH 48 +#define ARROW_HEIGHT 48 + +// Store last movement direction +String lastMovement = "No Movement"; +const unsigned char* lastArrow = nullptr; + +void updateDisplay() { + display.clearDisplay(); + // Center the arrow + int x = (SCREEN_WIDTH - ARROW_WIDTH) / 2; + int y = (SCREEN_HEIGHT - ARROW_HEIGHT) / 2; + + if (lastArrow) { + display.drawBitmap(40, 8, lastArrow, ARROW_WIDTH, ARROW_HEIGHT, WHITE); + } + display.display(); +} + +void setup() { + Serial.begin(115200); + + // Initialize OLED + if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { + Serial.println("SSD1306 allocation failed"); + while (1); + } + + // Initialize PMW3901 + SPI.begin(); + if (!flow.begin()) { + Serial.println("PMW3901 Initialization failed!"); + display.clearDisplay(); + display.setTextColor(WHITE); + display.setCursor(10, 25); + display.println("Sensor Fail!"); + display.display(); + while (1); + } + + Serial.println("PMW3901 Initialized"); + display.clearDisplay(); + lastArrow = Start_icon; + updateDisplay(); +} + +void loop() { + int16_t deltaX = 0, deltaY = 0; + + // Read motion data + flow.readMotionCount(&deltaX, &deltaY); // Directly updates deltaX & deltaY + + Serial.print("DX: "); Serial.print(deltaX); + Serial.print(" DY: "); Serial.println(deltaY); + + // Ignore small movements + if (abs(deltaX) < 3 && abs(deltaY) < 3) { + return; // Do not update display if no new movement + } + + // Detect only Up, Down, Left, Right + if (deltaX > 3 && abs(deltaY) < 3) { + lastMovement = "Right"; + lastArrow = RIGHT_arrow; + } else if (deltaX < -3 && abs(deltaY) < 3) { + lastMovement = "Left"; + lastArrow = LEFT_arrow; + } else if (deltaY > 3 && abs(deltaX) < 3) { + lastMovement = "UP"; + lastArrow = UP_arrow; + } else if (deltaY < -3 && abs(deltaX) < 3) { + lastMovement = "Down"; + lastArrow = DOWN_arrow; + } else { + return; // Ignore diagonal movements + } + + updateDisplay(); // Update OLED only when movement occurs +} diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Code/PMW3901_Framebuffer/PMW3901_Framebuffer.ino b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Code/PMW3901_Framebuffer/PMW3901_Framebuffer.ino new file mode 100644 index 0000000..cca5ee6 --- /dev/null +++ b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Code/PMW3901_Framebuffer/PMW3901_Framebuffer.ino @@ -0,0 +1,143 @@ +#include +#include +#include +#include + +// WiFi credentials +const char* ssid = "SSID"; +const char* password = "PASSWORD"; + +// PMW3901 (CS pin on GPIO 5) +Bitcraze_PMW3901 flow(5); + +// Web server on port 80 +AsyncWebServer server(80); + +// Frame buffer (35x35 = 1225 bytes) +char frame[35 * 35]; + +void setup() { + Serial.begin(115200); + + // Initialize PMW3901 + if (!flow.begin()) { + Serial.println("PMW3901 init failed"); + while (1); // halt + } + + flow.enableFrameBuffer(); + Serial.println("PMW3901 frame buffer enabled"); + + // Connect to Wi-Fi + WiFi.begin(ssid, password); + WiFi.setSleep(false); // improves performance + while (WiFi.status() != WL_CONNECTED) { + delay(1000); + Serial.println("Connecting to WiFi..."); + } + + Serial.print("Connected. IP address: "); + Serial.println(WiFi.localIP()); + + // Serve HTML UI + server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) { + String html = R"rawliteral( + + + + PMW3901 Frame Buffer + + + +

PMW3901 Frame Buffer

+
FPS: 0
+ + + + + + )rawliteral"; + request->send(200, "text/html", html); + }); + + // Binary data response + server.on("/data", HTTP_GET, [](AsyncWebServerRequest* request) { + flow.readFrameBuffer(frame); + request->send_P(200, "application/octet-stream", (uint8_t*)frame, sizeof(frame)); + }); + + server.begin(); +} + +void loop() { + // Nothing here +} diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/Interfacing PMW3901 Optical Flow Sensor With ESP32.png b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/Interfacing PMW3901 Optical Flow Sensor With ESP32.png new file mode 100644 index 0000000..7182568 Binary files /dev/null and b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/Interfacing PMW3901 Optical Flow Sensor With ESP32.png differ diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 ESP32 Interfacing Circuit Diagram.png b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 ESP32 Interfacing Circuit Diagram.png new file mode 100644 index 0000000..132ea0e Binary files /dev/null and b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 ESP32 Interfacing Circuit Diagram.png differ diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 Module Schematic.png b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 Module Schematic.png new file mode 100644 index 0000000..44526ab Binary files /dev/null and b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 Module Schematic.png differ diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 Motion Direction IndicatorCircuit Diagram.png b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 Motion Direction IndicatorCircuit Diagram.png new file mode 100644 index 0000000..491e932 Binary files /dev/null and b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901 Motion Direction IndicatorCircuit Diagram.png differ diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901.gif b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901.gif new file mode 100644 index 0000000..a098444 Binary files /dev/null and b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/PMW3901.gif differ diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/Pimoroni PMW3901 (Module_Pinout)-01.jpg b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/Pimoroni PMW3901 (Module_Pinout)-01.jpg new file mode 100644 index 0000000..a20a1a9 Binary files /dev/null and b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Images/Pimoroni PMW3901 (Module_Pinout)-01.jpg differ diff --git a/Interfacing PMW3901 Optical Flow Sensor With ESP32/Readme.md b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Readme.md new file mode 100644 index 0000000..f646a2f --- /dev/null +++ b/Interfacing PMW3901 Optical Flow Sensor With ESP32/Readme.md @@ -0,0 +1,18 @@ +# [Interfacing PMW3901 Optical Flow Sensor With ESP32](https://circuitdigest.com/microcontroller-projects) +

+alt_text +

+ +circuitdigest + +[

Click here](https://circuitdigest.com/tags/ESP32) For other ESP32 tutorials.

+Drones rely on various sensors to maintain stable flight, especially when GPS is unavailable or unreliable. One important feature is position holding, where the drone stays in one place without drifting. This is crucial for indoor navigation, hovering, and precision landing. Optical flow sensors, like the PMW3901, help drones achieve this by tracking motion relative to the ground. +

+ +

+The PMW3901 is a small, low-power optical flow sensor that measures movement by analysing surface patterns. It is widely used in robotics, drones, and automation to estimate position changes without GPS. This makes it an excellent choice for applications requiring precise motion tracking. In this guide, we will explore the PMW3901 sensor, its specifications, and how to interface it with ESP32. +

+ + [Note: As these projects are very simple, we are only providing the code, schematic, and a few essential images. If you want to get the images or code explanations, do check out the Circuit Digest website.] + +