Lipo Charge/Boost/Protect board in 18650 cell holder format


Disclaimer:  The circuit in use here came from GreatScott: YouTube video related to this project:
Thanks for the circuit GreatScott, it really works well!  The awesome find of the lipo protection chip with 2.9v cutoff – ruined way too many cells with the DW01’s 2.5v!

So, down to business:  We all know the frustration of trying to run portable electronics, whether handheld Pi’s or trying to use a cheap reverse-lcd as an extra cheap DSLR Monitor (My primary use case for making these – the one linked runs off 5v input too, perfect for Pi projects etc too) from Lithium cells:

  • You need to provide a charger circuit to safely charge using the correct CC/CV charge cycle
  • The cell needs to be protected against shorts, overcharge, overdischarge, etc
  • Boost the voltage to (usually) 5v – most widgets work with at least 5v or up.

In the past I used to use Protected Lithium Cells (Way more $$$ than salvaged or unprotected cells) and stick in both a MT3608 Boost Circuit and a TP4056 charger circuit.   Bulky, but it did the job (most of the time). Later on, China started adding protection circuits on the TP4056 boards. But the circuit was based around the DW01 protection IC which only cuts off the cell at 2.5v discharged level.   Not good for the life of your cells ):

So couple months ago, GreatScott made a video where he designed a circuit.  Nothing too innovative, just the same TP4056 charger the MT3608 Boost combined on one PCB.  He did add a Lipo protection circuit though, initially using the same DW01.  But then, the Aha moment from this video, he found a footprint compatible IC the FS312F-G – which is set at 2.9v! Way healthier for your cell’s longevity!

First of all I had to redraw all his work in Eagle (As I wont be using a cloud based service like EasyEDA for obvious reasons) and then order the PCBs. I added two boost circuits since I had the board space, as I can imagine needing dual voltages at some point (for example if that reverse LCD needed 12v and the Pi needed 5v – i could run both off one board.

I decided to make the form factor fit onto these nice 18650 cell holders, as around here 18650s can be had for free from salvaged laptop batteries quite easily.

Here’s the Eagle files:  Feel free to go make your own!




Raspbian Jessie as OpenHAB + MQTT Server: Part 3: Add Websockets

Nowhere near completely usable, BUT, what IS working so far:

  • Websocket javascript with Paho library subscribes succesfully to the Websocket listener on Mosquitto
  • I can subscribe, and recieve all the published messages on the HAB
  • I am using the data received, to dynamically, and automatically, build up a device tree – it looks at the topic path (remember how a year a ago I wrote a post about why the topic name is important (; – here you see why – from the topic names i can deduce the entire hierarchy automatically)
  • Clicking any item in the tree brings ip a CONTROL interface – to be extended with sensorvalues, etc
  • The basic concept here is working great – by setting my devices to announce themselves, or response to a broadcast requesting them to announce themselves, I can cut a LOT of configuration out – theoretically I can have a new device connect to MQTT, send the page its name, location, connected devices, what those devices are (switch, dimmer, sensor, or actuator) and the javascript can automagically make a UI for it. This means you can mostly get away without a server, without a database.

Source being shared here:



Check out my collection on Google Plus: for more details!


16 - 1 (1)

ESP8266 With PIR and DHT11

 Basic ESP8266 MQTT example

 This sketch demonstrates the capabilities of the pubsub library in combination
 with the ESP8266 board/library.
 It connects to an MQTT server then:
  - publishes "hello world" to the topic "outTopic" every two seconds
  - subscribes to the topic "inTopic", printing out any messages
    it receives. NB - it assumes the received payloads are strings not binary
  - If the first character of the topic "inTopic" is an 1, switch ON the ESP Led,
    else switch it off

 It will reconnect to the server if the connection is lost using a blocking
 reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to
 achieve the same result without blocking the main loop.

 To install the ESP8266 board, (using Arduino 1.6.4+):
  - Add the following 3rd party board manager under "File -> Preferences -> Additional Boards Manager URLs":
  - Open the "Tools -> Board -> Board Manager" and click install for the ESP8266"
  - Select your ESP8266 in "Tools -> Board"


#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "DHT.h"

#define DHTPIN 13     // what digital pin we're connected to
// Uncomment whatever type you're using!
#define DHTTYPE DHT11   // DHT 11
//#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

// Update these with values suitable for your network.

const char* ssid = "openhardwarecoza";
const char* password = "novell1234";
const char* mqtt_server = "";
int counter = 0;
int previousReading = LOW;

WiFiClient espClient;
PubSubClient client(espClient);
long lastMsg = 0;
char msg[50];
int value = 0;

void setup_wifi() {

  // We start by connecting to a WiFi network18
  Serial.print("Connecting to ");

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {

  Serial.println("WiFi connected");
  Serial.println("IP address: ");

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print("] ");
  for (int i = 0; i < length; i++) {

  // Switch on the LED if an 1 was received as first character
  if ((char)payload[0] == '1') {
    digitalWrite(BUILTIN_LED, LOW);   // Turn the LED on (Note that LOW is the voltage level
    // but actually the LED is on; this is because
    // it is acive low on the ESP-01)
  } else {
    digitalWrite(BUILTIN_LED, HIGH);  // Turn the LED off by making the voltage HIGH


void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect("ESP8266Client")) {
      // Once connected, publish an announcement...
      client.publish("outTopic", "hello world");
      // ... and resubscribe
    } else {
      Serial.print("failed, rc=");
      Serial.println(" try again in 5 seconds");
      // Wait 5 seconds before retrying

void setup() {
  pinMode(BUILTIN_LED, OUTPUT);     // Initialize the BUILTIN_LED pin as an output
  client.setServer(mqtt_server, 1883);
  pinMode(12, INPUT);

void loop() {

    if (!client.connected()) {

    long now = millis();
    if (now - lastMsg > 5000) {
      lastMsg = now;
      float h = dht.readHumidity();
      // Read temperature as Celsius (the default)
      float t = dht.readTemperature();
      // Check if any reads failed and exit early (to try again).
      if (isnan(h) || isnan(t)) {
        Serial.println("Failed to read from DHT sensor!");
      // Compute heat index in Celsius (isFahreheit = false)
      //float hic = dht.computeHeatIndex(t, h, false);
      char t2[50];
      char h2[50];
      dtostrf(t, 5, 2, t2);
      dtostrf(h, 5, 2, h2);
      client.publish("/sensor/temp", t2 );  
      client.publish("/sensor/humidity", h2 );

    int reading = digitalRead(12);

    if (previousReading == LOW && reading == HIGH) {
    client.publish("/sensor/movement", "Motion!");  

    previousReading = reading;


Laserweb was featured on!

Go read the full article on



Free designs for a folded metal CNC and 3D printer!

In 2014 I designed a folded metal 3D printer, and with collaboration with Waleed Kahn, we also designed a folded metal CNC machine

The designs have been sitting in Github since I closed the shop in Dec 2014, and it’s just sad to see two such really cool machine designs just sitting around.

So if you have (or have access to) a sheetmetal factory anywhere in the world, and you would like to sell these, you have my blessings and support! If you get rich off it, do remember to buy me some beer though!



Sources are on Github:


Babybot 3D Printer: in 2015 – a Review

I have never been a good blogger.  For me, firing up the PC, logging into wordpress and banging out a post is a LOT more work that just quickly posting on one of the social networks.

That said, 2015 was still a pretty good year statistically:

Some highlights:

  • 62451 views from 22482 visitors
  • almost 1/6th coming from the USA (with my own country coming in at 4th place – shame on you! lol)
  • I had one of my projects featured on and that referred me a whopping 5164 visits
  • The OpenHAB projects, being in tutorial format, seems to have brought in the largest readership! Lets see in 2016 where I expect most of my posts will be about lasers, CNCs and OpenBuilds!

Open source hardware: Why not Open Stats too:  Here’s my WordPress stats:



On Google Plus I think I did marginally better:

  • Almost doubled my number of followers
  • Became Moderator for the following Google Plus Communities:
    • OpenBuilds: with 795 Members at the time of writing
    • 3D Printing: with 227,220 Members at the time of writing
  • Clocked in over 2.5 Million views on my Google Plus profile!  Quite proud of that..
  • google plus

Facebook Pages

Pretty much gave up on Facebook this year, I did gain around 100 followers during 2015 (now at 846 total) but I nowadays rarely post on there… I just find my other audiences more engaging to work with


Only 33 followers – but worth checking out – thats where ALL the open source work I do, ends up! Tonnes of gold in those – from PCBs to a complete open source CNCs (folded metal design), 3D Printers, etc live.  You guys could be selling those and then sending me some beer!