Solarbotics | My Assignment Tutor

Our motor• Our motor– GM8 from Solarbotics– Speed depends on the voltage3V ☞ 40 RPM (Revolutions Per Minute)6V ☞ 78 RPM9V ☞ 110 RPM12V ☞ 135 RPM• Feather ESP32 only provides 3.3 V or 5 V(USB)– How to drive the motor with a higher voltage?Our Isolator• Isolator– Battery adaptor– Provides 9V• Much higher than 3.3V– Prevent current flowsfrom 9V board to 3Vboard– Direction of the Isolatorsand whiteboards Matters• Check GND and PowerpositionsInput Pins Output Pins3.3 V9 VControlling higher loads with a small current• Relays– Mechanical Switch– Simple but slow (and bouncy)– Useful for simulating button on existing device– Using Magnetic field generated by the current tocontrol a switchControlling higher loads with a small current• TransistorIllustrations from “Practical Electronics for Inventors” by P. Scherz2N2222ATIP 120Controlling higher loads with a small current• Readings:• Additional Readings:• 1.• 2: from “Practical Electronics for Inventors” by P. ScherzTransistor• TIP 120 Transistor– Base (B) :• Where the control signal goes• Control flow between C and E– Collector ( C ):– Emitter ( E) :BaseCollector EmitterControlling a motor or a coil• Use a Darlington Transistor– for controlling high load device(e.g.,Motor)• Vce= 2V (sat)• Gain about 200• Motor/Coil generate spikes– Add a diode• Motor generate noise– Add a filtering capacitorReading: a motor or a coilFrom microcontrollerPin 131KΩ ( In Sensor Kit)Vce= up to 2 V at 2ABC EControlling a motor or a coilB C ERed wire connects to the power (9V)Ceramic Capacitor No PolarityB: BaseC: CollectorE: EmitterCathode is the side with grey markingLayoutNo Wire between the two boards!IsolatorRead Schematic to complete writingLEDBreathing for Motor#include // LED Pin / Control the motorconst int ledPin = 13;void setup() {pinMode(ledPin, OUTPUT);}void loop() {// fade the LED on thisPin from off to brightest:for (int brightness = 0; brightness < 255; brightness++) {analogWrite(ledPin, brightness);delay(5);}// fade the LED on thisPin from brithstest to off:for (int brightness = 255; brightness >= 0; brightness–) {analogWrite(ledPin, brightness);delay(5);}}Code Revised from: Arduino AnalogWrite Example : AnalogWriteMega


Leave a Reply

Your email address will not be published. Required fields are marked *