Thursday, April 21, 2011

Interfacing a motor

We cannot interface a DC motor directly with our micro-controller board as we will end up blowing up our board due to the back emf generated by the motor. As for robotics hobbyists, generally two types of DC motors are available in the market, a 12v or a 6v DC motor. Therefore driving a 6/12v device from a 5v micro-controller will lead to driving of a large amount of extra current from the device leading to burning up of its circuitry.In order to prevent the board from blowing up, we normally use an H-bridge to drive and control a motor from the micro-controller board. H-bridges use the direction of flow of current to drive and control a DC motor, as is shown in the figure below.But H-bridges suffer from the problem of complexity of the circuit.


Hence, in order to address this issue, L293D- a dual h-bridge motor driver IC was introduced. With one such IC, we can interface 2 DC motors which can be controlled in both clockwise and anticlockwise direction. Datasheet can be found here.
Just follow the schematic and the truth table shown below to interface a motor with L293D and you will be good to go.

Tuesday, April 12, 2011

A small tip for troubleshooting with sensors

One of the best way to detect the malfunctioning of sensors is to test them with Oscilloscope . Many times sensors don't gives desired output when interfaced with micro-controller. The use of oscilloscope gives you the correct voltage response against time. This will help you to select scaling factor of Voltage to make it work for 0-5V (required for most of micro-controller). In addition to this the frequency response of voltage will enable you to select best sampling rate for your ADC.

Friday, April 8, 2011

Resources for embedded hardware

This blog compiles all the sources (online as well as actual shops in Delhi) from where we procured our components:
  • Rhydolabz - http://www.rhydolabz.com/
    • Stuff Procured:
    1. 5 Amp Current Sensor - http://www.rhydolabz.com/index.php?main_page=product_info&products_id=506: Works nicely, sensitivity becomes a problem for measuring low current values
    2. RF (433 MHz) Transmitter
  • Lajpat Rai Market Shop Number 415 (Contact Person - Mr. Dhariwal, 9313544213)
    • Stuff Procured:
    1. 555 Timer Chip - Cost - Rs 30: Works nicely; Tried a version with 3.3V as well as 5V and was able to integrate both of them in my circuitry easily.