Author Archives: Xose Pérez

About Xose Pérez

I've spent half my life working with computers creating virtual products, now I've moved to the physical part of it, much more fun!

naked-esp12

EEPROM Rotation for ESP8266 and ESP32

The Arduino Core for ESP8266 and ESP32 uses one SPI flash memory sector to emulate an EEPROM. When you initialize the EEPROM object (calling begin) it reads the contents of the sector into a memory buffer. Reading a writing is done over that in-memory buffer. Whenever you call commit it write the contents back to the flash sector.

Due to the nature of this flash memory (NOR) a full sector erase must be done prior to write any new data. If a power failure (intended or not) happens during this process the sector data is lost.

Also, writing data to a NOR memory can be done byte by byte but only to change a 1 to a 0. The only way to turn 0s to 1s is to perform a sector erase which turns all memory positions in that sector to 1. But sector erasing must be done in full sectors, thus wearing out the flash memory faster.

How can we overcome these problems?

Continue reading

p1240886s

Sonoff S31, a world apart

It’s not that other Sonoff products are not “serious” business, but there are a number of design changes in the Sonoff S31 that make this new product a world apart. For the functional point of view it looks like a S20 with POW-powers, but they have redesigned the product completely. The result is very very interesting.

  • Revamped case, more compact and sturdy
  • Redesigned PCB, actually 2 different PCBs for main and control
  • Different power monitor chip: the CSE7766 (same as in the new POW R2) replaces the HLW8012

The only drawback: it’s only compatible with plug types A & B, tat is central and north-america and few other countries. I’d love to see a S31-EU schuko version!

You can buy the S31 from Itead (see link above) or via the usual marketplaces. Actually the S31 is slightly cheaper [Ebay] on some of them.

Continue reading

20180315_141353s

GeekWorm Power Pack Hat Hack

Sorry for the tongue twister 😉

I’ve been somewhat busy lately and it’s been a long time since my last post. I have a few projects on the go but not much time to sit down and write about them… Let’s see if this one goes through…

I’ve been lately looking for a reliable UPS system for Raspberry Pi 3. I moved my home server to a RPi a few months ago and even thou its behind an ACS UPS a couple of other projects involving RPis required mobility (one of them) and unassisted power backup (the other). So I started browsing several marketplaces looking for a solution.

Continue reading

20180130_012920s

Arduino MKR WAN 1300

I’ve been testing quite a few LoRaWan nodes lately for TheThingsNetwork.cat, some based on HopeRF RFM95W (over AVR, ESP8266, ESP32,…) others using Microchip’s RN2483 (an old friend of mine). I have a RAK811 waiting in the INBOX but the last one I’ve been playing with has been the new Arduino MKRWAN 1300 (so new there is no product page yet) and I liked it, quite a lot.

Continue reading

20171112_185649s

PCB fabs

A few years ago (not many) I used to burn copper plates using acetic acid, a.k.a. vinegar. I was somewhat concerned about using stronger acids so it was OK to use another acid, even if it was soooo sloooow. If you were patient you could get to have decent boards using 50mil traces (or even thinner). But it required keeping a good temperature on the copper bath and regulating the ratio vinegar/hydrogen peroxide continuously, adding a little salt from time to time to speed things up.

The etchant biting the copper

The vinegar biting the copper

One day I saw an article about cheap Chinese PCB fabs (I think it was DirtyPCB by Dangerous Prototypes) and I decided to design my own board and send it to fab. I used Eagle (I still use it although I’m learning KICAD) and the learning process was significant. But at the end I managed to get something. I learned to use copper pours, to correctly label the board, to create my own parts, to avoid auto-route, to use design rules and create gerbers,…

20171112_185919s

And over time I have tested different fabs. I’m not an expert by any means but I wanted to write a bit about them here. The basic order I usually do is a 10 units, under 50x50mm board, 1.6mm thick, 1oz copper and HASL Lead Free due to RoHS rules in the EU. The prices and options below are based on these settings.

One more thing. I reckon these suppliers are good enough in most cases for small batches, testing boards or DIY projects. Some EE are concerned about the quality of the boards and they prefer EU-based (or US-based) fabs. I cannot offer a good reason to use these manufacturers here or to not use them in professional/industrial projects.

Continue reading