Arduino beginner here, blindly copying an internet recipe to make a toy for my child. I've managed to follow the circuit as posted online, and I now want to make one modification. Very grateful for some guidance on this
The circuit is to make a toy 'microwave' - the kid turns the rotary encoder and a 7 segment display displays a time. The kid then pushes the rotary encoder switch, and the display timer starts counting down. During countdown LEDs are lit. At the end of the countdown the LEDs turn off and a speaker makes a ping.
I want to add a motor in, so that while the LEDs are lit a motor is also spinning round (ie microwave plate spinning), then stops when the timer reaches zero.
I've got both a 5V servo and a 3V basic motor, happy to use either.
It was suggested by the original recipe creator that I could use D7 and basically copy the LED circuit but with the motor instead. However I'm stuck on what size resistor I'd need, and what the code would say
Any help very much appreciated
Finally I'm doing this all through USB at the moment but will want to use a battery pack when I go live. Any tips on what would fit this best? I have plenty of rechargeable batteries, AAA and AA. I am happy to use bigger batteries if needed, but ideally they'd last a long time as I don't have rechargeables, and don't want to buy new kit just for this. I was considering a solar power bank, maybe one which charges through mains too, so effectively a big battery, with a USB port so easy to switch to.
my guess is one way is to hook up just the motor (at collector and vcc) and npn and its base goes to the arduino pins.
if turning on the npn turns on the motor, you could then try to pwm it to regulate the speed
The simplest thing is a continuous rotation servo because it contains all of its own electronics and just needs its signal pin to be connected directly to an Arduino I/O pin. Use the Servo library to control it.
Give the servo its own power supply (usually 4.5 to 6v) with the servo GND connected to the Arduino GND.