Showing posts with label IR Sensor. Show all posts
Showing posts with label IR Sensor. Show all posts

Thursday, October 20, 2016

Basic Arduino Autonomous Sumo Robot Tutorial



Basic Low Cost (<RM300) Arduino Autonomous Sumo Robot

This autonomous is suitable for standard autonomous sumo robot competition which use black color game field with white color boundary.

Components Required:
1. Arduino (UNO / Nano) x 1, Don't use Arduino Leonardo
2. Ultrasonic Sensor x 2
3. Line Following Sensor x 2
4. Motor x 2
5. Motor Driver x 1
6. Battery x 1
7. Jumper Wire (Female to Male) x 1
8. AWG 16 Wire (Red & Black) x 1m each
9. Dean Connector x 1
Total component cost: RM 279.10

Extra Component:
1. Charger x 1

Arduino Library Required:
1. New Ping Library (library for ultrasonic)

Wiring:
1. Solder dean connector to AWG 16 red & black wire (20cm)
2. Solder wire (red & black) to both motor.

Arduino Pin #
Connect to
VIN
BATTERY POSITIVE (+)
5V
5V / VCC from sensor
GND
BATTERY NEGATIVE (-), 
GND from sensor
A2
Left Ultrasonic (TRIG)
A3
Left Ultrasonic (ECHO)
A4
Left IR SENSOR (Yellow)
A5
Right IR SENSOR (Yellow)
2
Right Ultrasonic (TRIG)
3
Right Ultrasonic (ECHO)
5
MOTOR DRIVER (IN1)
6
MOTOR DRIVER (IN2)
9
MOTOR DRIVER (IN3)
10
MOTOR DRIVER (IN4)


Motor Driver Pin
Connect to
12V
BATTERY POSITIVE (+)
GND
BATTERY NEGATIVE (-)
OUT1
Left Motor (any side)
OUT2
Left Motor (another side)
OUT3
Right Motor (any side)
OUT4
Right Motor (another side)


IR Sensor Pin
Connect to
RED WIRE
5V from Arduino
GREEN WIRE
GND from Arduino / battery
YELLOW WIRE
A4 & A5 from Arduino



Programming:
Troubleshooting:
1. Check IR sensor for color detection. black (LED off) & white (LED on) by changing the sensitivity using potentiometer from IR sensor.
2. If ultrasonic cannot detect object, then increase the value of "MAX_DISTANCE" from Arduino line 3 & 4.
3. If motor run different direction, exchange connection from IN1 & IN2 (IN3 & IN4) jumper cable pin.

Note:
1. Don't overuse your LiPo battery until less than 11.1V.

National Level Competition:
1. myMaker Robotics Challenge organized by Malaysia Robotics Engineering Association
2. ASUMO  organized by Mr. Fauzi
3. Penang International Science Fair organized by Penang Science Cluster

International Level Competition:
1. Singapore Robotics Games

If you have any question regarding this tutorial, please let me know by WhatsApp (012-9050357) or E-mail to admin@roboteducation.com.my
Arduino Arduino UNO R3 Asumo Auto Sumo Autonomous Sumo IR Sensor Singapore Robotics Games SRG Ultrasonic Range Finder

Tuesday, July 26, 2016

Arduino PowerPoint Pointer

The last time that I had to do an PowerPoint presentation it was very frustrating to be all the time with my mouse in my hand, it was not simple design for this function.

With a new presentation coming up titled "Introduction to Arduino," I thought, what best way to show some of the capabilities of the Arduino board then to build a quick power point presenter tool with it.

The first idea that pops has, "Why not use the TV Remote?" Design to be hold in a more ergonomic position that the mouse (for this case).




Step 1: What You Need?

1 x IR Sensor ( Infrared Receiver VS1838B use in this project.)
1 x TV Remote
1 x Micro USB Cable 

Don't have components? Don't worry. Just click the component's name. 

Step 2: Build Your Circuit.

The connection diagram is very easy, simple connect the GND from the sensor to Arduino GND pin, 5V from the sensor to the 5V pin in the Arduino and the Data pin from the sensor to Digital Pin 2 of the Arduino.


Step 3: Upload The Code.

The code part is divided in two steps. In the fist one, you will need to read the keys that you want to use from your TV Remote. It this you will be able to decode the IR signal send out from the remote.

The second part, we will use the information from step one, and assign the keys to there new functions as PowerPointer pointers.

Start by downloading the IR remote Arduino Library and install it in the correct folder. You can downloaded from there.

Do not forget to follow installation procedure recommend in the github page.

For step one, upload the Code 1 to your Arduino. Open a Serial Monitor window, if everything is ok, you should start to different numbers every time you press on key in the TV remote.


Serial Monitor Output

Store the numbers corresponding to the keys that you want to use. In my case, I used the central foreword and backward key in my TV remote.

Replace my numbers in the "If" structures in the Code 2 and upload.




If you are using the Arduino Leonardo, after the upload, every time that you press the selected TV remote keys, they will act as the foreword and backward arrows from your keyboard.

I used the arrow keys for pushing the slides forward and backward.

Step 4: Test Your Pointer

On PowerPoint


Now open your presentation and if you are in "Slide Mode", the slides will change back and foreword every time that you press previous selected keys from your TV remote.

Other Arduino board


If you are using other Arduino boards, I think that is also possible to build this project however some changes need to be done.

The big difference is that the Atmega8U2 or equivalent chip, responsible for the communication between the ATmega328 and the computer, needs to be flashed. I did not had the need to do this, because with the Arduino Leonardo, Zero and DUE appear as native keyboard or mouses when defined and connected to your computer.

Thanks for reading.




Arduino Leonardo easy IR Sensor PowerPoint Pointer project VS1838B

 

  • Copyright © Arduino Tutorial ™ is a registered trademark.
    Designed by Templateism. Hosted on Blogger Templates.