Skip to main content

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

1
DirtyPCBs support / should I expect the Layer Report to show copper top layer?
After uploading my zipped Gerber files, with the specified extensions for each layer type as indicated here, the order page shows a green "OK" label for all the layers I expect to see, including top soldermask and top copper. I notice that there is a rendering result image for some layers, including bottom soldermask and bottom copper layer, but it does NOT show either soldermask top or copper top layer, which are obviously important to the board. Should I worry about that?
2
General discussion / Personal Seismograph with Raspberry Pi (Kickstarter)
Here's something for that unused Raspberry Pi you have lying on your desk looking for something to do. A personal seismograph, can deliver data in a standard format over the network.  I've done a cruder version myself with a simple sensor + circuit, but this one looks like it has much better performance, and certainly more professional software. The HW is not open-source so I don't know the circuit details but they claim a low-noise front end, with a 4.5 Hz geophone extended to 0.5 Hz able to capture down to magnitude 2 quakes within 50 miles. I'm not associated with the project, except that I backed it.  As of Friday afternoon there are a few hours left in the KS project still:
https://www.kickstarter.com/projects/an ... eismograph
3
General discussion / Art of Electronics 3rd Ed. mentions DP !
Had anyone else noticed this?  I just got my Horowitz & Hill "Art of Electronics" 3rd Edition which came out some months ago.  This is the updated version of I think the world's best known electronics text.  I was interested to see that it mentions the Bus Pirate and the DP website in the last chapter, on page 1091 (Chapter 15 "Microcontrollers", section 9.3 G "A universal pod?")
4
Project logs / Tiltmeter (seismology, etc)
Most of the horizontal seismograph projects I've seen use a magnet and coil as a detector, so they record earthquake vibrations in some frequency range but do not have a DC response. A tiltmeter is similar but it does have DC response, so you can see very slow tilts of the surface, that might signal an overloaded bridge, a dam about to break, volcano magma movements, etc. depending on where you put the sensor.

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
I don't know if it's appropriate to post Kickstarter projects here, but i thought this might be of interest... "Black Swift" doesn't beat the price of the cheapest router, but at  25×35×4 mm it is smaller, and also it is designed for general-purpose embedded use, instead of having to hack something out of a wifi hotspot.  Runs OpenWRT 14.07 Linux on 400 MHz Atheros AR9331, 16M flash, 64 M SDRAM, 1x USB2, 1x UART, SPI, I2C, 26 GPIO, 802.11 b/g/n.  The chip can support two 10/100 ethernet ports but that needs additional parts (eg. RJ45 with magnetics). I'm not part of the project, it is done by a Russian team; just a backer of it.

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
In case of interest: Ebay has "photoelectric rotary encoder" starting around $15. These have two outputs in quadrature so you can tell the direction of rotation as well as the angle. I got a 600 pulse/rev and a 360 P/R model, the latter is in the photos below. Inside is a metal wheel with many thin slots. I wasted some time because I don't read Chinese and relied on the (wrong) pinout listed on the Ebay page. I had to take it apart to find +Vcc (5V) was the white wire, not red. Then tried translating "white" into Chinese with Google Translate.  With correct hookup it works, with Vcc >= 2.6 V. The label says VCC: 白 (white) GND: 黑 (black) Channel A: 红 (red) Channel B:  绿 (green)


7
General discussion / cheapest wifi device?
I'm thinking about a project that needs wifi connectivity without too much cost. Just for comparison purposes I'm looking at what's out there now. Is it correct to say that a compact wifi router is the cheapest standalone device that uses wifi? For example, here's a Belkin 4-port wireless for $12.50 from Amazon: http://www.amazon.com/Belkin-Wireless-G ... 001CN9K6E/

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
I don't have any connection to this indiegogo campaign and I don't know if they can deliver what they are promising. But I hope they can, because a 32-bit Arduino + GPS engine for $17 is quite interesting, and a pair of carrier-phase raw pseudorange output receivers for $50 is even more interesting (this allow DGPS or RTK using RTKLIB with cm-level precision in theory).  Very good for precise positioning of your autonomous vehicle / quadcopter / etc.  I'm not aware of anything comparable on the market now. http://www.indiegogo.com/projects/navsp ... s-receiver

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) ?
Anyone know of an IR receiver chip with some indication of analog received signal strength (RSSI)?  I only need a low data rate, such as for IR remote control. There are some small devices for remote controls with good performance, like the Vishay TSOP39338 http://www.vishay.com/docs/81743/temt6202.pdf with a minimum signal of 0.12 mW/m^2 (that is 12 nW/cm^2), even in its small package with a broad acceptance angle. It claims 45 meter range using 400 mA pulses at 38 kHz into a TSAL6200 IR LED. But it is in a 3-pin package with only a fully demodulated digital output; the internal analog signal path and AGC system is hidden from view. 

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
This is mostly a note to myself, but may be helpful for someone else.

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
I just came across the "Atarado" company, which makes some curiously laid-out stripboard and hybrid through-hole / SMT protyping board which I have not seen before. Here is one example: http://www.atarado.com/catalog/images/d ... -63x69.jpg

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 ?
I don't know if this is the right place to ask, but: is there some existing source for a plastic case, about the size of a handheld multimeter, with a 4xAA battery compartment in the back? I thought this might be a standard thing but I have not found a source. I just need a few of them; not going into production.  Cases with a 9V battery compartment are more easily available.

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'm thinking about a display and control interface for a home sensor network (shows current room temperatures, lights, occupancy, etc.). 

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
Has anyone used "Hackvana" for PCB fab? I just came across them from a posting on the KiCad Yahoo user group.  They don't have prices online up front, but I gather that order totals under $50 are possible, and they mention capabilities the cheapest places don't provide (eg. non-plated through holes, interior cutouts, and V-scoring).  Below from http://http://www.hackvana.com/store/

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
Yesterday's mail had my Teensy 3.0 (ARM Cortex-M4 with Arduino-style programming). This is from Paul's kickstarter (US Mail takes 2 days from OR to CA, it seems). Some pics: Teensy3, and on breadboard

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()  =====================================================

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.02232487144session_write_close ( )...(null):0
20.02262618752ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.02272619528Database_MySQL->query( ).../DatabaseHandler.php:119
40.06692758280Database_MySQL->error( ).../Db-mysql.class.php:273