Category: Robotics

Stepper motors are not like simple DC motors and cannot be driven by providing just DC voltage.Driver circuit & a microcontroller are needed to control the speed & direction of a stepper.

With a stepper motor you can “step” exactly a given angle. Further the stepper motor has the advantage of having a holding torque.Steppers are able hold their position when they are not moving.

Stepper motors are available in two varieties : unipolar or bipolar.

Bipolar motors are the strongest type of stepper motor and usually have four leads. They have two sets of electromagnetic coils internally, and stepping is achieved by changing the direction of current within those coils.

Unipolar motors, identifiable by having 5,6 or even 8 wires, also have two coils, but each one has a center tap. Unipolar motors can step without having to reverse the direction of current in the coils, making the electronics simpler. However, because the center tap is used to energize only half of each coil at a time they typically have less torque than bipolar.

Unipolar motors typically have two coils per phase, one for each direction of magnetic field.

Bipolar motors typically have one coil per phase, and current flows in both directions through this coil. Thus, the bipolar motor will be able to produce twice as much torque, since at any given time, the unipolar motor is only using half of its windings

An instance called “motor” is initiated for the Stepper class, with Steps = 200 (generally step angle of Stepper is 1.8 deg.For a full rotation of 360 deg we need 200 steps 200 x 1.8 = 360).

Pins 10,11 of Arduino assigned to control coil 1 & connected to IN1,IN2 of L298.

Pins 12,13 of Arduino assigned to control coil 2 & connected to IN3,IN4 of L298 board.

Two push switches are used to control the direction of Stepper.One switch is connected to pin 2 (clockwise) & the other one to pin3 (anticlockwise).The connections are made so that when a switch is pressed , a HIGH (5v) is applied to Arduino pins 2 or 3 accordingly.

The speed of Stepper is controlled by a 10k potentiometer which is connected to A0 of Arduino.The analog value of potentiometer is mapped to a value between 0 and 100 & assigned to a variable RPM.

According to the conditions of Switches (clockwise or Anticlockwise) & RPM set by the potentiometer the Stepper will move accordingly.

Important point to take note:

Pin 8 of Arduino is assigned to ENABLE ,which is connected to both EN1,EN2 of L298 board.While starting the loop Enable is made LOW & it’s made HIGH only when a switch is pressed.This ensures that the Stepper is not enabled at idle conditions.If you’re not controlling the ENABLE pin , the L298 IC will heat up even when the Stepper motor is not running.This will damage the L298 IC and the Stepper motor , as well.

Connection Details

L298 BOARD Arduino Board

EN1 & EN2 —–> 8

IN1 —–> 10

IN2 —–> 11

IN3 —–> 12

IN4 —–> 13

M1/M2 — 2 wires of first coil of stepper.

M3/M4 — 2wires of second coil of stepper.

CW switch —–> 2 , one end of switch connected to +5v, other end grounded through 10k .

Speech recognition is commonly used for controlling appliances, toys, tools and computers. It is used in Robotics to control motors according to voice commands.

The heart of the circuit is the HM2007 speech recognition IC. HM2007 is made by HUALON Microelectronics Corporation(Taiwan) .

The IC can recognize 20 words, each word a length of 1.92 seconds.

Speech samples are acquired by a Microphone on board.HM2007 analyzes the analog signal received compares with the data stored in external RAM & finally outputs a corresponding 8 bit Data.This 8 bit data can be directly connected to a port of Microcontroller for further action.

An 8 kB external RAM is needed to store data.As the RAM is volatile , a 3v button battery is used to backup stored data.The 8 bit data is passed through an octal latch IC 74HC573.

To display the command numbers 2 common cathode 7 segment displays are provided.This is driven by a BCD to 7 segment decoder/driver IC CD4511.

The board requires 5v DC supply. A 12v adapter can be used as a power source, as the board has inbuilt 5v regulator with heat sink.

The HM 2007 IC requires initial configuration or training of words, which is performed using a 4 x 3 Matrix Keypad. In the training process user trains the IC by speaking words into the microphone and

assigning a particular value for that word. For example a world “left” can be assigned a value 01.This can then be later connected to a microcontroller for further functions.

Words can be assigned from 01 to 20.

Training Words for Recognition:

Before starting the training process we can erase the previous memory.

Press 99 & then press the CLEAR button.

The display will scroll from 01 to 20 erasing all the memory

To train a word

Press “01” on the keypad.Display will show “01” and the READY LED will turn off.Now press the TRAIN key ( the LED will turn on) & HM2007 goes to training mode, for word one.

Say the target word into the onboard microphone (near LED) clearly. The READY LED should blink momentarily indicating the acceptance of word.

If the LED did not flash, start again by pressing “1” and then “TRAIN” key.

You may continue training new words in the circuit. Press “02” then TRAIN key to train the second word and so on. The circuit will accept and recognize up to 20 words (numbers 01 through 20).

It is not necessary to train all word spaces. If you only require 5 target words that’s all you NEED TO TRAIN.

If the system has to work under noisy environments, background noise may corrupt the original data and leads to malfunctioning.Take care to avoid using this board in Noisy places.

Error codes generally displayed

55 = word too long

66 = word too short

77 = word no match

Let us test the board by connecting to a Motor through a motor driver board L293.This L293 can drive 2 motors at a time.For demo we’re using one part of the IC.

EN1 of L293 should be made HIGH and according to logic levels at IN1 & IN2 the motor will rotate to Right or Left or Stop.

HM2007 Outputs an 8 bit Data buffered by 74HC573 IC & available as two 4 bits.

D0 to D3 represent one digit & the second one by D4 to D7

We shall connect

EN1 of L293 TO D4

IN1 of L293 TO D3

IN2 of L293 TO D0

Provide a separate 12v DC power source to L293 board.Do not forget to make common the GND of L293 BOARD and that of HM2007 board.

Check out the table below to see how to achieve a number for a Word.

Here we’ve assigned decimal 11 for RIGHT , 18 for LEFT & 08 for STOP.

To rotate the motor to RIGHT we assign Decimal value 11 .To rotate LEFT a decimal value of 18 is assigned.

To stop the motor decimal 08 is assigned.The calculation of arriving at these values are shown in table above.

Train the HM2007 board by pressing 11 & then TRAIN key for the word RIGHT.

Then press 18 & TRAIN for the word LEFT.

Finally 08 & TRAIN for the word STOP.

Now speak the word RIGHT to see the motor rotate Rightwards, LEFT to notice the motor rotating leftwards & STOP will apply brake to motor.Corresponding Digit will be displayed on the 7 SEGMENT Displays.

In this post we shall see how to make a Line Follower Robot using the multipurpose iBot designed by Robosapiens .This kit is an excellent design , easy to assemble & learn for beginners in Robotics.

The kit is built on AVR ATMEGA8 development board.As the AVR IC is pre-loaded with Boot Loader there is no need of an external programmer. Hex files can be loaded on to the IC using HIDBOOTFLASH application.

The AVR Board can work on 6V to 15V DC supply. The control circuit is basically L293D based Dual H – Bridge Motor Driver Circuit with Inverting Buffer which is used for the locomotion of the robot. The motor driver circuit used, intakes digital inputs to make motors running.

The kit is provided with two IR based Digital proximity Sensors that is used as a line sensor. The sensor that is being used is highly flexible and versatile. The sensors can be used as an edge sensor , obstacle sensor , color sensor (black / white) , light sensor etc. Sound Sensor can also be interfaced for making Robots like clap to move,clap to stop

Mechanical Assembly Video :

Line Follower Robot–Mechanical Assembly

Now that the mechanical assembly part is over , let us see how to load the hex files on to the AVR IC.