April 11, 2006

QT301 Capacitance to Analog Converter 04.11.06

QT113 Datasheet Study

Touch lighting up the QT113.

IMG_2743.JPG

IMG_2738.JPG
IMG_2739.JPG

Toggle mode
IMG_2730.JPG

QT301

qt301.jpg

Unlike the QT113, the one-channel, touch sensor, the QT301 works off of the capacitance and outputs an analog signal. It has a PWM pin as oppsed to a digital OUT pin on the sensor.

Quantum Research's QT300 family QProx programmable capacitive ICs are suitable for touch, proximity, fluid, and material sensing.

What is it?

- The QT301 QProx™ programmable capacitive IC is suitable for fluid, and material sensing. It can project sense fields through up to 100mm (4”) of insulation or air. It is an 8-pin device available in SOIC or DIP.
- Its only output is raw, unprocessed data in filterable PWM form that can be translated into an analog voltage.
- PWM signal is a eight bits in resolution.

How is it different from other Touch Qprox sensors?
- Rescaleable PWM: PWM is set by two inputs that control the starting and the end point of the range. (Calibration pins) The PWM range can be optimized for the zone of interest for the user.
- Sync input is present to avoid external noise sources.
- Sensor's Internal Operation : QT301 has an EEPROM to store the two calibration points.

Basic Operations

basic circuit.jpg
Pins.jpg

- In the circuit above, R1, R2, R3 are all 10K resistors and the C1 is 100nF.
- power-up delay of 300ms.

Cs/Cx Dependency
- The signal value depends directly on the Cs and Cx, where the Cs is the fixed capacitor, Cx is the unknown.
- The two values influence the sensitivity, resolution and response time of the electrode.
- Sensitivity and resolution are also a function of the size, shape and composition of the electrode.

PWM Output
- output is 100KHZ +- 7% square wave
- may not be 100% linear with changes in Cx
- during CAL, PWM output value is locked with the value just before the CAL process

Calibration
- CAL PINs are inputs used to trigger CAL process on the upper and lower Cx
- pins go through a pull down resistor to prevent damage (Note: NEVER BE driven low. will short circuit the chip)
- calibrated to have an effective properly scaled PWM output
- CAL_DN should be used to calibrate when the signal of the electrode is at its lowest
- CAL_UP should be used to calibrate when the signal of the electrode is at its max
- does not matter whether CAL_DN or CAL_UP are applied first
- after calibration, i can be calibrated again for adjustment

IMG_2749.JPG

Like in the QT113, I found out that shielding the electrode with a ground around it gave it more focus for the part that was sensing.

IMG_2726.JPG
IMG_2753.JPG
IMG_2755.JPG

For my Living Art Project, I am using about 80 LEDs per candy jar to add movement and light to the LEDs. Hence, I attempted at trying to get as many LEDs to work off the PWM QT301 PIN. I had to go through a TIP120 transistor to be able to power all the 54 LEDs all at once to PWM according to the electrode off of the QT301.

IMG_2751.JPG
IMG_2750.JPG

Posted by min at 02:23 AM | Comments (0)

March 26, 2006

Building Your Own Circuit Boards, PCBs Continued 03.21.06

3 parts to designing a board

package: the physical dimensions of the parts, have to look up the details and dimensions on the datasheets

symbol: for the schematic, pins layed out correctly

device menu
: both together

different types of pins on the schematic

PWR/0: power ground pins
I/0: pins
pin #1 is always given a square pad-like shape on the pcb
surface mount pads (red blocks)

connectors: power connectros, dc socket
rcl: resistors, capacitors (pol), inductors

Posted by min at 04:51 PM | Comments (0)

Sensor Reports 001 03. 21.06

Rebecca Bray - Flex Sensors

Inside the sensor itself : carbon material with a flexible plastic as a covering. depending on the bend, the resistance will change.

  • 10-45 degree bends work the best
  • used in glove applications
  • fitness equipment
  • 30-40K ohms

    circuits

  • basic, use op amp
  • use with a pot to get varying sensitivities
  • can only bend one way, the printed part to get values
  • companies provide custom printed ink for application onto fabrics etc
  • can ask for samples and pricing

    Doria Fan - RFIDs

    Discrete tags assigned to readers as opposed to bar code system
    small radio tower + tags

  • active: cargo, railway, not really used for commercial reasons, powered, ultrasonic radio waves
  • low (radio waves), high ultra high (light waves) frequencies
  • RFID Tags can penetrate different materials. even water. will interupt with metalic materials only
  • tags also need to know to receive the data

    passive : antenna + circuit (caps charges and discharges electric charges) gets charged as signal is sent to it, based on this, it gets a different radio ID

    HF: can read multiple tags and info
    LF: gain chip

    serial communication/ interface: once up and running, this is all code level not electronical anymore

    Theresa - Presence, distance sensor

  • detects person/ animals, not objects
  • 2 internal sensors that reads
  • comes with a built in op amp
  • change of infrared energy : compares and then maps


    Posted by min at 03:18 PM | Comments (0)

    March 08, 2006

    Building Your Own Circuit Boards, PCBs 03.07.06

    Build your own Printed Circuit Boards
    - perf boards
    - wire wrap : to create connections but pins have to be longe
    - battery: mAmps / hour

    Printed Circuited Boards
    - express PCB: 2-3 days
    - soldering padding on holes, so do not have to apply extra solder
    - thicker line on a pcb = more current
    - can drill extra holes to give yourself more options

    Eagle software
    - gerber file, simply a bitmap form to print pcbs
    - voltage, ground (supply)
    - pin head libraries for headers, jumpers etc
    - netline to make real connections
    - use "eye" tool to check if right connections are made
    - name the nets- double click to end net
    - wire: only in drawing, not a real connection between components
    - route tool: to make connections, links and angles onto each component
    -
    Manufacturers
    4pcb : student pricing
    gold phoenix pcb, china : cheapest but don't look through, quite slow
    batch pcb: average pricing, late

    - put SMD baords into toaster oven to allow solder to sink into place

    Posted by min at 02:39 AM | Comments (0)

    Op Amp 02.28.06

    IMG_2328.JPG
    IMG_2329.JPG

    Dual Supply OpAmp: positive and negative voltages

    IMG_2330.JPG

    7905= negative voltage regulator

    - usually deal with single supply op amps, rail to rail

    - opamp in piezos : small voltage change, very fast
    IMG_2331.JPG
    - output: inverts signal and amplifies
    - depending on the resistor, changes the amplification
    - sensor sensitivity with time
    - in opamps, time becomes the issue- will take time from output pin to go into the input pin
    - may cancel out some readings

    IMG_2332.JPG
    voltage out is 10 times the input


    Wheatstone bridge : converts AC to DC
    - a set of 2 voltage dividers so you can read both positive and negative voltage
    - amplify signals as well as noise


    Capacitors: slew rate changes and amplification rate changes (we can't use this for sensors)

    - 0-3 Vs for OpAmps
    - even when piezso when hit very hard, can produce upto 100Vs
    - N4001 diodes : good for power circuits

    Posted by min at 01:36 AM | Comments (0)

    Datalogging Presentation 02.28.06

    Zach
    - high #s in reading maybe highByte and lowBytes were reversed

    Therese
    - getting Q3 value
    2 bytes
    IMG_2326.JPG
    getting the first half and not getting the latter values at all

    - Z term only reads as ascii
    - in ADCON1, 2 bytes
    IMG_2327.JPG
    ADCON1=%10000010, right justify
    ADCON1.7=1 (right justify)
    ADCON1.7=0 (left justify)

    - look at the processing code
    - faster communicatino of 256 data / second for brain wave EEG sensors UDP instead?
    - not http: can not do fast refresh

    Doria
    - processing - PIC : call and response process
    ideal sequence of communication
    - optimal timing to get both things to turn on at the same time, clear communication

    Posted by min at 01:30 AM | Comments (0)

    Datalogging 02.25.06

    Datalogging
    Data archiving, storing

    Codes
    PIC
    Processing
    Server side

    - when reading multiple values, use a "marker" to make sure that all data came in and in the correct order
    - in the processing part, (serialCount>4) for 5 different values, 2 pairs of bytes + marker (255), unique byte

    Server end, debugging
    - on server, we can do a check with tail
    ] tail -10/var/log/httpd/access_log

    gives last ten lines of file, last ten hits of the server
    grep (searching for something on the server)
    ] tail -1000/ var/ log | grep datalog.txt

    - tells us when the hit came etc
    - access log to see what hits they were

    OR

    - create our own log. create an error log separately. errorlog, delete once in a while so that the server does not crash
    - listen more (look into more of data received)
    - time request should be appropriate to get proper data (human time)
    ] $rm datalog.txt (to remove the log file to clear up space on server)
    - server based back and forth
    - ascii encoded: if not numeric, will try to interpret them as control keys instead (ex, next line, tab etc)
    - even from the PIC side, use ascii if necessary
    - multiple data sending, in processing, "&" to get 2 different values
    - in php, "t" for tab

    Xport serial pass through directly by ethernet
    - PIC has to format "GET string"
    - serial (baud rate, stop bit) to ethernet convertor
    (Ethernet : IP address gateway, what port, netmask: which part of address should be paid attention to, 0= important address, 255=unimportant)
    - http request to itp server
    - telnet itp.nyu.edu 80
    - ping to see if there are any connections for the server
    $ ping.itp.nyu.edu, cntrl C to stop
    - Xport: true serial therefore, true 9600. uninverted

    SQL server database : structured query language
    itp.nyu.edu/phpMyAdmin
    create tables and fields

    DEC= ascii fomatted decimal

    Posted by min at 01:16 AM | Comments (0)

    DataSheet Reports 2 02.21.06

    Pinky - Tilt Sensor, GP1S036HEZ

    - 5 pins
    - interrupts. transmittor, photo emittor type
    - emittor goes to PIC - output
    - collector works with 5V
    - testing sensors: do it in the appropriate environment with using multimeter readings
    - when the sensor schematic does not show microcontrol- like part, this is more of a digital sensor, switch
    - with light, detects then stops (the interrupts)
    - binary
    - not digital : no analog logic chip
    - 2 bit sensor : readings based on the 2 pins
    - triggered by light energy

    IMG_2323.JPG
    IMG_2324.JPG

    - pull downs so that we can get better readings. otherwise, the pin may be floating
    - switches also use a pull down resistor: 10k pull down resistor may be necessary in most cases
    - physically, there is a small ball inside that detects the tilt: blocking / interrupting the light
    - physical location, setting of the sensor may be required to get a better resolution
    - to prevent back voltage, use a diode

    Kate: BodyHeat IR sensor
    - power, ground, out, reference voltage
    - analog sensor
    - detects motion of heat?
    - senses pressure and distance
    - works better in the dark, does not require a light beam
    - passive IR sensor
    - beam is quite circular

    DL coupling: tying things together
    ADD: input voltage from 0-5V. when are we getting this? VREF + and VREF -

    - high impedance : less charge in frequency
    - in parallel connection, ccurrent gets divided: the one with the lower impedance gets the higher current
    - PICs: high impedance, therefore consumes low current
    - when there is a voltage change = valid signal information
    - to get faster readings, we need a lower impedance, max out the sampling rate on the chip
    - person would reflect IR, blocking and interrupting the signal
    - change in temp and sound waves
    - reads only reflected light
    - reads whether something has entered a field of sensitivity
    - soft/ hard object detector
    - ultra sonice detector
    - one complex sensor may involve more than one sensor inside the component. a secondary sensor


    Posted by min at 12:10 AM | Comments (0)

    February 28, 2006

    Datalogging With Database Assignment

    Datalogging

    - storing data into a PIC
    - how much memory is needed?
    - ascii, 8 bits
    - http takes in ascii

    IMG_2325.JPG

    - we need both the lowByte and highByte to get a full resolution of the sensor
    - server can read once a second
    - terminal : putty on PC
    - telnet: itp.nyu.edu, port 80
    - in putty, GET /~xxxxxx/index.shtml (whatever file I want to get)

    PHP (hypertext preprocessor)
    - send out to browser "echo"
    $ variables
    PIC - processing - net
    data using http

    application: to represent sensor readings, how it can be used

    Assignment
    I had just completed a project with Gilad and Tikva in Networked Objects, datalogging pot values on a server to make our very first server-based game, "CatchMeGame." Very slow, since we were constantly reading the sensor values off of the server, but it worked. We used Python as our programming language and used 2 Xports to play our game.

    This weekend, Joo Youn and I attemtped at datalogging a simple pot reading onto the server, using Tom's php script , an empty datalog.txt file
    and processing with the PIC code.
    See here for Network Data Logging Suite.

    Breadboard set up to read a simple pot value on ADCIN 0
    IMG_2041.JPG
    php_datalog.jpg

    We uploaded our datalog.txt file and logger.php file up on our itp servers. The sensor values are read, into processing, into php to be written on the server to be stored in the datalog.txt file.

    2006-02-26 05:02:53 31680
    2006-02-26 05:02:57 53184
    2006-02-26 05:02:01 53184
    2006-02-26 05:02:05 35712
    2006-02-26 05:02:09 24128
    2006-02-26 05:02:13 24128
    2006-02-26 05:02:17 24128
    2006-02-26 05:02:21 24128
    2006-02-26 05:02:25 24128
    2006-02-26 05:02:29 24128
    2006-02-26 05:02:33 24128
    2006-02-26 05:02:37 24128
    2006-02-26 05:02:41 24128
    2006-02-26 05:02:45 24064
    2006-02-26 05:02:49 24000
    2006-02-26 05:02:53 24000
    2006-02-26 05:02:57 24064
    2006-02-26 05:02:01 24128

    The times seem erratic, which some others had the same result in. I'm thinking that this is a problem on the ITP server end. We have a workshop with Nancy Lewis this Friday regarding the ITP server and I will bring this matter up.

    Posted by min at 06:13 AM | Comments (0)

    February 20, 2006

    DataSheet Reports and Sensor Interfaces 02.14.06

    - iris scans at the Heathrow Airport, London

    Zach E, D1631, Digital Thermostat, the datasheet
    His blog

    - Dallas Semiconductors, different to most temp sensors because the output is given as a digital value
    - serial communication is doable.
    - keeps the data stored and can be used to get data out and determine if it fits a certain range
    - IIC : inter integrated circuit
    - pin, SCL : clockline, everytime the clock line pulses, data is sent. (send pulse on line one line and have many chips reading it)
    - 0.5 degree celcius resolution
    - application : depending on response time, resolution

    Jungah, Temperature Sensor, LM35 Datasheet

    - environmental conditions are key for these sensors, the physical positioning of the sensors
    - ADC converting sensors can spit out data in bits
    - many temperature sensors are contact based
    - for samples on hard to get sensors, contact the distributors

    Amit P, Maxim Trimmer pot, DS1804 : to calculate any analog sensor

    - 3 leads and treat them like a normal pot
    - provides pulses to increment to change the wiper part
    - analog switch based and can work. there is no need for a separate software
    - simple functions and come in 10K, 50K and 100K

    when needing -5V up to +5V
    IMG_1675.JPG
    for higher readings, continuous current

    Sensor Interfaces
    - sending analog voltages, synchronis
    - serial communication between PC and PIC
    - pulsewidth interface
    - SSI : synchronous serial interface : one clock between 2

    - I2C : 2 line data transfer: wiring has to be correctly done
    IMG_2318.JPG

    - every high pulse of clock, send data out (the data is valid here)
    IMG_2319.JPG


    - single data line : but 2 data received possibly
    - single data clock line
    - single ground


    - we can daisy chain these
    IMG_1676.JPG

    CS with bar on top : chip select, active low
    - to make it active, send a 0 from the PIC
    - to make low, send a 1 from PIC

    SPI
    IMG_1677.JPG

    PIC side :
    SHIFTIN : data in
    SHIFT OUT : data out

    both of these read the data

    SHIFTOUT portb.0, portb.1, LSBPRE (least significant bit mode, rising edge of the clock), [myVar\8]

    SHIFTIN portb.0, portb.1, MSBPOST (most sig bit mode, falling edge), [myVar...]


    - asynchronous : different clocks
    - serial communication
    - we have to consider how the data is received, the order of bits
    - the speed and (inverted or true data? the electrical logic)

    Pulsewidth (wave length) Output
    - light to frequency convertor (the speed, cycles between 2 states in a set of time)
    IMG_2320.JPG

    duty cycle: how long its on for one cycle.

    cycle=1/f

    - 0.0001 pulsewidth, communicating 10000 bits per second
    - varying the pulsewidth


    Summary of different types of sensors
    - analog voltage
    - async serial : PIC to PC
    - sync serial : I2C, SPI
    - pulsewidth : servomotors
    - parallel ports : BCD (binary code decimal), reading all at once together, ex) DAC chip. Tom
    site's stepper motor lab

    IMG_2321.JPG
    IMG_2322.JPG

    PIC side
    TrisB=%00000000
    PORTB = 127 (this will be converted to binary and sent to all 8 diff pins)

    Posted by min at 12:43 PM | Comments (0)

    February 15, 2006

    Make: Tom Igoe's SensorInterfaces

    From Make: magazine, Vol.05, O'reilly

    Untitled-1.gif
    Untitled-2.gif
    Untitled-3.gif
    Untitled-4.gif
    Untitled-5.gif
    Untitled-6.gif
    Untitled-7.gif
    Untitled-8.gif

    Posted by min at 11:17 PM | Comments (0)

    February 14, 2006

    QT113 Datasheet Study

    I decided to look into QPROX for the QT touch sensors as my datasheet study assignment.

    QT113, one channel datasheet

    Qprox touch sensors work off of capacitance.

    Capacitance, in electricity, capability of a body, system, circuit, or device for storing electric charge. Capacitance is expressed as the ratio of stored charge in coulombs to the impressed potential difference in volts. The resulting unit of capacitance is the farad [for Michael Faraday]. In an electric circuit the device designed to store charge is called a capacitor. An ideal capacitor, i.e., one having no resistance or inductance, may be spoken of as a capacitance. When an alternating current flows through a capacitor, the capacitor produces a reactance that resists the current (see impedance). While every element of a circuit has some capacitance, it is a goal of good design to reduce such unwanted or stray capacitance to a minimum.

    Quick list on Qprox uses

    - act as a digital switch
    - sensitivity of them can be adjusted
    - different modes such as toggle, on or off can be adjusted
    - heartbeat function on output

    Application
    - can act be responsive to either touch or proximity
    - self calibrating continuously
    - power consumption of only 600uA
    - requires common capacitors to function

    Overview
    - digital burst mode charge tranfer for touch controls
    - stable sensing

    qt113sum.gif

    OUT: where the output of the touch sensor goes, LEDs, sound, microcontroller to send a high, low...
    OPT1 and OPT2: there are different modes for these for different settings CANNOT be left floating
    Vdd: power
    Vss: ground
    Gain: either to power(high) or ground (low)
    SNS1 and SNS2: where the touch electrode goes. can be a piece of metal, mesh...
    Cs: capacitor before the sensing electrode (usually 10-50nF)
    Cx: load capacitance (10-20pF)

    Basic Operation
    - burst mode dramatically reduces RF emissions and lowers susceptibility to EMI (Electro magnetic interferance) and permits excellent response time
    - ADC inside the IC to optimize the burst length according to the rate of charge buildup on Cs
    - larger value of Cx causes the charge transferred into Cs to rise more quickly, reducing the resolution
    - larger values of Cs reduce the rise of differential voltage across it, increasing resolution
    - IC is dependent on both Cx and Cs and changes on the Cs result in changes in sensor gain

    Electrode Drive
    - the sense electrode can be connected to either SNS1 or SNS2, but best in pin SNS2 for best noise reduction
    - increasing the amounts of Cx destroys the gain, important to limit the amount of stray capacitance on both SNS pins
    - resistors, Rseries should be places inline with the SNS2 pin to the electrode to lower ESD (ElectroStaticCharge) and EMC(ElectroMagneticCompatibility)

    Electrode Design
    - QT113 operates well with long, thin electrodes
    - sensitivity is related to electrode surface area

    kirchlaw.jpg

    Kirchoff's Current Law

    - detects the change in capacitance of the electrode
    - it requires that the signal ground and the target object must be coupled together for a capacitive sensor to operate properly

    Virtual Capacitive Grounds
    - can be created by connecting the QT113's own circuit ground to: nearby piece of metal, floating conductive ground plane, another electronic device

    Field Shaping
    - to stop field spreading, it is necessary to surround the touch electrode on all sides with a ring of metal connected to circuit ground. this will kill field spreading from that point outwards.

    Sensitivity of the Sensor

    - QT has 2 settings for gain options using pin 5
    - sensitivity change is made by altering the internal threshold level required for a detection
    - other things may affect its sensitivity: values of Cs, electrode size, shape and capacitance, thickness of material, ground coupling.
    gain.jpg
    - sensitivity can be increased by using a bigger electrode and reducing panel thickness but increasing the electrode size can have lower returns since high values of Cx will reduce its gain
    - also, metals around the electrode will reduce the field strenght and increase Cx loading
    - to decrease sensitivity, gain can be lowered by decreasing the Cs

    Drifting Compensation Algorithm
    - QT113's drift compensation is "asymmetric." It is faster for decreasing signals than for increasing signals
    - With large value of Cs and small values of Cx, drift compensation will appear to operate more slowly than with the converse

    Forced Sensor Recalibration

    - accomplished only when the device is powered up
    - driving the QT113's Vdd pin directly from a microcontroller port will serve as both power and forced recal

    responsetime.gif

    Response Time
    - dependent on burst length, dependent on Cs and Cx
    - with increasing Cs, response time slow, while increasing levels of Cs reduce response time???????


    QT 113 Modes

    output modes.jpg

    DC Mode Output
    - the output is active low upon detection
    - if time out occurs first, the sensor performs a full recalibartion and the output becomes inactive until the next detection

    Toggle Mode Output
    - sensor as on/ off mode
    - max on-duration in toggle mode is fixed at 10 secs
    - at timeout, the sensor recalibrates but leaves the output toggle state unchanged

    hbpulldownresist.jpg
    microcontroll.jpg

    HeartBeat Output
    - QT113 output has a 'health' indicator: operates by taking 'out' into a 3 state mode
    - this output state can be used to determine that sensor is operating properly
    - sampled by using a pulldown resistor on out
    - because the OUT is normally high, a pulldown resistor will create negative HeartBeat pulses when the sensor is not detecting an object

    Output Drive

    - output is active low
    - when used for proximity mode, the current should be limited to 1mA to prevent gain shifting
    - QT113 derives from its internal references from the power supply, and sensitivity may change when there is a shift in Vdd
    - when using LEDs: the LED should be connected with its cathode(-) to the output and its anode(+) towards Vcc so that its lights when the sensor is active

    Circuit Guidelines

    Capacitors
    - Cs range is from 10nF to 500nF depending on the sensitivity required, larger Cs requires higher stability for reliable sensing

    Option Strapping
    - OPT1 and OPT2 should never be left floating (open)
    - GAIN should be connected to either Vdd or Ground

    Power Supply
    - from 2.5V to 5.0V. 3V is best
    - can be driven from batteries, as the QT113 automatically tracks fluctuations and changes in the battery supply with only minor changes in its sensitivity

    Parts Placement
    - Cs and Rseries resistors should be placed as close to the body of the chip as possible, reducing the antenna- like ability to pick up high frequency signals
    - for best results, board should be made entirely of SMT components
    - keep the SNS2 electrode trace and the electrode itself away from other signal, power and ground traces, SNS trace will cause an increas in Cx load and desensitize the device

    ESD (ElectroStatic Discharge) Sparks, protection
    - can be enhanced by adding series of Rseries (resistors) in line with the electrode of 1K and 50 K Ohms
    - optimal value depends on the amount of load capacitance, Cx
    - high value of Cx means Rseries has to be low
    - Rseries and Cs should both be placed close to the chip

    Posted by min at 12:37 AM | Comments (0)

    January 31, 2006

    Types of Sensors, interfaces 01.31.06

    Review of assignment

  • hystereses: the circuit itself may carry a lot of noise. ex. breadboard. Trying to detect the slope change of the sensors may be more effective. How long is the slope being maintained until the change?
  • Flex Sensors: the base part of the sensor should be stable to get proper readings from the flexing.
    IMG_1465.JPG
  • CAPACITORS
    ex. decoupling capacitors- time delay the passage of electricity. this is the same way we'd protect our computers from a possible sudden, voltage drop. A capacitor before the sensor may smooth out the electrical flow for a better reading.
    IMG_1466.JPG
  • IR sensors from radio shack
    The emitter and the transmitter. In regular transistors (base, collector and the emitter), electrons are sent into the base that fill holes and lets current pass through the collector and the emitter, creating a "gateway"
    IMG_1467.JPG

    The transmitter in the IR acts as a transistor w.o the base. The phototransistors in the IR uses photons, instead of the electrons. Light comes into the IR and charges the sensor.

  • When searching for datatsheets, the manufacture's part number is found on the part itself.
  • Changing the voltage in a circuit depending on the sensor could give us better and wider readings. That same voltage goes into the analog pin of the PIC
  • ADCON 1 register: we can also change the VREF on the PIC
    VDD of the PIC becomes the automatic VREF but we can also reference it separately
  • Photocells: look into the light spectrum sensitivity on the datasheet
  • Use the new processing version to create a separate app to observe sensor datalogging for a longer period
  • TwoByte Sender: sensorVar.highbyte and sensorVar.lowbyte

    Sensor Interfaces

  • physical and the electrical interface

    Flex Sensor

  • graphite structure inside that changes the resistance of it

    Piezo Sensor

  • vibration
  • creates a charge inside- voltage
  • with most piezos we need to use an opamp to get any kind of values
  • limit the range using a zener diode
    this charges up to a certain point and then stops it. ex. in XPORT circuits
    IMG_1468.JPG

    Different types of sensors, true analog sensors

  • change in capacitance
    IMG_1471.JPG
  • change in voltage
    IMG_1470.JPG
  • change in resistance
    IMG_1469.JPG
  • change in frequency: measure the frequency / pulses using the PIC



    RC circuit
    (resistor capacitor circuit)

  • RCTIME command in the PIC to show you when the state of the pin has changed. Initially taking the pin to low then waits until the pin goes high again.

    Ref from MCS
    RCTIME Pin,State,Var

    RCTIME measures the time a Pin stays in a particular State. It is basically half a PULSIN. Pin may be a constant, 0 - 15, or a variable that contains a number 0 - 15 (e.g. B0) or a pin name (e.g. PORTA.0). RCTIME may be used to read a potentiometer (or some other resistive device). Resistance can be measured by discharging and timing the charge (or vice versa) of a capacitor through the resistor (typically 5K to 50K). The resolution of RCTIME is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the time in state is returned in 10us increments. If a 20MHz oscillator is used, the time in state will have a 2us resolution. Defining an OSC value has no effect on RCTIME. The resolution always changes with the actual oscillator speed. If the pin never changes state, 0 is returned.

    Example

    LOW PORTB.3 ' Discharge cap to start
    PAUSE 10 ' Discharge for 10ms
    RCTIME PORTB.3,0,W0 ' Read potentiometer on Pin3

  • use this when there are not enough analog inputs, we can get a wider range than ADCIN
  • can carry more noise
  • detects the change in time for a capacitor to discharge
  • can be slower than the ADCIN but not too significantly
  • can apply with sensors that change in resistance, voltage and capacitance

    Posted by min at 12:55 PM | Comments (0)

    January 30, 2006

    Sensor and Time Assignment

    It was hard to get back into the pcomp mode once again...

    I did the assignment with an FSR (force sensor) and a flex sensor. Initially, I had no problem getting values using the serial communicator. I had placed a pot (variable resistor) so that I could control the resolution of the sensor values.
    IMG_1454.JPG
    IMG_1457.JPG

    PIC code

    However, in Processing Datalogging, I wasn't able to see any change in graphics.
    Processing code by Tom Igoe.
    processing.jpg

    I had fogotten to just do serial out on the [ADCvar] in the pic code. After the error was found, I was able to see some changes in graphics, but not too evident.
    Untitled-2 copy.jpg

    I was able to use 2 different sensors to see the different values being output using serial communication.
    IMG_1459.JPG

    PIC Code.


    Posted by min at 11:49 PM | Comments (0)

    January 28, 2006

    Sensors and Time 01.24.06

    Schematics show how the parts are electrically related.

    Voltage divider
    IMG_1406.JPG

    We can find out how much V is depending on the ratio of the X resistance.
    IMG_1407.JPG

    Raising the voltage in cases of audio.
    IMG_1408.JPG

  • Changing the ratio of the resistance = bigger range of sensor data

  • Measure the resistance needed for sensor by using a pot as the fixed resistor.
    Ex. When tuning of the circuit.

    Taking in and reading 2 relative voltages.
    IMG_1409.JPG

    ADC compare: comparing two different analogs.

    CODE: (ADC ins are 10 bits)

    ADCON1
    Special function registers, preference settings: how fast it samples, how many bits move.

  • VREF + PIN … add the max voltage that can go in here.

  • Sensors that can only read up to 3.3volts

  • Negative numbers from the PIC loops itself back to 255 max and then minuses again.

  • ADCON0 for clock conversion.

  • 18F2525: 13 ADCs

  • “DEC” result in ascii encoded decimals, Raw byte into DEC


    In case of force sensors.
    IMG_1411.JPG

  • Establish a threshold

    Code for keeping track of past and the current

    Beginning

    IF (past <=threshold) and (current> threshold)

    End

    IF (past >=threshold) and (current

    Peak

    IF (current>=peak) then peak= current

    Finding local peaks

    IF (current<=past) and (past>=ancient) then local peak=past

    problems- noise


    Visualization of sensors over time

  • Using “processing” for data visualization

  • Reading in as bytes, hence, the max value is 255

  • When graphing, consider all the parts to translate this data.

  • Visualization: look from the end system, what is it going through? Make sure that the data is exchanged correctly.


    Posted by min at 03:58 PM | Comments (0)

    Basics of Sensors 01.17.06

    What is a sensor?
    Converting one form of energy into another.
    How can we exchange energy forms?

    • RFIDs (Radio Freq Identification) embedded into pets to locate and track them.

    • Inductance: When current is passed through a wire, it generates a magnetic field. Ex. Motors, radios etc

    • Passive RFIDs : Reading the bounced back energy; the difference in signals.

    • RS232 : Serial Protocol

    Class Requirements

    Sensor Report: individual
    • What the sensor does
    • The interface
    • How to use it
    • Schematics and codes

    In-class sensor reports
    Reading and questions of the datasheets


    When looking at different sensors, we look at
    • Its stability
    • What energy it reads
    • States in analog, the sensitivity (threshold) and the range of voltage that we get
    Threshold: The point at which a signal (voltage, current, etc.) is perceived as valid.
    • Dynamic range input and the output range
    • Resolution in different applications, what resolution does our application need?
    • Temporal resolution (the time that affects the sensor), depending on the response time. Ex light switches, when they don’t react in time, we may end up switching it a few times. HMI lights ((Hydrargyrum Medium arc Iodide) A flicker-free light source recommended for digital cameras that require long periods of exposure) take a while to turn on. In this case, the output is taking long.
    • Bandwidth of sensor : how fast it can read.
    • Transfer: how does input become an output? Linear growth. y=mx+b
    Non-linear growth: usually the end points, the data that we can not work with.
    • Hystereses in sensors : contained in one zone that shows a range of possible relationships in the readings. Variability within a range (bouncing on and off)
    • Debouncing in switches: allows the values to settle.
    • Noise: values that you don’t want in the readings. High signal to noise are reliable sensors. Which means that the hardware itself filters out and averages.


    Negative feedback (to the direction going): reverses the data received.
    Positive feedback: amplifies the data received. Ex in EEG system
    When tiny voltages are involved, we amplify the signal to a particular point to get better readings. This may cause the signal to increase faster when it is rising

    Reading sensors
    Digital Oscilloscope: To read sensors over a long period of time. Reading the electrical signal change. One can look at the signals very closely
    Channel 1, VOL TS-DVV to amplify visual and to read finer resolutions.
    SEC/DEV

    Posted by min at 03:37 PM | Comments (0)

    January 24, 2006

    Come by here for more inputs

    soon.

    Posted by min at 12:56 PM | Comments (0)