================================================================================================================================================

Friday, January 9, 2009

IR Remote Controlled Car (PWM motor control using ATmega8)





Hi Friends,
in my last post of Simple DC motor Control, I've discussed controlling a small DC motor using the PWM method with MOSFET H-bridge. The circuit was build with microcontroller ATmega8.
Here, I'm extending the same circuit to control the DC motor with IR remote control. The motor is fitted on a toy car wheels with gears, as shown in the figure above.

Following is the schematic (Click on the image to enlarge it):

The circuit uses two PWM channels of ATmega8 for controlling the speed and direction (reverse, forward) of the car, based on the command received from the IR remote. Here, a Sony TV remote was used. The IR codes were received by using TSOP1738 IR detector from Vishay. (Thanks a lot to Michael Spiceland from tinkerish.com, for helping me out with the code for IR signal decoding!).

Following buttons on the remote are used for control:
'1' : Start motor
Volume+ : Increase speed
Volume-: Reduce speed
Channel+: Forward direction
Channel-: Reverse Direction
'0': Stop motor

Check out the video (the LED blinks whenevr a key on the remote is pressed. The remote is not visible in the video as I was holding the camera and remote both!!)



The coding is done with ICCAVR compiler. It can be easily adapted to other compilers with minor changes. Complete code is given here:

View Code on Google Docs
Download source code files (zip)


Updated Design (done sometime in 2010, added here in 2018):
-------------------------------------------------------------------------------------------------------
       As brought out by many in comments, above design is not power efficient, as it uses n-type MOSFETS in upper and lower, both the sides of the H-bridge. So here is the modified design of a Three-wheeled dual DC motor robot (with speed, direction and turning controls), using  the popular L293D motor driver IC, which is very easy to control and size and power efficient, providing two full-bridge circuits in one IC, each having 1A capacity to drive a DC motor.


 

       Following is the circuit schematic:

 

    
     This one is ATmega32 based, IR remote controlled (using TSOP1738 IR detector) with two optical detectors (MOC7811) provision to detect the robot speed. Two detectors can be used to implement a control algorithm, like PID, if required (here only one detector is used, just to display the speed). A slotted wheel is used, mounted on the motor shaft, to work with the optical detector. The wheel slots pass through the detector, generating pulses while robot is moving. The pulses are counted for speed detection.
    It has a 16x2 LCD with 4-bit interface to display the speed and current status of the robot (based on the IR input received). It has a reset button and two user buttons. There is also hardware provision for RS232 driver on-board, for adding any further functionality, like adding user configuration in EEPROM via serial port, without changing the code.
    The design runs on a 9-12V DC supply. A commonly available 9V higher density battery can be used while running the robot. When powered NO, the circuit waits in ready state (with Green LED ON) till the button1 is pressed, after which it starts accepting the IR remote commands, and acts as per the commands (with Red LED ON). Following pictures show some of the functional states.


 

Here are the IR remote commands used for  robot control:

    Remote Button (IR code) -   Robo Action
    ----------------------------------------    ---------------
  • START/STOP         (21)         Start/Stop
  • VOLUME+            (18)         Increase Speed
  • VOLUME-              (19)         Decrease Speed
  • UP                        (116)        Go Forward  (and stop any turn already in progress)
  • Down                    (117)        Go Backward  (and stop any turn already in progress)
  • LEFT                     (52)         Turn Left  (pressing again makes turn sharper and sharper) 
  • RIGHT                   (51)         Turn Right  (pressing again makes turn sharper and sharper)
  • CENTER               (101)         Pivot Turn  (both motor wheels in opp. directions)

Following are the optical encoder slotted disc, optical encoder and the IR Remote receiver:

 


  
   
        Download source-code files (zip)

         Datasheets & further info:
         TSOP1738 datasheet
         MOC7811
         Encoder Slotted Disc
        




Thanks & Regards,
ccd@dharmanitech.com

226 comments:

«Oldest   ‹Older   201 – 226 of 226
digital john said...

Nice article

digital marketing course in hyderabad
digital marketing trainier

shane said...

Design with Microcontrollers" likely refers to a technical field or educational focus centered around the use of microcontrollers in electronic design and development. It involves creating and implementing various electronic systems and projects using microcontroller technology. abogado de testamentos y sucesionesThis field explores the integration of microcontrollers for automation, control, and embedded systems across various applications and industries motorcycle accident in virginia beach .

Anonymous said...

Thank you for consistently providing new and innovative perspectives that help us grow." Your site is an inspiration, and your work improves our lives.wanikani promo code

Saudi visa on arrival fees said...

I'm consistently enthralled by your blog! You masterfully intertwine profound insights with eloquent storytelling, providing readers with a thoughtfully designed expedition through a realm of knowledge. Your talent for simplifying intricate ideas is genuinely commendable. Gratitude for sharing this enlightening piece that profoundly resonates with your audience.

glen said...

Amazing, Your blogs are really good and information. It is very great and useful to all. Here, I'm extending the same circuit to control the DC motor with IR remote control. The motor is fitted on a toy car wheels with gears, as shown in the figure above motorcycle accident i 95 virginia. I got a lots of useful information in your blogs. Keeps sharing more useful blogs...

vcube said...

Nice article keep posting
Java Training institute in Hyderabad

Lilly Anna said...

Your IR Remote Controlled Car project showcasing PWM motor control using ATmega8 is both impressive and insightful! phil mickelson net worth The integration of ATmega8 for precise PWM control adds a layer of sophistication to the traditional remote-controlled car concept.

Mason said...

Great article on IR remote-controlled cars and PWM motor control! Your explanation of how PWM enhances motor control is really helpful for beginners like me. Can't wait to try these techniques on my next RC project.


bankruptcy chapter 7 attorney near me

lavanya said...

"Great article, felt good after reading, worth it.
i would like to read more from you.
keep posting more.
also follow Mern Stack course in hyderabad"

lavanya said...

nice article https://rudrasa.com/full-stack-development-course-in-hyderabad/

lavanya said...

nice work "Top Digital Marketing Agency In Hyderabad
"

perfect taiyari said...

nice article thanks perfect taiyari

lucask110198 said...

With its PWM motor control and ATmega8 microcontroller, the IR remote-controlled car provides accurate speed control and agile handling. Its user-friendly remote control makes for smooth navigation, making it an excellent option for both enthusiasts and hobbyists. Because of its simple setup and strong performance, it's perfect for novices.General law encompasses rules and regulations established by governments to maintain order, protect rights, and ensure justice. It includes civil, criminal, and administrative law, governing areas like contracts, property, and personal conduct. Law serves to resolve disputes, penalize unlawful actions, and provide a framework for societal functioning, ensuring fairness and security within the community.
violation of protective order virginia

Version IT said...

I read excellent articles and comments here, and they are always very helpful. I appreciate the valuable insights and enjoy leaving comments. Thank you for providing such great content!


SAP ABAP Training in Hyderabad

at power systems said...

On Grid Solar Rooftop Company in Hyderabad

Window Glass Replacement in Morton Grove, IL said...

High-Quality Window Glass Replacement in Morton Grove, IL
Get high-quality window glass replacement in Morton Grove, IL, with our dedicated team. We address issues like foggy, cracked, or broken glass, providing durable solutions that enhance your home's comfort and value.
Window Glass Replacement Morton Grove, Illinois

Wildcat Costume said...

I am looking forward to read more blog posts from Wildcat Costume keep it up!

Chicago Jacket said...

I am really glad to see this post. I also want to recommend you to try this Chicago Jacket

Astros Sweater Jacket said...

Astros Sweater Jacket for your next event to impress your friends and loved ones?

polojuabhi said...

"Great article, felt good after reading, worth it.
i would like to read more from you
keep posting more.cyber security training in Hyderabad
"

harryk110198 said...

An amazing project is the IR Remote Controlled Car, which uses an ATmega8 microcontroller and PWM motor control. It offers responsive handling and seamless speed control. The precise motor control provided by the ATmega8's PWM capability makes operating the car enjoyable and efficient. It's a great project for both novices and enthusiasts.The general law in the USA is a complex and evolving system rooted in both federal and state jurisdictions. It encompasses a wide range of legal principles, including constitutional, statutory, and case law. The system aims to balance individual rights with public order and safety. While it provides a framework for justice and legal processes, its complexity and variation across states can pose challenges. The ongoing development of laws reflects societal changes and strives to address contemporary issues, maintaining a dynamic legal landscape.
Los Angeles Appeals Lawyer

shawnfrank said...

Micro engineers, like Patti Scialfa and Tom Cruise in their respective fields, bring precision and expertise to their work. Just as Scialfa's music and Cruise's films captivate audiences with detail and craftsmanship, micro engineers excel in fine-tuning complex systems, ensuring everything operates smoothly and efficiently.

Azaleaden said...

The process includes writing code to program the microcontroller and integrating it with sensors, displays, and motors. It combines hardware design, circuit building, and embedded programming. This design approach is common in applications like robotics, automation, and consumer electronics.
Identity Theft Fraud Lawyer
Identity Theft Lawyer







whatisfullform said...

Ari Fletcher rose to fame as an Instagram influencer with millions of followers who admire her for her glamorous lifestyle, bold personality, and business ventures.What Happened Between Ari Fletcher and Tuson Jewell

www.galaxyeduworld.com/ said...

Great Article msc in clinical embryologyBangalore, often referred to as India's "Silicon Valley," is a leading center for education and medical research, offering exceptional opportunities for advanced studies in clinical embryology. The MSc Clinical Embryology program is a specialized postgraduate course tailored for students interested in reproductive sciences and assisted reproductive technologies (ART).

arsenaljackets said...

Get ready to embrace style and comfort with the Pink Spider Hoodie, available exclusively at Arsenaljackets.com. Crafted for those who love to stand out, this hoodie blends bold design with premium quality. Shop now to make a statement with every wear, only at Arsenaljackets.com.






«Oldest ‹Older   201 – 226 of 226   Newer› Newest»