Skip to main content


This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - erdabyz

Project development, ideas, and suggestions / Re: Need help from analog gurus. 78L08 output at -0,9V
Someone at the eevblog gave me the solution already. It doesn't attack the root of the problem but prevents it from happening, all I had to do was to include reverse polarity protection diodes like in this image:

That prevents whatever is pulling the 78L08 low during startup to pull it too low so it can eventually recover and start regulating. I had already tested everything for shorts and even bypassed the regulators and everything worked perfectly, so I narrowed it down to some issue with the regulators.

It has to be something related to power-up biasing sequence of the amplifiers and I promise I'll investigate it further but for now this works and once everything is powered up current consumption is just as expected and the DAC works perfectly and up to spec.
Project development, ideas, and suggestions / Need help from analog gurus. 78L08 output at -0,9V
I have a problem with a prototype circuit I had to rush in a week. It pretends to be a dual channel very high quality audio DAC with some requirements for distortion, flatness and bandwidth. I based it on the PCM1794A from Texas Instruments using a slight variation of the proposed output buffering circuit in the datasheet (uses LT1028 as differential amp and a couple of NE5534 as IV converters for each output).

We use a triple channel switchmode PSU (that switches at 110 kHz) to power the whole system (it must fit in a 1U rack case and height is too constrained for a linear PSU) with +5V, +12V and -12V rails. In the DAC board the +-12V rails are LC filtered and post-regulated using 78L08 and 79L08 regulators to the +-8V that feed the opamps of the oputput stage. They're decoupled using ceramic caps (and i'm aware it might be part of the problem). The 78L08 is TI branded (ua78l08) and the other is MCC branded

The problem comes when we power up the board. The -8V rail gets to -8V without any problem but the +8V one goes to -0,9V and stays there. Then, if you unplug the -12V rail the +8V rail goes up to spec and stays there. Then if you re-plug it the -8V rail goes up and both rails stay up and the thing runs until you power the board off. We've red-necked the issue adding a delay switch in the -12V rail so it only powers the board once +8V are present but this must be turned into a commercial product in about a month and I'd rather solve the issue than patch it.

Any clues about what may be happening? Something should be pulling the +8V rail low until it reverse-biases a transistor in there preventing regulator startup, hence suspiciously staying at -0,9V, but I don't know how to solve the issue right now. Any clues?
Project development, ideas, and suggestions / Re: a Power Supply Board....
You can't just input 5V to the battery and expect it to live for more than a couple charges. Overvoltage protection is a protection feature and cuts the battery at the survaivavility limit without expecting you to keep using that battery. It's there so if the charger fails the battery doesn't catch fire, but if the protection trips the battery will already be overcharged and shouldn't be used anymore.

Look for PMIC IC's with dual buck boost /boost regulators and battery charger. Linear Technology has plenty of them and some may be suitable for your application. They aren't cheap but...
General discussion / Re: Yet another eda versus
I like Altium the most of all those. Good compromise between community/resources available and pro-ness. I use it on a regular basis and once you get used to it it's very efficient.

Kicad sucked in the past, dunno if it has improved but I didn't like the interface nor the work flow.

I don't like proteus either because most things it does can be done better with dedicated tools, kinda like what happens to altium with the FPGA-oriented stuff which nobody uses.

The others I haven't tested.
General discussion / Dirtypcbs messed my order.Does anyone recognize these pcbs?
I ordered some PCB's from dirtypcbs back in april to try the service. Today I've received the package containing wrong PCB's. Does anyone recognize these?

I've not opened the package and I cand send them to their owner if ownership proof is given. If no claim is given in 15 days I'll open the package, look for info and if I get the schematic and BOM build whatever they are supposed to be.
Project logs / Re: Help with an OLED screen
[quote author="Sjaak"]I think I got the same display somewhere here.. :) never got around to play with it though.

It could be a broken batch (perhaps why it could be that cheap) or something wrong in your/his code. I had simulair problem with an other oled and i solved it by playing with the duty cycle/freq/brightness settings. They changed things differently then I expected. Dunno the exact solution anymore.. Also check the reference schematic as all the chinese sellers seem to copy it over and over except for the right values, also looking at a different versions of datasheet can help.[/quote]

Yeah, I've looked at 3 different versions of the datasheet, some of them contain more commands, some contain less. The schematic values looked consistent to me in all of them.

I made a test software that would loop over all possible values of duty, internal voltages and brightness settings and nothing varied at all. I even shorted out the IREF resistor without any change. Only a faint glow with the rectangles/text I wanted it to display.

The code provided by the chinese seller uses an undocumented command related to power but using it or no doesn' matter... I'll see what I can do.
Project logs / Help with an OLED screen
I need to get a OLED screen to work, concretely this one: ... 317209.0.0
According to the manufacturer they have the same controller and work like a different 1.04inch model that seems to have been tested by some people and there's even an arduino library.

I've bought 20 of them for a project because I already had one that I bought 3 years ago that I could use for prototyping while the others arrived, and knowing that there are libraries out there I thought it would be easy to make them work.

I've made a small prototyping board with a PIC and a boost converter to supply 13.5V for the screen generated from 3.3V. The regulator seems to work well and the screen responds to all of my commands, in fact I've gotten it to display whatever I want but with a very very faint white-ish glow that It's almost impossible to see unless in total darkness. I've based my code on the files provided by the taobao seller (the code seems to have some errors that I think I've fixed) and on the SSD1332 datasheet itself but I can't get them to properly work.

I've tested and measured the voltages generated by both the regulator and the screen and all are up to spec (even checked ripple with an o-scope). I've tested all the commands available for the SSD1332 according to the datasheet with different values and in different order. I've also tried asking the seller but he says that he hasn't got more info than the two files posted in the taobao page. I'm respecting the recommended power-on sequence too.

I've also noticed (too late) that in the comments page there seems to be some people complaining that they can't get them to work either, while they could make the 1.04inch version work (at least that's what google translator says).

Any clues?
Project logs / High altitude balloon electronics
I'm part of a students association and we've had a helium tank in our place since 2003 which is still almost full. None of the current members knew where it came from until recently (turned out that we had a RC blimp of some sort back in those days...). So some time ago a member proposed that we could spend it in a high altitude balloon. Being electronics enthusiasts we thought about building our own electronics for the payload, trying to fit as much as possible in as few grams as possible. For now it's planned that the probe will have an APRS tracker, an emergency 433MHz tracker, a GPS module of course, a GSM module for sending a SMS with the landing position if network is available, a board with lots of sensors (temperatures, atmospheric pressure, light intensity, gamma/cosmic radiation, 3D acc+gyro+mag, humidity and probably wind speed (we're still not sure if that would be possible with a cheap, lightweight sensor). The whole thing will be controlled by a PIC32 and powered by 3xAA Lithium energizer batteries which are safer than lipos and tolerate very well low temperatures. It will log all its data into a microSD card. The electronics are composed by a mainboard with the PIC32 and some power supply stuff and 5 main verical modules that attach to the mainboard creating some sort of pentagonal prism which will be stuffed with thermal insulating material(a design that looks like the new mac pro's, but we thought it earlier). We've tried not to reinvent the wheel and we've adapted some designs from other people to our shape constraints.

Those 5 modules are:
-GSM module using a SIM900 GSM module and a power supply based on a TPS63020. This is our design.
-GPS module based on a SIM18 module, also our design. It'll use a passive patch antenna.
-APRS tracker which is just a stand-alone trackuino adapted to our design:
-Sensors board which we are currently designing.
-Mission support board which will have power mosfets for the rope-cutting mechanism, heaters and some other stuff that's still to be defined.

Apart from those there's also a low power emergency 433MHz tracker which gets powered by two CR2032 batteries. In the event of a main power malfunction this tracker will power and take control of the GPS module to keep sending tracking data. We also designed the radiation sensor as a separate board because it'll be positioned in a different place.It is based on a design from elektor. I can't post the article's PDF because of possible copyright issues.

We'll also carry a mobius action camera inside to record the flight. We already have the balloons, the rope, the camera, the required antennas, legal information about the required permissions, some of the firmware and most of the electronics designed. We also have people with the required APRS receivers and radio licenses. The GPS and GSM modules are built and tested OK, soon we'll assemble the mainboard, the trackers and the radiation sensor.

Here's everything we've designed for now. There are separate files for the mainboard and the GSM module but everything else is fitted into a "panelized" PCB to save costs, I don't have the individual design files for each sub-board. The schematics may be a bit "dirty" and some values can be wrong or would need tweaking. I'll post final design files when everything is done.


The antenna connections are designed so you can either stuff a U.FL connector or to bypass it with a 0ohm resistor and stuff a SMA edge mount connector. The GPS has a footprint for either a U.FL or a sarantel SL1206 helix antenna that we have from a previous project, but we'll use a passive ceramic patch antenna in this case, mounted on the top of the probe and brought to the module via thin coax terminated in a U.FL. The groundplane and mounting features for the patch are also included in the panelized PCB. Here's a picture of the GSM module which I've been testing these days:
Project logs / Re: Attempt to fit a quadcopter in a 5x5cm PCB
[quote author="omairkh"]Hello, has there been any further progress on this?[/quote]

Yeah, the first prototype was stuffed with new motors and propellers and we tested if they could lift the thing. They could, but unfortunately the quadcopter flew off the test fixture and crashed against a wall. All four motors were destroyed (pulled the wires off) and nothing else has been done since then. The propellers attached to those motors were also too big so we had to mount the new motors in the worst possible way, leading to their destruction in the crash. The proyect is on hold mainly because we haven't found any suitable motor+propeller for it.
General discussion / PIC32 I2C slave responds to spurious addresses
I'm trying to implement I2C slave functionality in a PIC32. I'm using a Chipkit UNO32 for testing but the final implementation will use a PIC32MX250F128D. I've gotten the basics to work thanks to this example: ... een_PIC32s
And now I'm trying to adapt it to the new peripheral libraries to avoid using legacy ones. I'm using a BusPirate as I2C master set to 50kHz operation. Using the I2C scanner macro the busPirate detects a device in the correct address... but also in several other I2C addresses to which the PIC responds and that are always the same no matter what the "real" address is set to. Address mask is set to 0.

Here's the code: (stil a rough test with 90% copypasta from that example):
Code: [Select]
/*  Files to Include                                                          */
#ifdef __XC32
    #include <xc.h>          /* Defines special funciton registers, CP0 regs  */

#include <plib.h>          /* Include to use PIC32 peripheral libraries      */
#include <stdint.h>        /* For uint32_t definition                        */
#include <stdbool.h>        /* For true/false definition                      */

#include "system.h"        /* System funct/params, like osc/periph config    */
#include "user.h"          /* User funct/params, such as InitApp            */

/* Global Variable Declaration                                                */

#define Fsck 50000
#define BRG_VAL ((PBCLK/2/Fsck)-2)

// this is the modules Slave Address
#define SLAVE_ADDRESS 0x33
#define mLED_2_On() LATGbits.LATG6=1
#define mLED_3_On() LATFbits.LATF0=1
#define mLED_2_Off() LATGbits.LATG6=0
#define mLED_3_Off() LATFbits.LATF0=0
/* Main Program                                                              */
volatile unsigned char dataRead = 0;

// InitI2C
// Perform initialisation of the I2C module to operate as a slave
void InitI2C(void)
I2CEnable(I2C1, FALSE);

      // Configure Various I2C Options
      // Set the I2C baudrate
      I2CSetFrequency(I2C1, PBCLK, Fsck);

      //Set I2C slave address
      I2CSetSlaveAddress(I2C1, SLAVE_ADDRESS, 0,I2C_USE_7BIT_ADDRESS);

      // Enable the I2C bus
      I2CEnable(I2C1, TRUE);
// configure the interrupt priority for the I2C peripheral


int32_t main(void)

    /*The JTAG is on by default on POR.  A PIC32 Starter Kit uses the JTAG, but
    for other debug tool use, like ICD 3 and Real ICE, the JTAG should be off
    to free up the JTAG I/O */
    DDPCONbits.JTAGEN = 0;


    /* Initialize I/O and Peripherals for application */


// main loop
while (1) {
/* If global variable "dataRead" is set high during interrupt, turn on all LEDs */
if (dataRead == 0xAA)



// Slave I2C interrupt handler
// This handler is called when a qualifying I2C events occurs
// this means that as well as Slave events
// Master and Bus Collision events will also trigger this handler.
void __ISR(_I2C_1_VECTOR, ipl3) _SlaveI2CHandler(void)
unsigned char temp;
static unsigned int dIndex;

// check for MASTER and Bus events and respond accordingly
if (IFS0bits.I2C1MIF == 1) {
if (IFS0bits.I2C1BIF == 1) {


// handle the incoming message
if ((I2C1STATbits.R_W == 0) && (I2C1STATbits.D_A == 0)) {
// R/W bit = 0 --> indicates data transfer is input to slave
// D/A bit = 0 --> indicates last byte was address

// reset any state variables needed by a message sequence
// perform a dummy read of the address
temp = SlaveReadI2C1();

// release the clock to restart I2C
I2C1CONbits.SCLREL = 1; // release the clock

} else if ((I2C1STATbits.R_W == 0) && (I2C1STATbits.D_A == 1)) {
// R/W bit = 0 --> indicates data transfer is input to slave
// D/A bit = 1 --> indicates last byte was data

// writing data to our module, just store it in adcSample
dataRead = SlaveReadI2C1();

// release the clock to restart I2C
I2C1CONbits.SCLREL = 1; // release clock stretch bit

} else if ((I2C1STATbits.R_W == 1) && (I2C1STATbits.D_A == 0)) {
// R/W bit = 1 --> indicates data transfer is output from slave
// D/A bit = 0 --> indicates last byte was address

// read of the slave device, read the address
temp = SlaveReadI2C1();
dIndex = 0;
} else if ((I2C1STATbits.R_W == 1) && (I2C1STATbits.D_A == 1)) {
// R/W bit = 1 --> indicates data transfer is output from slave
// D/A bit = 1 --> indicates last byte was data


// output the data until the MASTER terminates the
// transfer with a NACK, continuing reads return 0
if (dIndex == 0) {
} else

// finally clear the slave interrupt flag

With that code the PIC responds to all these addresses:
0x01(0x00 R) 0x02(0x01 W) 0x03(0x01 R) 0x04(0x02 W) 0x05(0x02 R) 0x06(0x03 W) 0x07(0x03 R) 0x08(0x04 W) 0x09(0x04 R) 0x0A(0x05 W) 0x0B(0x05 R) 0x0C(0x06 W) 0x0D(0x06 R) 0x0E(0x07 W) 0x0F(0x07 R) 0x66(0x33 W) 0x67(0x33 R) 0xF8(0x7C W) 0xF9(0x7C R) 0xFA(0x7D W) 0xFB(0x7D R) 0xFC(0x7E W) 0xFD(0x7E R) 0xFE(0x7F W) 0xFF(0x7F R)

Any clue?

EDIT: by responding I mean that it turns off both leds when I send 0xAA to any of these directions.
General discussion / Re: SHARP GP2Y0A21 peak current consumption?
[quote author="Bertho"]The datasheet says a max. supply rates at 40mA (average) and 30mA typical (average). The sensor pulses the LED at high power for a measurement and then turns it off. The real question is what the duty-cycle is.

If your USB connection is dropping 1V, then I seriously suggest that you find another cable (not an uncommon problem for USB cables). At your measured 0.7Ohm, and 1V drop, that would mean more than 1.4A current, which I do not believe. I think that you have a much higher resistance in there.

At a 50% duty-cycle, you'd get 80mA tops. (IR) LEDs are commonly pulsed at 50..250mA, so 80mA that may be a good estimate, but could also be way off. You can measure the actual current by using a bench-PSU at 5V with a 0.1Ohm series resistor and then measuring over the resistor with an oscilloscope (or 0.2Ohm for less noise). That will give you the actual current consumption and pattern. Rise- and-fall-times are not very interesting. You want the on- and off-period times.

A quick estimate of ripple, when your supply is very slow to react (as usual with long cables) gives with a 10uF capacitor and 50mV ripple and 100mA current that you may not exceed 5us pulse on-time (t=C*U/I). It will be a better in real life, but it still may be very hard to achieve with multiple sensors on the same power line.

USB is supposed to be able to supply 500mA, but the output voltage at that level may be significantly under 5V (I think 4.5V or something in that vicinity). You may need to add additional boost/buck regulators to keep your supply regulated.[/quote]

Ouch, didn't read your comment. The duty cycle is 50% and the pulsing frequency is about 1kHz (500us ON/ 500us OFF). I wanted to measure the current the way you say but didn't have any low ohm leaded resistor. I tould about rise and fall times because the kind of reponse I get suggest that this is a purely resistive drop and that the main problem doesn't relate too much to inductance.

I've measured the resistance with another multimeter and this one says 1,2ohm. I don't have any high-grade multimeter on hand. I'll try measure the current with a series resistor as soon as I get one.

I found information about the largest model of the same series which has a 5 pin connector with two dedicated to power and two to ground (as opposed to one for each in my model), has a much much larger LED and has a much longer range and it seems to be pulsing its LED at 400mA.

So I think my sensor is defective... will try another soon and see. Will also replace the cable. The one I'm using is very very crappy.
General discussion / Re: SHARP GP2Y0A21 peak current consumption?
[quote author="MickM"]Hi;
  why not use a powered HUB for the sensors?

Mick M[/quote]

Using external power would be an option if it turns out that USB power is imposible, but I want to go to the cause of the problem. I just don't think that such a sensor would be so "agressive" without the manufacturer saying a word or two about that in the datasheet. I think that the particular sensor I'm testing things with is just defective but I don't have anymore.
General discussion / SHARP GP2Y0A21 peak current consumption?
I need to power six of these sensors over USB. I thought it would be a reasonable thing to do because the datasheet states that they have an average current consumption of 30mA and the board will always be connected to the computer (It won't be hot-plugged) so I can play with capacitance and add "as much as I want" even if the standard imposes a limit of 10uF without soft-connection.

The datasheet says nothing about peak current or pulse frequency (I hate japanese brands datasheets for these things...) but I assumed it wouldn't go past about 100mA.

The problem is that peak current consumption looks to be much much higher than that. Maybe my sensor is defective but I've measured the resistance from the USB connector to the power pin of the sensor to be about 0.7 ohms and every time the sensor fires a burst of IR the voltage drops about 1V. I think it's not inductance related because the waveform of the voltage matches the waveform of the burst sequence. Every time the LED turns on the voltage immediately drops 1V for the time the LED is ON and then climbs back to about 5V. Rise and fall times are in the order of 1us.

An updated datasheet of the sensors suggests adding at least 10uF of capacitance near the sensor. The problem is that in this application the sensors are connected to the board with a wire that's about 30cm long.

The whole problem is that those fluctuations in the power rail make the microcontroller get unstable until the USB transceiver freezes. And that's with just one sensor...

Has anyone played with this sensors and experimented the same behaviour? Why the hell doesn't the sensor include its own capacitor?
General discussion / Re: SeeedFusion 4-Layer Tolerance Change
[quote author="mattthebaker"]That service does look promising.  I was checking them out after finding matseng's post about them in another thread.  The stencil service is especially nice, steel for $20.

In working with them did you get any additional information about their process?  In particular I'm interested in their options for layer stack up.  I have a couple transmission lines that are a sensitive to dielectric and spacing.  Seeed specifies that 1-2 and 3-4 layer spacing is 0.2mm.

Their 20 mil feature to edge spacing may be a problem for me, as I've already committed to space constraints with this spec at 10mil.  I think I may submit my design with the 10 mil spacing and see what I get...[/quote]

Well, the board I told you about has 16x 200Mbps transmission lines and 8x825Mbps LVDS differential pairs that run from side to side of the board. We're scared about what will happen to the signals travelling through them. We'll assemble a prototype in early september and I'll tell you. We assumed 0,2mm dielectric spacing between outer and inner layers because of Seed's rules and because for some reason it seems to be the most standard layer stackup for 4 layer boards.

Why using a cheap service for such a board in the first place? Well, the design is just a prototype link board for connecting 3 evaluation boards and the transmission lines are close enough together so that coupling between them does matter and affects impedance. In those situations you're somewhat screwed anyways so we thought we'd rather try and see if it works than paying 5x the price to get something more "controlled".We're optimistic.