Index

37 Sensors Overview

Sensor.Engine MICRO

  1. Sensor.Engine MICRO Features
  2. Pinout and Pin use
  3. BASIC Overview
  4. SEM Library functions

37+ Sensors

  1. Analog Hall-effect
  2. Analog Joystick
  3. Analog Temperature
  4. Ball Switch
  5. Bi-color LED
  6. Button
  7. Character LCD
  8. Flame
  9. Hall-effect Switch
  10. HMI Display
  11. Humidity and Temperature
  12. IR Receiver
  13. IR Transmitter
  14. Keypad
  15. LASER
  16. Light Cup
  17. Liquid
  18. Mercury Switch
  19. Microphone
  20. Multicolor Flashing LED
  21. Obstacle Avoidance
  22. Photo Interruptor
  23. Photoresistor
  24. Piezo Driver or Annunciator
  25. Pulse
  26. Reed Switch
  27. Relays and Drivers
  28. RGB LED
  29. Rotary Encoder
  30. Servo
  31. Shock and Impulse
  32. Speaker
  33. Temperature 18B20
  34. Temperature Threshold
  35. Touch Sensor
  36. Tracking
  37. Ultrasonic Distance

USBmicro U4xx

  1. U401
  2. U421
  3. U451

CircuitGizmos

Projects

  1. Controlling MedeaWiz Sprite

U421 USB Interface



The U421 is a USB solution that is pre-built, pre-programmed, and pre-tested and will get you interfacing your PC (Win⁄Linux) or Mac (OSX) to various devices in very little time! There is no USB device assembly, no driver development, and no firmware to write. In many cases, the U421 can be plugged into an experimenter’s breadboard and circuit interfacing can begin immediately. Demo software applications can be used “right out of the box”.

images\9-1.png
Image: U421 top view.


Features of the U421 USB Interface:

• USB Interface to PC
• Uses HID Drivers Inherent in OS
• Sixteen I⁄O Lines
• SPI Master and Slave Communication
• LCD Interface Commands
• Stepper motor control
• 1-Wire Communication Interface
• Flexible Pin Use
• Free Compiled Sample Applications
• Visual Basic, C, Delphi Example Code Available
• Fully Assembled and Tested
• Great Replacement for Parallel Port Interfacing
• PC’s USB Power Brought to Device
• Easy to Use with Solderless Breadboards
• USB Cable Provided


Overview of the U421 USB Interface

The U421 provides a simple digital i⁄o interface for the PC (Win⁄Linux) or Mac (OSX). Sixteen i⁄o lines from the microcontroller are provided. Commands can be sent to the U421 that change the i⁄o lines from input to output. I⁄o lines can be individually selected as inputs or outputs. The U421 supports commands to read the ports, and if the ports are set to output, to write to the ports.

The U421 is an interface to SPI (Serial Peripheral Interface) devices. SPI is a local synchronous serial bus that uses a clock line, two data lines, and a device select line for communication between a serial device and a host microcontroller. The firmware on the U421 provides generic access for reading and writing SPI devices. The SPI clock rate can be adjusted to 62.5 kHz, 500 kHz, 1 MHz, or 2 MHz. Because additional pins are available as generic i⁄o, the U421 can use these lines as slave select lines and address multiple SPI devices.

The SPI subsystem of the U421 can be used as a master to communicate with SPI devices such as EEPROMS and A⁄D converters. The U421 can also be used as a SPI slave to a microcontroller that uses the U421 as a gateway to the PC (Win⁄Linux) or Mac (OSX). A PIC, for example, can act as a SPI master to communicate data with the U421, which can then transfer the data to a PC (Win⁄Linux) or Mac (OSX) application. Most microcontrollers can communicate via SPI with software-driven routines, many have internal SPI hardware. SPI hardware is present on microcontrollers from little 8-bit devices, like the PIC, to 32-bit microcontrollers like the 680×0-based devices.

The U421 is a convenient way to interface a standard Hitachi-type of intelligent LCD controller to USB. The commands that support communication to the LCD module are the “standard” LCD commands. Standard commands include writing characters to the display and controlling the display.

The U421 is an assembled and tested circuit card that is 1.5 inches (38.1mm) long and 0.75 inches (19.1mm) wide. The U421 is a printed circuit board in a 24-pin “DIP-like” format.

The U421 interfaces to the PC (Win⁄Linux) or Mac (OSX) via the USB port. An application on the PC (Win⁄Linux) or Mac (OSX) controls the U421. The U421 does not use any custom drivers, just the drivers that are a part of the operating system. Custom software can be developed to use the U421, or the applications that have been created as examples here can also be used.


Uses for the U421 USB Interface

With the U421 you can utilize the USB port on your computer to interface with various electronic devices, such as lights, LCD displays, SPI analog and memory devices, switches, relays, tethered robots, model railroad control, and many custom circuits.


U421 Specifications



Board Size: 1.5 inches (38.1mm) long and 0.75 inches (19.1mm) wide.

Board Type: 24-pin PCB in a “DIP-like” format, rows spaced .6″ (15.2mm) apart.

Computer Interface: USB

USB Cable Length: 36 inches (914 mm).

USB Connection type: Removable cable.

USB Power Type: Bus powered, uses the 5V provided by the USB interface.

Specified USB allowed current draw: 100mA standard, total.

Bandwidth: 800 bytes per second as a HID device.

USB Bus Speed: 1.5Mbits⁄s. (Low speed)

USB Driver: HID, part of the operating system.

Device Interface: 16 CMOS lines, selectable as inputs⁄outputs.


USB Cable Pin#, Color, Function Chart

Pin NumberWire ColorFunction
1RedVusb
2WhiteD-
3GreenD+
4BlackGround⁄Shield



PC USB Port (Female ‘A’)

images\9-2.png


Board Layout:

images\9-3.png



U421 PCB Pin Out



“DIP-like” Connector:

Pin NumberU421 Signal
1PA.0 – Port A bit 0 (stepper motor control)
2PA.1 – Port A bit 1 (stepper motor control)
3PA.2 – Port A bit 2 (stepper motor control) (2-wire clock)
4PA.3 – Port A bit 3 (stepper motor control) (2 wire data)
5PB.0 – Port B bit 0
6PB.2 – Port B bit 2
7PB.4 – Port B bit 4
8PB.6 – Port B bit 6
9Ground
10No Connect
11No Connect
12Do not use
13No Connect
14+5V (USB)
15USB D- (already connected to the USB cable)
16USB D+ (already connected to the USB cable)
17PB.7 – Port B bit 7
18PB.5 – Port B bit 5
19PB.3 – Port B bit 3
20PB.1 – Port B bit 1
21PA.7 – Port A bit 7 (or SPI SCK) (stepper motor control)
22PA.6 – Port A bit 6 (or SPI MISO) (stepper motor control)
23PA.5 – Port A bit 5 (or SPI MOSI) (stepper motor control)
24PA.4 – Port A bit 4 (or SPI SS [when in slave mode]) (stepper motor control)



Power Connection:

The +5V available on pin 14 is the power from the computer’s USB port. Up to 100mA can be drawn from this supply to power devices attached to the U421. If more power is needed, an external supply should be used to power additional circuits. Do not attach the +5V from an external supply to this pin. The ground connection should be common to any external power supply ground as well as any target circuits.


Board Layout:
images\9-4.png
Image: (U421-SC3 screw terminal version of the U421 no longer available)
A standard U421 does not have the screw terminal.



images\9-5.png
Image: Pin 1 on the U421 is located on the lower left, as you look at the board in the orientation above. Pin 24 is the pin on the upper left. The lower row, therefore, is 1-12, the upper row is 24-13.