Archive for the ‘Uncategorized’ Category.

ESP8266 – esp1 PCB scans

There are some partial layout images for the esp1 but they seem incomplete. I wanted to make sure I knew exactly what was going on with this layout and as they’re so cheap decided to pull the components off a board and scan it. Actually a little pointless, as I was wondering if there was a trace snaking under the chip, but nope! Anyway, for reference, here are the scan images:

esp1_1

esp1_2

esp1_pcb

This is a continuation of my notes on the esp8266 microcontroller, you can find a complete list of my esp8266 posts here

Portable electronics toolkit

When I’m working on site I generally carry a small electronics toolkit with me. This is my current kit. I’m mostly using Hozan and Hakko tools.

kit

While these are really great tools, they are a little expensive (about 20USD for the sidecutters). I’d like to put a bunch of these kits together using cheaper alternate tools. The important points for me are:

Side Cutters

hozanN34

A nice flat edge is probably the most important point.

Wire strippers

P967

The P967s go from 18 to 28AWG solid core, or 20 to 30 stranded. I much prefer these fixed wire cutters to self adjusting tools, they never seem to work very well.

Loupe

A loupe is pretty important for inspecting small parts, or reading codes off SMD packages. Mine is x8 and x10 which seems fine. I’d like to find one that was a little better this has significant chromatic aberration. The triplet loupes seem better.

Soldering Iron

I use an Hakko FX888 on my bench, and an FX600 in my kit. The FX600 is actually a little bulky and I don’t always carry it, but it uses the same tips as th FX888 (and a bunch of other Hakko compatible irons) so you can use nice high quality tips with it.

Tweezers

Tweezers are a whole world unto themselves. I don’t feel qualified to write in detail about tweezers here. The image below shows a selection:

tweezers

The top set are labeled “Rhino Switzerland Standard SW-11”, they are cheap Shenzhen specials. But they’re pretty good, I think they cost about 1USD. At the ultralow end there’s a huge variation in quality. You’ll need to shop around, but these are reasonable everyday tweezers particularly if you don’t want to worry about being too careful with them. They’re fine for general work, placing SMD components etc.

Below that we have idealtek 2AMZ.SA ceramic tip tweezers. Ceramic tips are nice, they can withstand high temperature without warping and don’t conduct heat too well. These tweezers have a huge tip, they’re good for picking up larger components connected to a ground plain.

The next 2 tweezers are Rubis TNFs. Rubis generally manufacture tweezers for the cosmetics industry! But I think these are aimed more at the engineering/manufacturing market and they seem to have gained a following here in Japan. The “TNF” means Titanium. As such they are able withstand very high temperatures, and come to a fine point (unlike the ceramic tips). The slim line TNF tweezers (SS-TNF) are my current favorite.

The Hozan P-89s are nothing special. These are inverted tweezers which can be used for holding wires in place etc. Handy to carry around to help you clamp something in place while soldering.

Other tools

The wire is pretty standard wirewrap and hookup wire. Calipers are handy. The Pilers are unserrated and used to bending component legs etc.. Solder is 60/40 fine gauge (0.35mm I think), I should also keep some larger gauge for through hole stuff. Solder braid is pretty standard, as is the Flux pen.

kit2

kit3

kit4

Ultra-cheap Chinese Microcontrollers

I’m heading to Shenzhen and one of the things I want to take a look at is the ultra-cheap MCUs that are available in the Chinese ecosystem. Ultimately I’d like to see what the cheapest part available is, and how much a reel would cost. This post documents the parts I’ve seen on taobao. I was surprised not to see anything from General Plus as I’ve seen them crop up in designs before but perhaps they just don’t make it to taobao. If you have any recommendations let me know.

MDT10P53

mdt10p53

Chinese language datasheet: 48576_MDT10P53

4Mhz Internal RC osc. Up to 20Mhz external. 1K EPROM, 41 byte of SRAM. Doesn’t appear to have an ADC.

Listed as “fully compatible microcontroller PIC12F508/PIC12F509”. The datasheet contains the full instruction set which I’ve not checked is identical to a PIC12, they may only mean pinout/signal levels. Listed at 0.7CNY, which at the time of writing is 11 cents on taobao. Further searching shows some sellers down at 0.1CNY (1 cent!) no idea how reliable those guys are.

HT46R005

English datasheet: HT46R005

512bytes OTP program memory. 32bytes RAM. 3channel 12bit ADCs. Up to 16Mhz operation.

0.85CNY on taobao (13 cents).

HT48R005

Identical to the HT46 above (same datasheet), but lacks ADCs.

0.8CNY on taobao (12 cents).

These are OTP parts and the HT66F03 and HT68F03 appear to be their flash equivalents. Available for about 20 cents (further searching shows them down to about 0.5CNY, 8cents).

HT66F03 Datasheet: ht6xf0xv160

HT46R064B

ht46r064b

English language datasheet: ht46r06xbv110

Up to 12Mhz, 8 12bit ADCs. 64B has 1K flash, 64bytes of SRAM. Series has up to 4K flash, 128bytes of SRAM.

HT68F03C

ht68f03c

Chinese language datasheet: sim6xF0xC
ha0075sV110

4->20Mhz I think there’s an internal RC but it’s unclear. 1->2K of 14bit word (I guess code) flash. 64 to 96bytes of SRAM. Seen for 1.2CNY (about 20 cents) on taobao.

STC15L104E

stc15f104

An 8051! Internal RC OSC. Rated upto 35Mhz (RC goes to 33), 128bytes RAM, upto 6K of flash. Doesn’t appear to have ADC, can’t locate a complete datasheet.

1.48CNY on taobao (24 cents). And here for 0.9CNY (14 cents).

HT66F017

ht66f017

Available for 1.7CNY on tabobao (27 cents).

100+ page datasheet here: ht6xF016_017v120

PIC12F675

Possibly real PIC12s for 2.3CNY (about 36 cents) on taobao. 2K flash, 128bytes EEPROM, 64 bytes SRAM. 4Channel 10bit ADCs.

Some simple Arduino code to read from a keypad

arduino_keypad

Wired up a cheap keypad to an Arduino. These keypads were a few cents each on ebay and look suitable for a project I’m working on. This is the same keypad as used here and their code is worth referring to.

The following reads presses from the keypad and prints them over serial. It only returns a valid keypress when a different key is pressed, not when the key is held down.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#define rows 4
#define cols 4
 
const char keymap[rows][cols] = {
    { 1, 2, 3, 10 } ,
    { 4, 5, 6, 11 } ,
    { 7, 8, 9, 12 } ,
    {13, 0,14, 15 }
};
 
const int row_pins[rows] = { 2, 3, 4, 5 };
const int col_pins[cols] = { 6, 7, 8, 9 };
 
void setup() {
  Serial.begin(9600);
 
  for (int r=0;r<rows;r++) {
    pinMode(row_pins[r],INPUT);
    digitalWrite(row_pins[r],HIGH);
  }
 
  for (int c=0;c<cols;c++) {
    pinMode(col_pins[c],OUTPUT);
    digitalWrite(col_pins[c],HIGH);
  }
}
 
int get_key() {
  int key=-1;
  for(int c=0;c<cols;c++) {
    digitalWrite(col_pins[c],LOW);
    for(int r=0;r<rows;r++) {
      if(digitalRead(row_pins[r]) == LOW) {
        key = keymap[r][c];
        digitalWrite(col_pins[c],HIGH);
        return key;
      }
    }
    digitalWrite(col_pins[c],HIGH);
  }
  return key;
}
 
int last_key=0;
 
int get_key_db() {
  int k1 = get_key();
  delay(10);
  int k2 = get_key();
 
  if((k1 == k2) && (k2 != last_key)) {last_key=k2; return k2;}
          else return -1;
}
 
void loop() {
  int key = get_key_db();
  if(key != -1) {
    Serial.print("key: ");
    Serial.print(key);
    Serial.print("\n");
  }
}