Hi guys,
I could do with some help with a vibration motor. This is my first attempt at something that isn’t LEDs and resistors. It’s meant to cycle on / off with a 1s frequency. It’s via 3.3 and ground, with control from PWM output 3. It just sits there and does nothing. The code is below, it compiles and uploads OK. If I put an ammeter between output 3 and ground it alternates high and low, which makes me think the code is OK. I’ve tried two Uno’s and tried both 9v and USB power. The motor works and I’ve tried three. I’ve swopped out every component one at a time and re-tried after each swop out. The schematic is attached.
I have power and ground on the rails of the breadboard OK. I have alternating high-low from output 3 via a 1K resistor to the base of an NPN transistor to the emitter to ground OK.
I’ve nothing at the collector and so nothing from the collector to either side of the diode, the capacitor or the motor.
I’ve three doubts - the connectivity / quality of the breadboard (getting another), my interpretation of the schematic and my understanding of what I should be getting at the components. I ‘get’ ohm’s law at an abstract level but not when I’m putting the ammeter on the board – especially how to read current. I get the same voltage either side of the resister (I know it’s a device to lessen current) but – what??!
I understand this is dead basic newbie stuff, but I think I’ve been methodical and have followed the ‘go away and read documentation for two or three hours’ advice!! Cheers in advance, Al.
const int motorPin = 3;
void setup ()
{
pinMode (motorPin, OUTPUT);
}
void loop ()
{
digitalWrite (motorPin, HIGH);
delay (1000);
digitalWrite (motorPin, LOW);
delay (1000);
}
