April 11, 2006
QT301 Capacitance to Analog Converter 04.11.06
Touch lighting up the QT113.
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.
- In the circuit above, R1, R2, R3 are all 10K resistors and the C1 is 100nF.
- power-up delay of 300ms.
- 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.
- 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
- 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
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.
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.
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
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
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.
Doria Fan - RFIDs
Discrete tags assigned to readers as opposed to bar code system
small radio tower + tags
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
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
- 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
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
Op Amp 02.28.06
Dual Supply OpAmp: positive and negative voltages
7905= negative voltage regulator
- usually deal with single supply op amps, rail to rail
- opamp in piezos : small voltage change, very fast
- 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
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
Datalogging Presentation 02.28.06
- high #s in reading maybe highByte and lowBytes were reversed
- getting Q3 value
getting the first half and not getting the latter values at all
- Z term only reads as ascii
- in ADCON1, 2 bytes
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
- 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
Data archiving, storing
- 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
- 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
create tables and fields
DEC= ascii fomatted decimal
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)
- not digital : no analog logic chip
- 2 bit sensor : readings based on the 2 pins
- triggered by light energy
- 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
February 28, 2006
Datalogging With Database Assignment
- storing data into a PIC
- how much memory is needed?
- ascii, 8 bits
- http takes in ascii
- 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"
PIC - processing - net
data using http
application: to represent sensor readings, how it can be used
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
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.
February 20, 2006
DataSheet Reports and Sensor Interfaces 02.14.06
- iris scans at the Heathrow Airport, London
- 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
for higher readings, continuous current
- 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
- every high pulse of clock, send data out (the data is valid here)
- single data line : but 2 data received possibly
- single data clock line
- single ground
- we can daisy chain these
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
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)
duty cycle: how long its on for one cycle.
- 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
PORTB = 127 (this will be converted to binary and sent to all 8 diff pins)
February 15, 2006
Make: Tom Igoe's SensorInterfaces
From Make: magazine, Vol.05, O'reilly
February 14, 2006
QT113 Datasheet Study
I decided to look into QPROX for the QT touch sensors as my datasheet study assignment.
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
- can act be responsive to either touch or proximity
- self calibrating continuously
- power consumption of only 600uA
- requires common capacitors to function
- digital burst mode charge tranfer for touch controls
- stable sensing
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
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)
- 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
- 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)
- QT113 operates well with long, thin electrodes
- sensitivity is related to electrode surface area
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
- 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.
- 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
- 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
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
- 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 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
- Cs range is from 10nF to 500nF depending on the sensitivity required, larger Cs requires higher stability for reliable sensing
- OPT1 and OPT2 should never be left floating (open)
- GAIN should be connected to either Vdd or Ground
- 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
- 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
January 31, 2006
Types of Sensors, interfaces 01.31.06
Review of assignment
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.
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"
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.
VDD of the PIC becomes the automatic VREF but we can also reference it separately
this charges up to a certain point and then stops it. ex. in XPORT circuits
Different types of sensors, true analog sensors
Ref from MCS
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.
LOW PORTB.3 ' Discharge cap to start
PAUSE 10 ' Discharge for 10ms
RCTIME PORTB.3,0,W0 ' Read potentiometer on Pin3
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.
However, in Processing Datalogging, I wasn't able to see any change in graphics.
Processing code by Tom Igoe.
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.
I was able to use 2 different sensors to see the different values being output using serial communication.
January 28, 2006
Sensors and Time 01.24.06
Schematics show how the parts are electrically related.
We can find out how much V is depending on the ratio of the X resistance.
Raising the voltage in cases of audio.
Ex. When tuning of the circuit.
Taking in and reading 2 relative voltages.
ADC compare: comparing two different analogs.
CODE: (ADC ins are 10 bits)
Special function registers, preference settings: how fast it samples, how many bits move.
In case of force sensors.
Code for keeping track of past and the current
IF (past <=threshold) and (current> threshold)
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
IF (current>=peak) then peak= current
Finding local peaks
IF (current<=past) and (past>=ancient) then local peak=past
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
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
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.
January 24, 2006
Come by here for more inputs