3d printing a Touch-proof connector

I’m currently working at the Electronics and 3D Prototyping Laboratory at the Facultad de Ingeniería, Universidad Nacional de Entre Ríos.  We are working on a biopotential amplifier based on a ADS1299.  The amplifier uses 1.5mm touch proof connectors like this one. Unfortunately Plastics1 is the only manufacturer (and seller) of these particular connectors. The purchase have not been done yet, and it will take a while to have them in the lab. That was a problem as we needed to make some tests ASAP. We have a couple of 3d printers so we decided to make the connectors ourselves with the stuff we have in the Lab.

I had already made the connectors’ 3D model in Solidworks in order to generate the step an wrl files for KiCad.

pcb

I modified the housing to fit standard 2.54mm pin headers. The main fear we had was that the printed plastic wouldn’t tolerate the heat while being solder to the PCB. For that reason we didn’t use just the metal pins but also the plastic part of them. That material is designed to withstand the heat while being solder and was used to minimize direct metal-to-housing contact. The pins at the front of the connector were soldered first to the PCB and then the housing was press fit into them.

ensamblaje

We printed the connector in a Objet Eden 260 from Stratasys. The material used is VeroWhite.

ambos3

We found out about a connector with pins in a similar size to the one we needed. Circular Plastic Connectors (CPC) use 1.58mm pins, close enough.  We had a couple in the lab from another project but we needed more. Luckily my cousin (who is studying there as well) is working in a similar project for his thesis and bought a bunch of these pins to be used in a similar way. The pins were disassembled as seen in the picture and only the front part was used.

ambos

A single 17 mm long pin header was slided inside the contact and soldered in place. The pin was then bended…

ambos2

.. and gluded in the printed housing.

ambos4

As I said before, the pins in the front were soldered first:

cam00571the connector was press fit into them and the central contact soldered.

cam00602

We made several connectors, they are not pretty but they work great.

 

 

 

Posted in Uncategorized | Leave a comment

Freescale’s sensors breakout boards

A few more PCBs, this time for Freescale’s sensors.

MMA8541Q

The MMA8451Q is a  low-power, three-axis accelerometer with 14 bits of resolution. It communicates over I2C,  has built in tilt/orientation detection and also tap detection.

To make the PCB I downloaded the Eagle files from Sparkfun breakout board and modified it to make it single sided. I had to add a couple of 0 ohm resistors as jumpers.

Freescale sensors

To test it I used Adafruit Library for Arduino

mma8451

FXOS8700CQ

The FXOS8700CQ combines a 14-bit accelerometer and a 16-bit magnetometer. It also has some programmable acceleration event functions, like tap and orientation detection, and includes programmable magnetic event functions: Threshold detection, Vector-magnitude change detection, etc.

Freescale sensors

It  can communicate using i2c or SPI. I used this library to test it.

fx0s8700cq

MPL3115A2

The MPL3115A2 is a pressure sensor that provides altitude data to within 30cm. It has a I2C interface and the outputs are digitized by a high resolution 24-bit ADC. The MPL3115A2  can measure:

  • Pressure: 20-bit measurement (Pascals)
  • Altitude: 20-bit measurement (meters)
  • Temperature: 12-bit measurement (degrees Celsius)

Freescale sensors

I also used Sparkfun’s Eagle files to make the board and I tested using Adafruit Library.

mpl3115a2

According to Google Maps the height where I live is 64.13 m. I was testing the device on a first floor, I would say it’s pretty accurate.

Logic Level Converter

All this sensors are 3V devices. I tried first to connect them to a MSP430 Launchpad using Energia but I couldn’t make them work.

The I2C protocol defines a so-called repeated start condition. After having sent the address byte (address and read/write bit) the master may send any number of bytes followed by a stop condition. Instead of sending the stop condition it is also allowed to send another start condition again followed by an address (and of course including a read/write bit) and more data1.

Freescales’s sensors use this Repeated Start command and as I found out, Energia doesn’t support it. As I don’t have any 3.3V Arduino I needed a logic level converter.

I downloaded Sparkfun files for their  Bi-Directional Logic Level Converter and modified it to make it single sided. I used some 2N7002 transistors I had around.

Freescale sensors

EDIT 19/01:

As requested, here is the file for the MPL3115A2 breakout board. It is based on Sparkfun board but I changed the connector pinout in order to make it easier to design a single sided PCB.

Reference

1. Repeated Start Condition

Posted in diy, Electronics, English, FXOS8700CQ, MMA8541Q, MPL3115A2, pcb, sensor | 6 Comments

Programando dispositivos HC08

Hace unos años (varios, unos 6….) conseguí por medio del programa de Muestras Gratis de Freescale unos micros de la linea HC08. Comencé a investigar de que forma programarlos, que interfaz de programación construir, que software utilizar, etc. En el proceso cambíé la PC de esctitorio con XP por una notebook con Windows 7. Esto trajo varios probemas: en primer lugar, leí en su momento que no iba a haber soporte del CodeWarrior (el IDE de desarollo de Freescale) sobre Windows 7, lo podía solucionar con una maquina virtual que corra XP, pero me parecía medio engorroso.

Otro problema era la falta de un puerto serie en mi notebook. Tenía intenciones de utilizar la interfaz MON08 para la programación de los micros. Es una interfaz sencilla que requiere pocos componentes. Leí en su momento comentarios contradictorios acerca del uso de conversores Serie-USB.

Así que los micros estuvieron juntando tierra todos estos años. Entre tanto Freescale (ahora NXP, si han habido algunos cambios…) dió de baja la linea HC08.

Hace unas semanas me encontré de casualidad (no recuerdo que estaba buscando) con este post que explica como instalar CodeWarrior 6,3 en Windows 7 x64 bits. Seguí los pasos y en un rato estuvo andando sin problemas.

Comencé luego a buscar información relacionada al uso de conversores USB y encontré un par de post interesantes. Uno donde muestra una placa de desarrollo para micros HC08 y utiliza un FT232RL. Y otro donde se muestra un programador para micros HC08, de la familia JL y JK, y utiliza un conversor MCP2200. Este último usaba como software de desarrollo WinIDE.

También encontré este video en el que utilizan un conversor PL2303 para la programación de un micro HC08, expecíficamente un QY4. En este caso se usa CodeWarrior 6.3 en una máquina virtual y por algún motivo menciona que el puerto virtual creado debe ser el COM1.

Otro problema era la dificultad de conseguir donde vivo un cristal de 9.8304MHz, aunque según este post sería posible utilizar cristales de frecuencias cercanas y más fácil de conseguir, como por ejemplo 10MHz.

Comencé con unas pruebas sencillas en una protoboard. Armé el circuito que se muestra en el esquemático, para los 9V necesarios para entrar en modo programación (Normal Monitor Mode) utilizo una fuente externa. El microcontrolador es un MC68HC908JL8 y el oscilador es de 10 MHz.

002-001

Acá se puede ver el circuito armado en una protoboard.

Programming HC08 devices

Las primeras pruebas las hice con un PL2303. El conversor tenía asignado el COM44 y el software de programación no lo reconocía. Luego lo cambié al COM1, elegí un baudrate de 9600 y como interfaz  la Clase 3.

paso1

luego de conectar con el microcontrolador, el software pide resetear el procesador:

paso2

y después pide apagar y encender el microcontrolador:

paso3

El apagado del micro es necesario para pasar el chequeo inicial de seguridad y acceder a la memoria flash del microcontrolador.  Un simple reset no es suficiente; para pasar la verificación de seguridad es necesario forzar al procesador a pasar por un POR (power-on reset)1.

Busqué algún firmware que me permitiera probar el funcionamiento del programador y dí con esta página. Tiene varios ejemplos para microcontroladores JL16 que son compatibles con el JL8, y utilicé el jl16-0.c que simplemente cambia el estado de uno de los pines. La descripción en la cabecera del archivo menciona un período de 4.5 microsegundos utilizando un cristal de  9.8304MHz, como utilicé uno de 10Mhz el período que obtuve es ligeramente menor:

NewFile1

Entre los archivos que había descargado hace unos años tenía el esquemático de un programador HC908GS de la empresa Firtec. Es un programador por puerto serie y agrega la circuitería necesaria para generar el POR mediante el software y así ahorrarse unos pasos durante la programación.  Este es el circuito que implementé en la pequeña protoboard roja:

002-002

El software utiliza la linea DTR para controlar la alimentación del microcontrolador y ahora la interfaz que se debe seleccionar en el software es la Clase 1:

Sin título

Cambié el conversor Serie-USB. Utilicé un FT232RL soldado en una placa adaptadora que me permite acceder al pin DTR.

Programming HC08 devices

Resumiendo:

  • Es posible instalar y utilizar CodeWarrior 6.3 en Windows 7 x64 siguiendo estos pasos.
  • Es posible programar dispositivos HC08 con conversores Serie-USB con CodeWarrior 6.3 en Windows 7 x64.
  • Es posible utilizar un cristal de 10MHz.

 

Reference

1. MON08 MULTILINK USER MANUAL

Posted in diy, Electronics, Español, HC08, Uncategorized | Leave a comment

INA219 Current Sensor DIY Breakout board

Another small board, this time for a INA219. The INA219 is a high-side current shunt and power monitor with an I2C interface.

INA219

For testing I used Rei VILO library with a MSP430G2553 and Energia, and I measured the power consumption for this simple circuit:

2 001-001

Nothing fancy, just a led and a resitor. The INA219 should measure around 9.6 mA and got this:

led_5v_330R

The current measurement is slightly off. I need to play a litlle more with the calibration routines.

 

Posted in diy, Electronics, English, pcb, sensor | Tagged , , , , | 2 Comments

SHT21S DIY Breakout board

I made a little board for a SHT21 humidity and temperature sensor from Sensirion.  There are several versions with I2C interface, PWM output and SMD/analog interface.

I’ve got the one with Sigma Delta Modulation (SMD) output,  is a bit-stream of pulses; the more high pulses the higher the value in the full measurement range. A low-pass filter convert the pulse stream to an analog voltage signal.

It has a control pin (SCL) to select between humidity or temperature output. SCL high yields humidity output, SCL low yields temperature output.

SHT21S

I made a simple sketch in Energia to test it out using an MSP430G2553. P1.6 selects between humidity or temperature and P1.0 is used as the ADC input.

SHT21S

…and logged both temperature an humidity.

Sin título

That’s it, a simple and nice sensor…

Posted in diy, Electronics, English, pcb, sensor | Tagged , , | Leave a comment

DIY ez-FET lite…ghetto style

I have a few MSP430G2955 around but non of my Launchpads are capable of programming this MCU. Texas Instruments released a while back all the informtation needed to build the new ez-FET lite. The eZ-FET lite is a low cost USB-based on-board emulation solution for MSP430 microcontrollers. This debuger supports all MSP430 devices compatible with SBW programming and I could use it to program the MSP430G2955.

The hardware is based on an MSP430F5528 and I used a QFN version with an adapter board:

DSC00857

DSC00863

it ain’t pretty…

In order to program the MSP430F5528, I tried first using the FET-Pro430 from Elpotronic. I was able to flash the BSL firmware:

ez2-001

despite an error dialog about code size:

ez1-001

…then, I programmed the ez-FET firmware:

ez3-001

After reseting the programmer all the drivers were installed:

ez4-001

But every time I tried to program a device with CCS I would get this error message:

ez5_error-001

ok, fail…let’s start over.

According to this post the error might be caused by the the custom BSL portion of the ezFET firmware being not properly flashed.  I did read this other post in 43oh about flashing the firmware with MSP430Flasher, I just wanted to see if the Elpotronic software would work.

I tried  to re-program the MSP430F5528 using MSP430Flasher but I get this “BSL memory segments are protected” error.

Sin0-001

According to this post I have to add options to unlock  BSL memory as well as the INFO A memory. I added for that -b and -u:

Sin1-001

Success!! At least the BSL.  Then I attemped a firmware update with MSP430Flasher:

Sin2-001

More success!!! I should have tried this in first place…

Anyway, I tested the programmer with the old and beloved “blink” and It’s working. I still need to test the UART interface but this should work as well.

output_sBDOeU

Posted in diy, Electronics, English, MSP430, Uncategorized | Tagged , , | Leave a comment

Avalanche pulse generator- part 2

I build a more permanent version of the pulse generator with some changes. The comparator wasn’t working very well with the 1V reference I was using. I made some measurements with different voltage references and got this:

Vref Vfeedback Vout(measured) (R2/R1+1) Vout(calculated) Error[%]
0,282 1,1 76,8 69,03 19,47 -294,5
0,759 1,087 76,6 69,03 52,39 -46,2
0,953 1,092 77 69,03 65,78 -17,0
1,218 1,258 88,7 69,03 84,08 -5,5
1,243 1,283 90,3 69,03 85,80 -5,2
1,499 1,505 106,3 69,03 103,47 -2,7

The feedback loop was working and the converter regulating but the output value didn’t correspond to the one set it with the feedbacks resistors. The difference between the reference voltage (Vref) and feedback voltage (Vfeedback) is lower with a reference above 1,2V (another source of error is the lack of precision resistors in the feedback divider). and increasing the reference value gives a lower error (difference between the measured and the calculated Vout).  At the end I just put a potentiometer to regulate the reference and tweaked until the converter output was near 90[V].

I started with the oscillator

Multivibrator

Then added the step-up

step up added

And test it

testing the step up

Added the voltage doubler

voltage doubler added

… and test it again…

voltage doubler test

I made a mistake while connecting the oscillator to the step-up. I soldered a cable to the wrong output and was using the inverted signal with a short ON time and a longer OFF time. After changing the output the voltage increased a bit, but  not that much (something like 115[V]). Then soldered in the reference and the comparator.

comparator

Then I connected all together, put the resistor divider to get the voltage feedback and set it to 80V

dc-dc converter set it to 80[V]

Finally soldered the transistor, 50 ohm termination and BNC

Avalanche pulse generator

The board with the different blocks labeled,

Avalanche pulse generator

and finally made some measurements.

Avalanche pulse generator

The formula to calculate the bandwidth based on the rise time is BW=0.35 / rise time [ns], I measured somewhere near 2.5 [ns], but that is a bandwidth of 140 MHz. That’s a lot higher from what I was expecting (I have a DS1052E without the bandwidth hack, so it’s 50Mhz). I’m probably doing something wrong but I don’t know what…

Posted in diy, Electronics, English | 5 Comments