Simple Motor Optical Encoder Circuit

21,069

Circuit Image

The simple motor optical encoder circuit is not particularly difficult; however, it requires careful verification to ensure all connections are correct before initial operation. The primary components utilized in the circuit include the 7805 voltage regulator, the PIC18F4520 microcontroller, and the L298HN motor driver. This circuit features a basic +5V power regulator for the digital signals and components. The +5V supply is also connected to the infrared (IR) detector circuit. The 7805 device serves as the voltage regulator, which is a widely used component available from numerous manufacturers. The PIC microcontroller has two main functions within this circuit: (1) it controls the motor via PWM signals outputted from pins RC1 and RC2, where RC1 produces a specific PWM signal and RC2 generates the inverse of that signal; (2) it receives data from the IR detector circuit, specifically monitoring the voltage at the output. Variations in this voltage indicate whether the optical encoder detects black or white surfaces. The IR detector circuit is constructed with two resistors and two IR components powered by the voltage supply. The IR LED emits light onto the encoder paper, and the IR detector captures the reflected signal. The L298HN motor driver receives commands from the PIC microcontroller through input pins 3 and 4. To simplify programming, Enable B on the motor driver is set to always enabled. Additionally, the motor controller is connected to a 12V battery supply for the motor and the +5V supply for digital signals.

The circuit design is centered around the integration of these components to achieve precise motor control and reliable feedback from the optical encoder. The 7805 voltage regulator plays a crucial role in ensuring that the microcontroller and IR detector receive stable power, which is essential for the consistent operation of the entire system. The PIC18F4520 microcontroller is programmed to generate pulse-width modulation (PWM) signals that control the speed and direction of the motor. The PWM signals are critical as they allow for smooth acceleration and deceleration, enhancing the overall performance of the motor.

The optical encoder setup consists of an IR LED and an IR phototransistor, arranged such that the LED illuminates the surface of the encoder disk. As the disk rotates, it reflects light back to the phototransistor, which detects the changes in light intensity corresponding to the black and white patterns on the disk. The output voltage from the phototransistor is fed back to the PIC microcontroller, where it is processed to determine the position and speed of the motor.

The L298HN motor driver is designed to handle high current loads and is capable of driving bipolar stepper motors and DC motors. By connecting the enable pin to a high logic level, the driver is kept active, reducing the complexity of the control logic required in the microcontroller code. The integration of a 12V battery supply ensures that the motor receives sufficient voltage to operate effectively, while the separate +5V supply for digital components maintains the integrity of the control signals.

In summary, this motor optical encoder circuit effectively combines power regulation, motor control, and feedback mechanisms to create a robust system for precise motion control applications. Proper assembly and verification of connections are essential to ensure the reliable operation of the circuit upon initial power-up.The simple motor optical encoder circuit is not terribly difficult however it will take some double checking to make sure you have everything hooked up properly before working the first time. The main devices used in the circuit are the 7805, 18F4520 and L298HN. This is a basic +5v power regulator circuit for the digital signals/components. Thi s +5v is also fed to the IR detector circuit. A 7805 device is used for regulating. This a very common +5v regulator and can be found at nearly any manufacturer. The PIC has two man chores for this circuit. (1) It is controlling the motor through RC1 & RC2 which are outputing PWM signals. RC1 outputs a certain PWM signal and RC2 outputs the exact inverse. (2) The PIC is also getting data from the IR detector circuit. Namely the voltage at the output. The change in voltage at the point will tell us whether the optical encoder sees black or white. This is as simple as it gets for IR detector circuits. We use two resistors and the two IR components with a power supply. The IR LED shines onto the encoder paper we will build and the IR detector gets the reflected signal. The L298 will receive all its commands from the PIC microcontroller at input 3 and input 4. I chose to make Enable B always enabled just so there would be less programming in the PIC. The motor controller is also directly hooked up to the 12v battery supply voltage as well as the +5v supply for the digital signals.

🔗 External reference




Warning: include(partials/cookie-banner.php): Failed to open stream: Permission denied in /var/www/html/nextgr/view-circuit.php on line 713

Warning: include(): Failed opening 'partials/cookie-banner.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/nextgr/view-circuit.php on line 713