Arduino NANO 33 BLE REV 2 SCENCE not working with a vibration motor


This is our set up for wires and such and we've tried everything, from changing out each component, different usb cables, and even the same board, we've been able to get it to work on a UNO R3 but not our Nano 33 BLE Rev 2 Scence.

#include "Arduino_BMI270_BMM150.h"
int motorPin = 3;  // digital pin connected to the base of the NPN transistor
int light = 8;
void setup() {
  // set the motorPin as an output:
  pinMode(motorPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // turn the motor on with full speed using PWM:
  digitalWrite(motorPin, HIGH);
  Serial.println("Motor is running at full speed");
  digitalWrite(light, HIGH);
  Serial.println("light on");
  // Add a delay to observe the output in the serial monitor
  delay(1000);
}

you don't set light as an OUTPUT
can you give a link to the motor
what power does it require?
e.g. the UNO uses 5V logic the Nano BLE sense 3.3V logic

6 Pcs DC Coreless Vibration Motors 7x25mm Micro Vibrating Motors 1-6V 8000-20000RPM for Electronic Vibration equipments and DIY Projects - Amazon.com

You need a seperate power supply for the motor. If you have not fried your Arduino you are lucky. Arduinos are not power supplies. From your picture I could not figure what you have or how it is connected. You have what appears to be a TO220 package, what is it and what is the pinout. Here is a schematic:


The ground of the motor power supply has to be connected to the ground of the Arduino power supply.

pinMode(light, OUTPUT);

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