1
Topics
This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.
Topics - jbeale
2
General discussion / Personal Seismograph with Raspberry Pi (Kickstarter)
https://www.kickstarter.com/projects/an ... eismograph
3
General discussion / Art of Electronics 3rd Ed. mentions DP !
4
Project logs / Tiltmeter (seismology, etc)
Apparently the most popular sensor for this purpose is an "electrolytic tilt sensor", basically a bubble level with internal electrodes. These are not exactly consumer items. I tried building a simple pendulum tiltmeter using a split-photodiode, Optek OPR2100 (about $10 from Mouser) and LF411 opamp. The pendulum is a 0.064 x 3/4" x 12" strip of brass (K&S Metals #8247). Light from a 3W LED shines through a slit at the bottom of the pendulum into the detector. I have the photodiodes in zero-bias mode, wired anode-to-cathode so in balance, the current from one photodiode circulates through the other photodiode. This way the opamp only sources or sinks current (into the photodiodes, through feedback resistor Rf = 1 Mohm) when there is an imbalance in the photodiode current (= light level). I used a LF411 at +/- 15 V because I had it handy; I guess a more modern design would use a 5V single supply opamp and generate a 2.5V midpoint reference somehow. The pendulum will swing a long time unless damped, so I used a magnet assembly from an old hard disk drive for damping (eddy currents in the brass pendulum provide the force), this worked nicely.
My crude first attempt has a sensitivity of 1V output = 0.052 degrees tilt (3.1 minutes of arc). Calibration was based on Vout after moving the pendulum 1 mm. Walking into the room and sitting down at my desk about 3 feet from the pendulum gives about 0.1 V offset, so apparently that weight shift tilts the (old, wood) house floor by 0.005 degrees (19 arc seconds).

5
General discussion / Kickstarter: small OpenWRT platform for embedded
https://www.kickstarter.com/projects/11 ... s-computer
Also a thread about it here:
http://www.eevblog.com/forum/crowd-fund ... ith-wi-fi/
6
General discussion / 360 P/R optical rotary encoder, pinout
7
General discussion / cheapest wifi device?
I know there are cheaper wifi-USB adaptors, but I'm thinking of something that doesn't have to be connected to a full PC to work- it would need to talk to a low-powered microcontroller. I have used the Roving Networks / Microchip "WiFly" module which works OK, but those are around $30 each from Digikey.
On the other hand, I wonder if it would be possible to use one of the new ARM devices with a USB 2 port, eg. Freescale Kinetis KL2 to talk to a wifi-USB device. But the magnitude of the software driver stack needed might be prohibitive.
8
General discussion / new GPS GNSS Receiver for $17 - NavSpark
EDIT: Update- now I do have some connection in that I put down some money as a supporter, in hopes they will make this product. Also, there are several versions; one provides GPS + GLONASS, another GPS + Beidou. The raw-output version is so far only GPS though. The 32-bit CPU is not an ARM, it's an open-IP implementation of the SPARCv8 architecture.
9
General discussion / IR receiver chip with signal level (RSSI) ?
My initial efforts at building an IR receiver from scratch suggests any discrete design I might make won't touch the power consumption or performance of that $0.50 part. I've seen a reference to Motorola MC13173 but it is quite complicated (and obsolete). The IrDA devices like Vishay TFDU4301 http://www.vishay.com/docs/81965/tfdu4301.pdf have 300x lower sensitivity, and also lack RSSI.
At this point it looks like my best bet to determine RSSI is to incrementally change Tx power, and see what is received above the detection threshold, and what isn't. But I presume that threshold will change with ambient DC and AC signals, so a direct RSSI signal would be nice.
10
General discussion / Arduino code for Microchip MCP3424 18-bit ADC
Sample Arduino code for Microchip MCP3424 18-bit ADC
Code: [Select]
// Demo Code to read Microchip MCP3424 18-bit ADC on Arduino / JeeNode
// see also PCB page http://jeelabs.net/projects/hardware/wiki/Analog_Plug
// and MCP3424 datasheet http://ww1.microchip.com/downloads/en/devicedoc/22088c.pdf
// by JBeale (John Beale 2010, updated 2013)
#include <JeeLib.h> // sensor library from https://github.com/jcw/jeelib
PortI2C myI2C (3); // JeeNode Port 3, see http://jeelabs.org/2009/09/16/jeenode-pinout/
DeviceI2C adc (myI2C, 0x68); // 0x68 or other address codes set on A0/A1 pins
// No solder links (A0,A1 both open, or both low) = 0x68 see p.20-21, MCP3424 datasheet
static void AP2init (DeviceI2C& dev, byte mode) {
dev.send();
dev.write(mode);
dev.stop();
}
// 'mode' = MCP3424 8-bit configuration register
// see sec. 5.2 Configuration Register, p. 18 of datasheet
// b7 b6 b5 b4 b3 b2 b1 b0 ----- (bit number)
// RDY C1 C0 O/C S1 S0 G1 G0 ----- (bit name)
// --------------------------------
// RDY = 0 when ready (or in one-shot, write '1' to start conversion)
// C1/C0: input channel # 00 = 0, 01 = 1, 10 = 2, 11 = 3
// O/C: 1 = continuous conversion mode, 0 = single-shot conversion
// S1/S0: rate: 00 = 240 Hz (12 b), 01 = 60 Hz (14 b) 10 = 15 Hz (16 b) 11 = 3.75 Hz (18 b)
// G1/G0: gain: 00 = x1, 01 = x2, 10 = x4, 11 = x8 FullScale: 2.048 V, 1.024, 0.512, 0.256
// 0001 1100 0x1C is channel 0, continuous, 18-bit, gain x1
// 0011 1100 0x3C is channel 1, continuous, 18-bit, gain x1
static long AP2read (DeviceI2C& dev) {
dev.receive();
long raw = (long) dev.read(0) << 16;
raw |= (word) dev.read(0) << 8;
raw |= dev.read(0);
byte status = adc.read(1); // throw away "status" result
return (raw * 1000) / 64; // not sure if correct for negative readings.
// need different scaling if PGA gain setting changed from x1
}
void setup () {
Serial.begin(57600);
Serial.println("18-bit ADC test");
AP2init(adc, 0x1C); // 0x1c = channel 1, continuous, 18-bit, gain x1 (FS = +2.048 V)
// AP2init(adc, 0x1E); // chan 1, continuous, 18-bit, gain x8 (FS = +0.256 V)
delay(300); // wait long enough for 1 sample to complete
}
void loop () {
long val;
unsigned long time;
time = millis() / 1000; // seconds since reset
Serial.print(time); // time in seconds
Serial.print(",");
AP2init(adc, 0x1C); // chan 1, continuous, 18-bit, gain x1
delay(300); // wait for sample to complete
val = AP2read(adc);
Serial.println(val); // ADC reading
}
11
General discussion / hybrid TSSOP / 0.1" stripboard protyping
Here is one with ATmega chips in mind: http://www.atarado.com/catalog/images/d ... 104x83.jpg
I wouldn't mind having some of their boards, but I have been unable to find out where I can buy them. Their online catalog has an "add to cart" button but it doesn't work. Has anyone tried these?
12
Sick of Beige / handheld device case with space for 4xAA ?
EDIT: nevermind, it looks like Serpac http://www.serpac.com/h754AA.aspx has what I'm looking for.
About $10 at Digikey. http://www.digikey.com/product-detail/e ... -ND/304344
Found it thanks to another thread at https://forum.sparkfun.com/viewtopic.php?t=19323
13
Project development, ideas, and suggestions / cheap tablet as control interface?
I see that you can get Android 4 tablets with a 7" 800x480 capacitive touchscreen for under $60 now, for example this one: http://www.gadgetsdealer.com/product126439.html
At that price it's nearly the same cost as the display alone, and it includes battery, wifi, 4GB memory and a 1 GHz processor. Is there any reason I couldn't use this as my control interface, to display and interact with a simple locally-served webpage from a Raspberry Pi showing sensor status, etc.? I doubt I'm the first person to have this idea- is anyone using this type of tablet as a dedicated control surface? How well does it work in this application?
14
General discussion / another (cheap?) PCB fab: Hackvana
Quote
Hello from Mitch and Tully! We're two hackers from Australia and the USA who have moved to Shenzhen China. Why Shenzhen? Because Shenzhen has the world's largest electronics market! Here's what we can do:
Make PCBs to your specifications.
Give you a quote on the parts for your latest project.
Parts that we quote on are added to the store, so you can order them there if you like the quote.
15
General discussion / Teensy 3.0 arrived
My first test was to see how good the on-board ADC is. It is 16 bits, but Paul had said due to noise, it is effectively only 13 bits. You can see my experimental setup in this photo. ADC0 is driven by a 499/1.0k resistive divider from Vdd to AGND (analog ground pin), and a 0.1 uF cap from ADC0 to AGND. In this case Vref = Vdd = 3.266 V and ADC0 input is 2.171 V (per Fluke 179). This gives an expected reading of 65535*(2.171/3.266) = 43563 counts, where 1 LSB = 49.84 uV. Running the below code, with a sample size of 10000 readings, I get a standard deviation of just about 1 LSB (so RMS noise = 50 uV) and peak-peak noise of 7 counts, and a DC offset from the expected reading of 10-20 LSBs (= 0.5 to 1 mV).
The noise and offset from the expected reading depends somewhat on the clock rate set. Without that 0.1 uF cap from ADC0 to AGND, both p-p and std.dev noise increase about 3.5 times. The board is being powered by (no doubt noisy) +5.18V from a USB hub on a PC monitor, the 3.266 V is from the on-board regulator. The AGND pin is sensitive with this simple unshielded setup: even just connecting the ground lead of my battery-powered Fluke 179 multimeter and nothing else (and with the meter powered off) increases RMS noise from 0.9 to 1.6 LSB.
By the way, compiling and downloading code to T3 is a lot faster than with a standard Arduino. The attached code compiles, downloads, and is running in about 2.5 seconds! Also, the USB ACM interface is remarkably faster than the 115.2k Arduino if you want to send a lot of data via serial.print() output.
Sample Output from ADC test program:
Code: [Select]
# Teensy 3.0 @ 96 MHz
# Samples/sec: 2246.69 Avg: 43582.86 Offset: 19.94 P-P noise: 7 St.Dev: 0.944
# Samples/sec: 2245.68 Avg: 43583.17 Offset: 20.25 P-P noise: 8 St.Dev: 0.938
# Samples/sec: 2245.68 Avg: 43583.22 Offset: 20.31 P-P noise: 7 St.Dev: 0.931
# Samples/sec: 2245.68 Avg: 43583.40 Offset: 20.48 P-P noise: 8 St.Dev: 0.940
# Samples/sec: 2246.18 Avg: 43583.25 Offset: 20.33 P-P noise: 8 St.Dev: 0.921
# Teensy 3.0 @ 48 MHz
# Samples/sec: 2236.64 Avg: 43583.83 Offset: 20.92 P-P noise: 9 St.Dev: 1.116
# Samples/sec: 2236.64 Avg: 43583.67 Offset: 20.76 P-P noise: 8 St.Dev: 1.123
# Samples/sec: 2236.14 Avg: 43583.81 Offset: 20.89 P-P noise: 8 St.Dev: 1.117
# Samples/sec: 2236.64 Avg: 43583.73 Offset: 20.81 P-P noise: 10 St.Dev: 1.107
# Teensy 3.0 @ 24 MHz
# Teensy 3.0 ADC test start:
# Samples/sec: 2156.10 Avg: 43573.35 Offset: 10.44 P-P noise: 7 St.Dev: 0.913
# Samples/sec: 2156.10 Avg: 43573.42 Offset: 10.50 P-P noise: 8 St.Dev: 0.928
# Samples/sec: 2156.10 Avg: 43573.55 Offset: 10.64 P-P noise: 7 St.Dev: 0.927
# Samples/sec: 2156.10 Avg: 43573.44 Offset: 10.52 P-P noise: 7 St.Dev: 0.907
# Samples/sec: 2156.10 Avg: 43573.33 Offset: 10.42 P-P noise: 7 St.Dev: 0.923
Code for ADC test program
Code: [Select]
// Analog input test for Teensy 3.0 Oct 4 2012 J.Beale
// Setup: https://picasaweb.google.com/109928236040342205185/Electronics#5795546092126071650
#define VREF (3.266) // ADC reference voltage (= power supply)
#define VINPUT (2.171) // ADC input voltage from resistive divider to VREF
#define ADCMAX (65535) // maximum possible reading from ADC
#define EXPECTED (ADCMAX*(VINPUT/VREF)) // expected ADC reading
#define SAMPLES (10000) // how many samples to combine for pp, std.dev statistics
const int analogInPin = A0; // Analog input is AIN0 (Teensy3 pin 14, next to LED)
const int LED1 = 13; // output LED connected on Arduino digital pin 13
int sensorValue = 0; // value read from the ADC input
long oldT;
void setup() { // ==============================================================
pinMode(LED1,OUTPUT); // enable digital output for turning on LED indicator
analogReference(INTERNAL); // set analog reference to internal ref
analogReadRes(16); // Teensy 3.0: set ADC resolution to this many bits
Serial.begin(115200); // baud rate is ignored with Teensy USB ACM i/o
digitalWrite(LED1,HIGH); delay(1000); // LED on for 1 second
digitalWrite(LED1,LOW); delay(3000); // wait for slow human to get serial capture running
Serial.println("# Teensy 3.0 ADC test start: ");
} // ==== end setup() ===========
void loop() { // ================================================================
long datSum = 0; // reset our accumulated sum of input values to zero
int sMax = 0;
int sMin = 65535;
long n; // count of how many readings so far
double x,mean,delta,sumsq,m2,variance,stdev; // to calculate standard deviation
oldT = millis(); // record start time in milliseconds
sumsq = 0; // initialize running squared sum of differences
n = 0; // have not made any ADC readings yet
mean = 0; // start off with running mean at zero
m2 = 0;
for (int i=0;i<SAMPLES;i++) {
x = analogRead(analogInPin);
// Serial.println(x,0);
datSum += x;
if (x > sMax) sMax = x;
if (x < sMin) sMin = x;
// from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
n++;
delta = x - mean;
mean += delta/n;
m2 += (delta * (x - mean));
}
variance = m2/(n-1); // (n-1):Sample Variance (n): Population Variance
stdev = sqrt(variance); // Calculate standard deviation
Serial.print("# Samples/sec: ");
long durT = millis() - oldT;
float datAvg = (1.0*datSum)/n;
Serial.print((1000.0*n/durT),2);
Serial.print(" Avg: "); Serial.print(datAvg,2);
Serial.print(" Offset: "); Serial.print(datAvg - EXPECTED,2);
Serial.print(" P-P noise: "); Serial.print(sMax-sMin);
Serial.print(" St.Dev: "); Serial.println(stdev,3);
// while (true) {}
} // end main() =====================================================