Thursday, January 17, 2013

06 All about Motors/ Interface micro to transistors

 
This is a singing toy "Grandma got run over by a reindeer"
before I remove the fabrics... and hack the toy.
Input transducers are electronic devices that detect changes in the real world and send signals into the process block of the electronic system.
Examples of a digital sensor for the reindeer is the microswitches in its hand


Example of input transducers for the reindeer is the push switches in one hand to detect when the toy is being 'stroked'. The microcontroller uses information from the input transducers to make decisions about how to control the output devices.


06 Driving Motors and Other Output Devices
Standard Interfacing Circuits

MSP430 microcontroller
  • only provides up to 10mA per channel and limited to about 50mA
  • possible light up about 4 to 5 LEDs from the chips
  • over loaded will burn out your microprocessor
In order to provide more current, we can use a transistor switch. The transistor will require very little current to switch a much larger load. The 2N3904 will work for low current devices, it rated to 200mA and has a gain around 25. Therefore in order to drive the transistor, we need to provide a current of 8mA.

       Current = 200 mA/25 gain
                    =  008 mA
Since the  MSP430 microcontroller runs at 3.3V internally, we need to choose a resistor that will provide at least 8mA (.008 A) Since there is a voltage drop of around 0.7V across the transistor, the resistor receives about 2.6V. We then need to choose a resistance less then 325Ω.
      
        Resistance = 2.6V/ 0.008 A = 325Ω
        We picked 330Ω because it is the closest resistance in the kit.

The standard schematic for attaching 2N3904 transistor to
MSP430 microcontroller
To interface a signal lamp the standard transistor interfacing circuit
 
 
The MPSA24 can handle up to 300V at .6 Amps of current.
(3 times as much as the little 2N3904)
With such a large gain, you only need a very small current to create a very large current.Reproduce the original transistor circuit except with the MPSA13 Darlington transistor.
DC Motors

Brushed DC Motors are widely used in applications ranging from toys to push-button adjustable car seats. Brushed DC (BDC) motors are inexpensive, easy to drive, and are readily available in all sizes and shapes.






Brushes and Commutator
BDC motors do not require a controller to switch current in the motor windings. Instead, the commutation of the windings of a BDC motors is done mechanically.

There are a number of ways motors can be interfaced to the microcontroller. Here you need to use the power Darlington transistor:

Use the wires from one of the motors on your Hacked Toy as the motor in this circuit. Turn the motors on an off by replacing the signal light with the motor wires and including a 1N4001

At this point you should now know how to use switches and your LDR (Light Dependent Resistor) as input and control the motors in your toy as output.

Wednesday, January 16, 2013

05 Introduction to Serial Bus/ Microcontrollers

Microcontrollers
Most common microcontrollers we seen are embed in consumer products, they do one task and run one specific program and generally does not changed. It is low power, often small and  inexpensive.
A microcontroller is like a 'computer in a chip' because it contains memory, processing units, and input/output circuitry in a single unit. It comes 'blank' from the shop and then programmed with a specific control program to make the product more intelligent and easier to use.

For this project, obtain the following components:
  • TIMSP430
  • Breadboard
  • Sufficient Wire
  • 4 LEDs and 4 resistors between 200-500 ohms.
    (red red brown is 220Ω and ideal)
You will need to install the Programming Environment for the chip:
http://energia.nu/download/
There are 20 pins on this chip. 16 of these are usable for digital input or output (IO-means channel is either ON or OFF) Digital IO is is much like an electric switch that can be in one or two positions. In the case of this microcontroller, ON corresponds to a +3.3V and OFF corresponds to 0V.






Here is the Blink Codes from Energia website.





  • Connect the breadboard to the LaunchPad
    The GND on the breadboard should be connected to the Pin 20 marked GND.
  • The wire connected to the positiive end of the LED should connect to Pin 6 marked P14.
  • Use a 220Ω resistor to limit current to the LED.

Here is the video showing the results with the programming codes of 1 second delay .

Here is the modified version of the blink codes to make 4 LED flash
with 4 resistors between 20 - 500Ω

 
Demonstrate LDR controlling LEDs
 


Tuesday, January 15, 2013

04 Intro to Transistors

A transistor can switch a flow of electricity, just like a relay. But it's much more sensitive and versatile.

Fingertip Switching

Concept learned from this demonstration:
A transistor amplifies any changes in current
that you apply to its base. 

Your finger is conducting positive voltage to the base of the transistor. Even though your skin has a high resistance and there is only a trickle of voltage reaching the transistor, the transistor still responds. It isn't just switching the LED on and off; it is amplifying the current applied to its base.


If you have dry skin, you might have to lick your fingers before
touching the wires for the LED to light up.


The fingertip switching demo is safe if the electricity passes just through your finger. You won't even feel it because it's 12 volts DC from a power supply of 1 amp or less. But it's not a good idea to put the finger of one hand on one wire, and the finger of your other hand on the other wire.

All about NPN and PNP transistors
A transistor is a semiconductor, it conducts electricity, but not always and its internal resistance varies depending on the power that you apply to its base.