STM32F103C8T6 Microcontroller-Based Motor Control and Sensing System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a comprehensive overview of an electronic circuit designed to control various components including motors, LEDs, and a microcontroller. The circuit utilizes a range of components such as the L293D motor driver, voltage regulators, switches, capacitors, resistors, diodes, a microcontroller (STM32F103C8T6), and various sensors and actuators. The microcontroller is programmed to manage the inputs and outputs, interfacing with the hardware to perform specific tasks.
Component List
Integrated Circuits
- L293D Motor Driver: A motor driver IC capable of driving two DC motors.
- 7805 Voltage Regulator: A voltage regulator that outputs a stable 5V from a higher voltage input.
- LM324 Operational Amplifier: A quad operational amplifier for signal processing.
- STM32F103C8T6 Microcontroller: A 32-bit ARM Cortex-M3 microcontroller used for controlling the circuit logic.
Passive Components
- Resistors: Various resistors with different resistance values (330 Ohms, 4700 Ohms, 10 kOhms).
- Capacitors: Ceramic and electrolytic capacitors with varying capacitance for filtering and stability.
- Diode: A diode used for protecting the circuit from reverse voltage.
Electromechanical Components
- DC Motors: Motors that are driven by the L293D motor driver.
- Servo: A servo motor controlled by the microcontroller.
- LEDs: Light Emitting Diodes of different colors (red, green, white) used as indicators.
- Toggle Switches: Switches used to control the power flow in the circuit.
- Pushbuttons: Momentary buttons used for input to the microcontroller.
- Phototransistors: Sensors that detect light levels.
Power Supply
- 9V Batteries: Batteries used to provide power to the circuit.
Miscellaneous
- Trimmer Potentiometers: Adjustable resistors used for setting voltage levels.
- Qwiic Cable - Breadboard Jumper (4-pin): A cable used for I2C communication.
- Terminal PCB 2 Pin: A connector for attaching external components.
Wiring Details
L293D Motor Driver
- Enable 1,2: Connected to microcontroller for motor control enable.
- Input 1, Input 2: Connected to microcontroller for motor direction control.
- Output 1, Output 2: Connected to DC Motor.
- GND: Connected to ground.
- Vcc1: Connected to 5V from the 7805 voltage regulator.
- Vcc2: Connected to a toggle switch and then to the positive terminal of a 9V battery.
7805 Voltage Regulator
- Vin: Connected to the positive terminal of a 9V battery through a diode.
- Gnd: Connected to ground.
- Vout: Connected to various components requiring 5V.
Toggle Switch
- COM: Connected to the positive terminal of a 9V battery.
- L1, L2: Connected to different parts of the circuit for controlling power flow.
LEDs
- Cathode: Connected to ground through a resistor.
- Anode: Connected to the microcontroller or other components for indicating status.
Resistors
- Connected in series with LEDs and other components for current limiting and voltage division.
DC Motors
- Connected to the L293D motor driver for operation.
Servo
- GND: Connected to ground.
- VCC: Connected to 5V from the 7805 voltage regulator.
- PWM: Connected to the microcontroller for control signals.
STM32F103C8T6 Microcontroller
- GND: Connected to ground.
- 3.3V: Connected to trimmer potentiometers and other components requiring 3.3V.
- Reset: Connected to a pushbutton for resetting the microcontroller.
- Digital/Analog Pins: Connected to various components for control and sensing.
Trimmer Potentiometers
- Used for adjusting voltage levels in the circuit.
Qwiic Cable - Breadboard Jumper (4-pin)
- GND: Connected to ground.
- 3.3V: Connected to 3.3V supply.
- SDA, SCL: Connected to the microcontroller for I2C communication.
Documented Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
The provided code is a template for the STM32F103C8T6 microcontroller. The setup() function is called once at the start, where initial configurations are made. The loop() function contains the main code that runs repeatedly. Specific functionality needs to be implemented within these functions to control the circuit's components based on the design requirements.