Saturday, 23 January 2021

3D Print connector for Spike and inovator

DIY connector for Lego spike and inventor

Step 1:Print plug

Thingverse link

Step 2: Use 0.6 mm single wire and push them through the holes.
Step 3: hot glue wires from the  back, so they stay in place

Step 4: you can add some instant glue below wires if you wish, but that's not 100% necessary.

Step 5: Then cut wires. In real plug ground should be longer than others.

See more info about connector at HERE

Friday, 22 January 2021

Thermal printer to Lego Spike and inventor

I'm starting posts again after few year break. This post is about connecting thermal printer to new lego mindstorms series.
First of all i printed my own connector
I will make another post about connector
Printer has i't own 9 volt battery, because i don't know if lego can provide enough current for printer.
Then i connected ground and data lines to printers serial port.
Code is simple in python

Printer i used was this Link to Aliexpress

Sunday, 1 April 2018

Cheap LCD 16x2 characters, with I2C LCD1062 interface

(No title here)

This ~2$ module is easy to use. It uses only 2 data pins, but refresh rate seems quite low. It takes quite a long to update screen. There are same displays modules without I2C interface board, but they use more pins from your board.

Hardware setup

For wemos mini d1
SLC -> D1
SDA -> D2
VCC -> 5V

After you have connected module and have software ready,
you have to turn potentiometer until you can see characters.

Software setup

Needed libraries / software
There are 2 libraries, that have almost same name
I have used the first one.

Code example


Thursday, 15 February 2018

Wemos Matrix LED Shield, Wemos Full Color RGB Shield (WS2812B), 4-Digit 7-segments LED Display Tube

In this post I will introduce 3 led based displays.

Matrix led shield for Wemos Mini D1

Hardware setup

This shield uses two data pins
D5 = CLK
D7 = DIN

It has 8x8=64 red led

From code you can light any led with x and y coordinates, and set brightness with 8 steps.

Software setup

You will need library from Wemos. That is not in Arduino library manager so you have to download it from Git
For information on installing libraries, see:

Code example

In this example leds go out and with every line they go brighter.


RGB led Shield for Wemos Mini D1

With this shield you can generate  16777216 different colors.

Hardware setup

It needs 5v and D2 as data line.

Software setup

You need to install Neopixel library
or from Library manager
For information on installing libraries, see:

Code example


4-Digit 7-segments LED Display Tube

There are different versions where is Clock dots, or decimal dots.
In this example i have clock version.

Hardware setup

This Module uses two data pins
D6 = CLK
D5 = DIO

Works both 3.3V and 5.0V

Software setup

There might be several libraries that works with this module, but i have used this simple library
For information on installing libraries, see:

Code example

In this example:
- Show number with and without leading zeros
- Show Time
- Show brightness setting (8 levels)
- Show setting individual segments, and all possible combinations (128 pcs.).


Monday, 12 February 2018

128X64 0.96" OLED Dsiplay (Monochrome)


I have chosen board with I2C interface because it takes only 2 data lines.
You can see the difference from number of pins I2C has 4 and SPI has 7
So what is advantages for SPI, because it has more data lines?
It should be faster, but if you are not going to show videos, it's not worth it (Personal opinion)

Price <3$
3.3V Data Lines
Driver: SSD1306
Interface IIC(I2C)

You can get one from here.

Some models might be 5V compatible, but you have to check specs for that. I have run mine with 3.3V

From this display I have seen two variations, one color, and two colors, where top part of screen is different color. Down side on this is that there is noticeable black line between colors.

On my board there where printed wrong I2C address, but you can use this I2C scanner to detect your address.

Hardware setup

VCC -> 3.3V
SDA -> D2 (Wemos D1 Mini)
SCL -> D1 (Wemos D1 Mini)

Software setup

For this display you need two libraries.

You need to check from...\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.h

Change your I2C address and check that  SSD1306_128_64 Size is not commented.

Code Example

- -


You can create bitmaps with this tool

Rest of the graphics commands can be found from this page.

Remember to check examples that came with adafruit-graphics library!

Adafruit demo

Cheap display keyboard TM1638

TM1638 led&key

With this module you will get buttons and numeric display in one package.
8 led, 8 7-segment numbers and 8 buttons using only 3 data lines and less than 2$.

You can get one from Here.

Hardware setup

For demo you have to connect following pins
DIO GPIO4 (Wemos D2)
CLK GPIO14 (Wemos D5)
STB GPIO12 (Wemos D6)
VCC +5v

Software setup

There are few Arduino libraries that you can use.
This library has most starts in Github, and I will show example about it.
For information on installing libraries, see:

Library has one bug open, that you should take in to account.
setDisplayToDecNumber should display "0"

If you get error like:

TM16XX.cpp:44:66: error: no matching function for call to 'min(int, byte&)'

You need to add these lines to beginning of file c:\Users\myname\Documents\Arduino\libraries\tm1638-library-master\TM16XX.h
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
More info at:
Path to Arduino libraries can be something else, you can see your path, from menu File -> Preferences -> Sketchbook location


First is example how you can define place of dot.
Next is shown how this library shows alphabets. I think this library and display is not good for showing text.
In the end I will show how to check what buttons are pressed and how to light led on top of module.