Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

The OSOYOO Magic I/O Shield for Arduino is a powerful board for the beginners. With this Magic board, we can  easily connect various sensors and actuators much easier than before. In addition, this extension board has a build-in motor driver chip which allows us to control movements of two pairs of electric motors.

In last lesson, we introduced how to assemble a simple robot car and make it to do some basic movement.

In this lesson, we will carry an infrared receiving module on the robot car, and we will show how to change the car moving direction and status through infrared remote controller.

Notice:

Not much is needed for this lesson, Make sure you have a good quality syncing cable,do not pick a ‘charge only’ USB cable.

In this lesson, we will add a IR Receiver to the framework built in Lesson 20, if you have already completed installation in Lesson 21, just keep it.

Install the IR receiver module with 2pcs M3 plastic screws and pillars:

Then install the IR receiver module on the chassis with 2pcs M3 nuts, connect the module with OSOYOO Magic I/O Shield for Arduino:

Notice: Shut off your battery or Unplug your power adapter when upload sketch code to Arduino.

Library install

Install IRremote library into IDE (If you have already installed IRremote library, please skip this step)
Download IRremote library from https://downloads.arduino.cc/libraries/github.com/z3t0/IRremote-4.3.1.zip, then import the library into IDE(Open  IDE-> click Sketch->Include Library->Add .Zip Library)

In the pop up window, go to your downloads folder, select the IRremote.zip file you downloaded just now.

After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled PWR) should go on.

Click to download the code

The whole program blocks are as following:

After above operations are completed, do as follows:

  1. Click Save after programming is done.
  2. Select the board type and serial port before uploading. For instause an UNO board, just select Arduino/Genuino Uno: if you use a Mega2560, select Arduino/Genuino Mega or Mega2560.
  3. Select the serial device of the Arduino board from the COM menu. This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.
  4. Next,upload the code. If the uploading fails, check and correct the code according to the prompts.
  5. Finally, the status will change to ‘Upload success!’.

how_to_play.png (1150×56)

Disconnect Arduino from PC, put a 9V battery into battery pox(make sure polar direction is correct, otherwise it can destroy your device and cause fire hazard).

Press the Motor Power switch on the OSOYOO Magic I/O Shield for Arduino, then press IR controller keys to control the car movements:

If the car does not move as per above mentioned result, you should check your wire connection, battery voltage(must over 7.2v).