ATTiny Programmer

This Arduino Nano based programmer board allows ATtiny 25/45/85 processors to be flashed with your custom code.

When I started trying to programme the ATtiny85 chips I bought several cheap USB programmer boards from eBay, Amazon etc but I couldn't get any of them to work. I eventually put an Arduino Nano based version together on a breadboard, from instructions I found on the internet, and was finally able to program my ATtiny.

Rather than have everything lashed together on a breadboard I created this simple PCB to give me a permanent setup, and added the facility to connect a programming clip to allow chips to be programmed in-situ.

 

More details, along with the Gerber files for the PCB, the Arduino Nano code and instructions on how to use the programmer are on  my GitHub site...

https://github.com/Peterkn2001/ATtiny-Programmer

Read more »

Hardware Watchdog for the Wemos D1 Mini

This hardware watchdog, in the Wemos D1 Mini/Pro form factor, will reboot your Wemos if it stops responding.

The watchdog listens for a regular "heartbeat" pulse send from the Wemos and if these pulses stop then the watchdog automatically reboots the Wemos.

The brains of the watchdog is an ATtiny85 processor and the PCB allows for two different start-up and heartbeat delays to be selected without altering the ATtiny code, and also allows the users to select which pin will be monitored for the heartbeat pulse.

 

More details, along with the Gerber files for the PCB, the ATtiny code and sample sketches for the Wemos are on my GitHub site...

https://github.com/Peterkn2001/Wemos-D1-Mini-Hardware-Watchdog

Read more »

Migrating from SPIFFS to LittleFS

I have an RFID door entry system built around a D1 Mini Pro that uses SPIFFS to store details of RFID tags assigned to the system and whether they are currently enabled.

I was doing some work on the software recently, and was getting tired of the SPIFFS deprecated messages in the compiler, so I thought I'd take a look at exactly how much work was going to be needed to migrate to LittleFS. I'd looked at this before, but I'd found that I was quickly getting sucked-in to discussions about system overhead larger file sizes so didn't take it any further.

 

So today I had a look at the ESP8266 core documentation here:

https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html

and looked through the SPIFFS commands and methods that I'd used in my project.

It looked like it might be pretty straightforward, so I made a copy of my project, replaced <#include "FS.h"> with <#include "LittleFS.h"> and did a find/replace of "SPIFFS" with "LittleFS", hit the "Verify/Compile" button and sat back - fully expecting the compiler to throw-up dozens of compilation messages and warnings.

But WOW! - the code just compiled, and what's more when I uploaded it it just worked!

 

Unsurprisingly, given what I'd read about the different file strictures, LittleFS couldn't read the existing SPIFFS file that was on the Wemos, but formatting the file system, re-creating the file and re-populating it (all of which is done via Node-Red flows sending commands to the Wemos) was all I needed to do to get everything back to how it was.

In less than 15 minutes I'd migrated from SPIFFS to LittleFS. If I'd know it was going to e that easy I'd have done it months ago.

 

My system doesn't do a lot of intensive reading and writing with the file system, but  the small number of read-write operations that are done are noticeably quicker with LittleFS.

Read more »

Is my RGBW LED strip colour blind?

I currently have a display cabinet that uses some RGB LED strips for lighting. Some of the old LEDs are starting to fail, and I also wanted a bit of additional light output, so its time for an upgrade. As the current LEDs are primarily used to simulate a warm white lighting, I thought I'd replace the existing RGB strip with some RGBW strip that has warm white LEDs in addition to the regular RGB LEDs.

So, I ordered some from a local (UK) supplier on eBay, along with the Shelly RGBW2 controller and some connectors, patch leads etc. I re-flashed the Shelly controller with my own firmware, and proceeded to do some testing - which is when things started to go wrong.

The blue and warm white LEDs were working as expected, but the red and green channels were inverted. Of course, the first thing I suspected was that I'd made a simple mistake in my new firmware, and accidentally swapped my red and green GPIO pins. After an hour or so of head scratching and getting nowhere, I was at the stage of checking the physical connections to the LED strip, and using a meter to check that the red and green coloured wires feeding the LED strip were actually connected to the pads along the strip that are  labelled R and G, and it all checked-out.

Eventually I powered-up my bench power supply,  set it to 12v and injected power directly into the pads on the LED strip. Sure enough, the red and green LEDs have somehow been transposed!

I don't know if this is a manufacturing issue where the LEDs have placed on the strip in the wrong orientation, or whether it's simply a case of the person who designed the circuit being red/green colour-blind 🙂

 

I'd ordered three of these 5 metre long strips, and they all have the same problem. As it's easy enough to fix, either by changing my custom firmware to transpose the red and green channels or by swapping them over in the wiring between the controller and the strips, I've decided to keep the LED strips. I have messaged the eBay seller to alert them to the problem though, but haven't heard back yet.

 

In hindsight, I guess I should have been suspicious of the eBay listing anyway, as it shows an RGB strip displaying different colours for each LED, which isn't possible unless you use a much more expensive strip with individually addressable LEDs, and that's not what was being advertised in the listing.

Read more »

As simple as it gets

Welcome to the first post in my new blog.

I've just had a delivery of circuit boards from JLCPCB and I thought I'd start the blog off by talking about the simplest of those boards. It's designed to help me flash the excellent Shelly RGBW2 controller

It might seem like a bit of an overkill to design a PCB just to enable an FTDI adapter to be connected to the programming port on the RGBW2, but the problem is that the port uses 1.27mm pitch pins (0.05") instead of the more usual 2.54mm (0.1") pitch. This means that the pins are very small and close together, so even if you make-up a custom lead to allow you to connect your FTDI programmer it's still very fiddly.

As I planned to flash a few of these devices, and as I was ordering some other PCBs from JLCPCB I designed this board and added it to my order.

The first image shows the 3D design in EasyEDA, and the other images show both sides of the assembled board and how it fits onto the RGBW2 controller with the FTDI attached.

As I said, it's as simple as it gets, but it's now really easy to flash your own code to these devices.

The button is used to pull GPIO0 to GND, to put the Shelly device into programming mode, so its simply a case of inserting the pins into the device then pressing the button and connecting the USB cable. The button can then be released, and the new sketch uploaded.

 

If you'd like to use the gerber files for this so that you can order your own PCBs then you can download them from here 

 

For reference, here are the GPIO's used by the RGBW2:

 

Read more »

Create Your Own Website With Webador