Tuesday, November 24, 2015

UNI-T UT61E Backlight

This is a backlight mod for the UNI-T UT61E based almost entirely on [Nisei]'s tutorial. It consists of a touch sensor board (without sensor pad) and a backlight board. I had intended on using an Atmel dedicated Qtouch IC but it's current draw was a lot higher than the TonTek version. I also intend on using the touch sensor board for other projects.

Backlight Board

The area where I wanted to put my backlight board into was measured and 3D modeled in SolidWorks.


Finalized backlight board layout. It's reversible if the light transmits better. R2 is a dummy to prevent teeter-tottering when flipped over. Solder pads either side for convenient wiring.


Here's a somewhat 1:1-ish layout.



And here's the board sitting pretty in it's new home.

Touch Board

Here's the near finalized layout for the touch board. I wanted this small and low power and usable for other things besides backlighting a meter. A resistor is inline with the transistor's output so that I can directly wire LED's or whatever to this design for a future project.









And a handy schematic ...



And here's the actual thing.




BOM (completely unofficial)

  1. TonTek TTP-223-BA6 ... touch sensor IC
  2. MCP1703 (5V) ... voltage regulator
  3. MMBT3904-7-F ... trusty NPN transistor
  4. LTST-S220KGKT ... teeny weeny side emitting green LED
  5. These green 3mm LED's worked much better.

To-Do's

  1. Experiment with touch sensor pad size.
  2. Install pad.

To-Done's

  1. 3d model bklt location
  2. general component selection for brds
  3. layout of touch brd
  4. layout of bklt brd
  5. checked fit of 1:1 bklt brd paper cutout in meter
  6. ordered bklt brd
  7. order LED's for testing
    1. LTST-S220KGKT
  8. order components ... oops, too soon.
  9. finalize touch brd layout
  10. order touch brd
  11. Assemble and test bklt brd
  12. Assemble and test touch brd

Sunday, November 22, 2015

UNI-T UT61E Auto Power Off

This is a near-direct copy of Mr. Herbert's mod that can be found here. On the meter side, it's just a little pcb (.45x.25 in) that can be adhered to the meter's board instead of gluing the phototransistor to the back case's window and running wires across free space.



The boards are from OSHPark and came in just over two weeks. I tested size 24 font and it came out great, very crisp and really small.



 


Tiny print.



Ready for testing.

The action continues ... in Part 2.

BOM

1x of LiteOn LTR-4206E phototransistor ... 3mm ... Digi-Key 160-1030-ND.
1x of 100k ohm resistor ... 0805 ... Digi-Key 311-100KCRCT-ND.

To-Do's


  1. mod serial cable
  2. test circuit
  3. make official BOM
  4. order 100k resistors
  5. fab
 



Wednesday, September 23, 2015

Arduino 12-bit PWM for Fading Smoothly

Working off GGE5's 12-bit PWM enabling code found here on the Arduino forums, I've been working to "multi-task" an ATmega328 so I can fade LED(s) smoothly while doing other stuff or interrupt a fade to change its direction. 4096 steps go a long way toward nice smooth fades, especially at the lower end of the range where the human can be a little more sensitive.

One thing I noticed is that if I used the analogWrite() command in conjunction with 12-bit PWM, I got an odd little blip or flash somewhere at the beginning of a fade up (fading from 0 to 4095).

However, if I set the PWM value by setting the output compare register OCR1A equal to the desired value (again fading from 0 to 4095) then the fade is uniform.

Well, analogWrite() is a convenient way to control the duty cycle of PWM capable pin. The convenience comes at the price of hiding some code behind the scenes. A look at the function within wiring_analog.c which can be found in hardware/arduino/cores/arduino/wiring_analog.c in your Arduino install, shows that in addition to setting the pin's output compare register, analogWrite() has a snippet of code as follows ...
else if (val == 255)
 {
  digitalWrite(pin, HIGH);
 }
Note - 'val' is the value you pass the analogWrite(), i.e. analogWrite(LED_Pin, val).

So my eyes weren't playing tricks on me. When my code was writing the PWM value 255 using analogWrite(), I was actually getting a digitalWrite(LED_Pin, HIGH) instead for a brief time.

So the lesson learned is when using a 12-bit PWM enabled pin, stick to writing directly to the register and avoid using the analogWrite() function. Or just skip the value 255 ;)