R/C Car Infrared transmitter/receiver

Arduino User Community,

I need to build an infrared (IR) transmitter, the remote control, that will be able to send the following commands to my toy R/C car.

Forward
Backward
Left
Right

The infrared (IR) receiver on the R/C car will need to be able to process the same commands. This is a standard R/C car with a front motor (used for turning left and right, based on polarity), and a back motor (used to command forward and backward, based on the polarity). I'd like to set up a series of four different switches, each as follows:

These First two switches must be mutually exclusive (not commanded at the same time)
-One switch that sets the positive polarity to the left side side of the motor and the negative to the right side (left turn)
-One switch that sets the positive polarity to the right side side of the motor and the negative to the left side (right turn)
These second set of switches must also be mutually exclusive
-One switch that sets the positive polarity to the forward side side of the motor and the negative to the backward side of the motor (forward)
-One switch that sets the positive polarity to the backward side of the motor and the negative to the forward side of the motor (backward)

kind regards,

-Codiac

What have you done so far ?
Can you read an IR signal and display the received code on the Serial monitor ?
Have you looked at and tried the examples in the IRremote library ?

Its not clear if you want your Arduino to send IR commands to an existing IR receiver. If so you will need to know the codes that the receiver expects.

If you are planning to create your own receiver then this Serial IR Thread should be a good starting point

And if you are thinking of building your own transmitter and receiver you my wish to consider using nRF24L01+ transceivers which will give a great deal more capability at very little extra cost. See this Simple nRF24L01+ Tutorial

...R

For UKHeliBob: I don't know what a serial monitor is, so I guess not. I need both the transmitter and receiver. I need the transmitter to command the switching modes and the receiver to interpret them.

For Robin2: I will go with the RF transmitters, as they don't require a direct line of sight. Thank you, so much! I will research the references you gave me and see if this is right, but I already looked at it on Amazon and it looks good. They are only a $1 each. I'm willing to spend the extra money to make the project easier.
*Follow-on Question 1: do I need to buy anything else for these nRF24L01 tranceivers? From the post you sent, it looks like I need to buy an arduino "Uno" board. I am also unfamiliar with the "SPI" interface. As I read more, I realize that maybe I need to take a class to see how this all works together.
*Follow-on Question 2: Do I need to buy any test equipment to get these transmitters working? I have a soldering iron and wire, but is there anything else I need? Do I need an oscilloscope or a spectrum analyzer? I've just got a basic volt meter to check voltages and wiring continuities.

codiac:
*Follow-on Question 1: do I need to buy anything else for these nRF24L01 tranceivers? From the post you sent, it looks like I need to buy an arduino "Uno" board. I am also unfamiliar with the "SPI" interface. As I read more, I realize that maybe I need to take a class to see how this all works together.

I wrote my tutorial based on an Uno because that is the most "standard" Arduino but the idea works with any Arduino board. I have built several with an Atmega 328 chip on stripboard and a few with an Attiny chip glued to the underside of the nRF24 because I did not have space for a PCB. But see my answer to your next question.

*Follow-on Question 2: Do I need to buy any test equipment to get these transmitters working? I have a soldering iron and wire, but is there anything else I need? Do I need an oscilloscope or a spectrum analyzer? I've just got a basic volt meter to check voltages and wiring continuities.

No you should not need any special test equipment. An oscilloscope that can work with 2.4GHz signals would be VERY expensive. I use male-female dupont connectors to connect the nRF24 to the Uno for testing.

I know it may seem like an extra investment but I strongly recommend that you first get my examples working with a pair of Unos. If you run into a problem it will be much easier to help you.

Once you know how to get reliable communication working you can experiment with other board options.

When I am building a new wireless device I normally set up a pair of Unos to test communication using the code in my Tutorial and then substitute the new device for one of the Unos.

...R

Robin2,

Oh yeah I guess an O-scope would be pretty expensive in the GHz range. I'm pretty rusty at this. I will go ahead and order two uno boards, two nRF24L01s, and two male-female dupont connectors . Is there anything else I should buy?

I am also thinking about ordering an Arduino Motor Shield, as I heard this is what can be used to control the motors that I was discussing in my initial post. Do you think that is a good idea?

I found the arduino uno (rev3) and the motor shield (rev3).

I'm unable to find nRF24L01+ transceivers on the arduino site. Where should I buy them? I found some on amazon: https://www.amazon.com/Makerfire-Arduino-NRF24L01-Wireless-Transceiver/dp/B00O9O868G.

Also, I can't find the dupont male-female connectors anywhere.

I can't find the dupont male-female connectors anywhere.

How hard did you look ?

codiac:
Also, I can't find the dupont male-female connectors anywhere.

What part of the world are you in?

Part of the problem is that often the connectors are not called DuPont connectors (I presume DuPont is a trademark).

...R

Hi,

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom... :slight_smile:

Reply for TomGeorge: I have experience programming, I've taken college courses. I have a degree in Electrical Engineeering. I have made many circuits and used spectrum analyzers.

I have worked extensively on this project now and I have a working R/C car. The problem I'm having is with the L298 Motor controller.

It seems like ENA and ENB pins, which use pulse width modulation (pwm), don't behave as expected. When I connect IN1 and IN2 and ENA, then the car can turn left or right (front motor). When I connect IN3 and IN4 and ENB, then the car will go forward backward (back motor). But when I connect ENA-IN1-IN2 and ENB-IN3-IN4 both at the same time, I can no longer command the car to just go forward and backward. It will only operate both motors. It is like the ENA IN1-IN2 are somehow connected to IN3-IN4 and I don't know why. Please see my code below as a reference.

It is using the following devices:

Transmitter:
-Arduino Uno Board
-Arduino NRF24L01+ 2.4GHz Wireless RF Transceiver Module New
-SMAKN Fr4 Ky-023 Joystick Breakout Module Sensor Shield for Arduino Uno/arduino UNO R3/arduino
2560/arduino 2560 R

Receiver:
-Arduino Uno Board
-Arduino NRF24L01+ 2.4GHz Wireless RF Transceiver Module New
-Motor Driver Circuit: Qunqi L298N Motor Drive Controller Board Module Dual H Bridge DC
Stepper For Arduino

RC_car_TX_first.ino (1.11 KB)

RC_car_RX_first.ino (3.47 KB)

Hi,

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Have you got your ENA and ENB connections connected to PWM capable pins on the UNO?

Thanks.. Tom.. :slight_smile:

The problem with the circuit was that the motor controller (Qunqi L298N Motor Drive Controller Board Module Dual H Bridge DC Stepper) wasn't sharing the same ground as the Arduino. You must have everything sharing the same ground!

Here is the finished product, including picture and the code. I probably need to send you all a schematic, I will try to put that together soon. Please note that there is a bug where if you turn off the transmitter, then the car will start turning and moving forward because the receiver interprets the signal as all maximum values. Also when commanding the car there is a split second delay, as I'm only checking for a new command update every 70 ms. This all being said, it should be enough info to get you started. I hope this helps some of you get started with this fun world of building mechatronics! Please feel free to ask me questions.

I appreciate all you help, especially for Robin2's inputs with getting me started using the nRF24L01+ transceiver.

RC_car_TX_first.ino (1.16 KB)

RC_car_RX_first.ino (2.96 KB)

Thanks for the update.

...R

I'm attaching a wiring diagram that should really help build this car, especially for those beginners out there who are unfamiliar with what is available.

rc_car_instructions.pdf (946 KB)