Using an inductive PNP Proximity Sensor with MKS Gen Printer Control Board

If you are into customizing or building 3D printers, you might be using an “MKS Gen” control board. I am building a HyperCube from Tech2C and I have chosen to use that card. Correctly installing a Z axis proximity sensor was a good learning process fo me, so I thought I share my experiences, it might be useful for others.

The idea of a standard mechanical end stop is, that a signal circuit is open (thus, is not giving a signal) until the print head would travel to one end of its route (determined by the physical dimensions of your printer). Which point it hits the mechanical switch and closes (triggers) the signal circuit. This signal then picked up by your control board and triggers certain functions, instructed by the board’s firmware.

You might want to use a metal detecting proximity sensor to replace the mechanical switch on the Z axis of your printer. There are several reasons to do that, one of which is the possibility to use it for the auto level function of your firmware (in my case that is Marlin). I have touched the subject of the available alternatives of a mechanical switch in one of my earlier posts.

One of the many alternatives of a metal detecting proximity sensor is the one named “LJ12A3-4-Z/BY”, which is quite imaginative if you think about it. This sensor is a PNP sensor. PNP stands for “positive-negative-positive”, that basically means that it is continuously giving voltage in a signal cable, if it is not close to metal and gives zero voltage when it is close. Our metal bit is, of course, the print bed.

That would be OK with most control boards (parameters have to be changed in Marlin), but the MKS Gen card’s hardware prevents the use of this type of sensor. As the device only cost about £3 ($4-$5), the obvious course of action would be to order a NPN type sensor (which would give logic “LOW” voltage while it is not triggered and logic “HIGH” voltage when it is triggered) and instal that with only a small modification.

The device requires a minimum 6VDC in order to function properly. The end stop socket on most Arduino based boards only provides 5V. However, it can be powered directly from the power supply, which gives 12V. In that case, the signal will be too strong to feed it back to the board. So you can either use a voltage divider or a diode to step down the strength of the signal.

A good explanation by Tech2C of that can be seen here:

Most “DIYers” like me, however likes the challenge (I guess), so instead of buying another one, I have spent at least half a day with building a simple circuit, using a 2N3904 transistor to reverse the signal, with the advantage of having that signal suitable to feed directly to the board.

Here is the story in pictures:

The first thing I have done is to check the sensor whether it works with only 5VDC supplied. I have used a separate power supply. The signal cable gives 5V back.
Triggering the sensor makes no difference, although the LED on the sensor is faintly lit up, we can be fairly sure it would not work with the board either.
Here, I supply the sensor with 12V and it is giving 12V back, thus the signal is “HIGH”
However, up on triggering the sensor, now gives a “LOW” signal, hence we know the sensor works with the appropriate supply voltage.

I am not going into details about the explanation of electronic principles about components, this is more of a guide how to get around of the PNP sensor problem. If you are interested more about the workings of transistors, etc, I will include a reference and recommended links list at the end of this post.

My aim is to reverse the signal pictured above and decrease its strength when it is logic “HIGH”. I need that it gives a “HIGH” signal when triggered and “LOW” signal when it is not.

Here is a simple circuit to build in order to do that. The idea comes from here, I have just draw the schematic in KiCad instead of using the quality hand drawing.

The humble 2N3904 transistor
This is the finished modification
Testing the sensor without triggering. It gives a logic “LOW” signal with 12VDC supplied.
The sensor is being triggered, it gives a logic “HIGH” signal through the transistor.
Modification is now protected from the elements.
It is installed on the printer. Note, only one wire (the signal) which is connected to the end stop socket, the power and ground is now connected directly to the power supply.
Tested. The sensor is not triggered, hence Marlin shows open on the Z axis
Sensor triggered (metal put close to the device) and Marlin shows the correct status.

And there you have it! The modification is successful, the sensor now ready to be used in my/ yours/ anyone’s set up.

References and recommended links: (I have no affiliation to anything here, just pointing towards things)

Buy a LJ12A3-4-Z/BY and have the opportunity to spend at least half a day solving a problem, which should not be a problem at the first place!

Read the Art of Electronics. It is the bible of all electronics books.

Read into electronics, but a bit more digestible way.

Build a HyperCube.

Buy a lot of 2N3904 transistor. You can use them to build interesting beginners electronic projects.

Zen3d – Run by a friend, read it if you want to know about DIY 3d printer building or if you want to learn Hungarian – good practice.

Write me an email, if you need help in anything in this post.

Basic 8 step sequencer – upgrade your Atari Punk Console

The sequencer is an (mostly) electronic device which triggers sounds in steps in a continuously repeating sequence. The origin of such a machine is dating back several hundreds of years, since music machines were constructed. The one which resembles most to the modern computer based sequencing softwares are the barrel organs which were using long sheet of paper for programming. The actual format basically is a paper based version of what DAWs (Digital Audio Workstation) are mostly using.

This sequencer is a so called analog sequencer, because, well, because it is using analog electronic components and two ICs. This is very similar to the first electronic sequencers, except they used much more components. In this, no microcontrollers or any sort of software programming involved. It is a very simple device, but like the Atari Punk Console, it makes an excellent learning project and it can nicely control the console.

8 step sequencer with Atari Punk Console

8 step sequencer with Atari Punk Console

The machine uses a CD4017 decade counter IC. It is a chip which can output 10 electronic signals on different pins, one after each other. However, we only going to use 8 steps as it is more practical musically. Many sequencers have 16 or 32 steps, it is possible to chain several CD4017 together, but I did not do that in this project. (Basically, there are much better and more sophisticated sequencer designs out there, it is more recommendable to use one of those if you are more serious).

The signals (steps) are generated by making one pin on the IC continuously high-low-high-low and so on by using a “clock” to do that for us. It can be achieved using different design clocks, but one of the simplest one is a 555 in astable mode.

8 step sequencer components

8 step sequencer components

That is the same as it was used in the console, so if you have built that, it is already familiar.

This circuit was designed by me, based on several other designs freely available on the internet.

8 step sequencer schematic

8 step sequencer schematic

Features of the sequencer:

  • Variable speed control: It can control the length of each step thus the speed of the cycle
  • On/Off switch for each step
  • Variable voltage on each step, to control tone of steps
  • CV out to connect it to the tone generator
  • Standard DC power socket (9V-12V)
  • LEDs for showing speed and each active step

I have designed a 3d printable box for it, which you are welcome to use.

8 step sequencer 3d printed box

8 step sequencer 3d printed box


8 step sequencer BOM

8 step sequencer BOM

  • LEDs (any color of your choice) – 9
  • 500K variable resistor (pots) – 9
  • 100K resistor – 1
  • 1K resistor – 3
  • 1N4148 diode – 17
  • SW-DPDT, on/off switch – 9
  • 0.01 uf ceramic capacitor – 2
  • 4,7 uf ceramic or electrolytic capacitor – 1
  • CV jack of your choice, I am using 7.5mm audio jacks (same as for guitars)
  • DC power outlet of your choice

8 step sequencer + Atari Punk Console + reverb

8 step sequencer + Atari Punk Console + reverb





Atari Punk console – the entry to Sound Synthesizers

btyAnd so than, I was hooked. My interest in electronics sparked (bad pun) again a couple years ago, when I bought an Arduino microcontroller out of interest, than I was introduced to 3d printers by a friend, than I have started to mess around with ICs and bought a 1000 books on the subject. All these eventually led me to be fascinated about electronic sound synthesizers. Why? Erm, “dunno”, I think it is pretty cool to make sounds out of pieces of electronic components.

One of my first projects was an Atari Punk console. The original design was published in a Radio Shack booklet, the “Engineer’s Notebook: Integrated Circuit Applications” in 1980 by Forrest Mims. He simple called it “Sound Synthesizer” or “Step Tone Generator”, but most popularly it is known as Atari Punk Console because the sounds it makes, resembles of the old Atari 2600 game console.


It is based on a very famous (in electronics anyway) IC chip, named “555”. In fact it is based on two 555 chips or alternatively one 556 (which is two 555 chips integrated together)

This little IC is around since the 1970`s and it is the current holder of the world record as the most numerous IC produced of all time.

The 555 is also called a “timer” or a “timing IC” as it can produce electronic signals in equal intervals. It produces a square wave (shaped) signal. The chip itself has 3 core set ups (monostable, astable, bistable) and it can be found in thousands of devices from toys to space crafts.

I will not going through in details how the IC is working, there are plenty of publications can be found online about that.


The IC is can produce a square wave shaped signal, which ultimately gives the distinctive sound it makes and which explains why it sounds like an old 8 bit game console.


In the basic Atari Punk Console, one chip is set up in “astable” mode and that drives an other 555 which set up in “monostable” mode. Alternatively, one 556 chip can be used too but the theory how the machine works is exactly the same.

Here is the schematic which I have designed, based on other DIY punk consoles can be found online. My version has 6 variable resistors (potmeters), four are which functions as filters using an other two 555s and you have the standard knobs for pitch and for tone.


Atari Punk COnsole

The box has an audio output. I am using 1/4 jack sockets, but you can use your own preference, like a 3.5mm or banana jacks. The audio socket can be replaced by something like an 8 ohm direct speaker, maybe with a simple little amplifier such one based on an LM386 Op-amp

There is a CV (control voltage) input, wired to an other 1/4 jack socket. I am using this with a DIY 8 step sequencer (I will make a post about it at some point).

As of power, it has a standard DC power socket for a 9V power supply and an on/off switch.


Variable resistors (pots)

  • 50k * 4
  • 500K * 2


  • 0.01uf * 3
  • 0.1uf * 1
  • 3.3uf * 2
  • 10uf * 1


  • 1K * 3


  • 555 * 4

You can find the .stl files for printing the box on my thingiverse profile.



One might asks, – What can you do with it? – Well, anything you want. It is possible to hook it up to a sequencer, a filter, VCV rack through a jack-usb cable, etc. In all honesty, it is obviously not the nicest sounding musical thing you can imagine, but nevertheless you can have some fun with it, it is a great learning process and relatively easy to build. Here you can see it is hooked up to a sequencer and a tacky old “Behringer Tweakalizer”, recording in Audacity through a laptop.



Here is a 2 minutes sample of some of the sounds this box can make on its own:




My 1st rite of passage to scratch build 3d printers

How one would start on building 3D printers without no prior knowledge about it? It is a massive subject for most and speaking from experience, it is difficult to make a choice where to start.

The first time I have ever encountered a 3d printer face to face, was through a very good friend of mine during some holiday in Hungary. He was already through a couple of self-made kits and was just building his first scratch made printer, a design which came from an Australian 3d printer enthusiast “tech2c”, called “Hypercube”.

This kind of 3d printing technology called, FDM (Fused Deposition Modelling or FFF (Fused Filament Fabrication) process. In simple terms, that means the printer is using a solid spool of plastic filament – like yarn in knitting – which is being deposited by the printer head, layer by layer, building the desired model up.

As I am luckily-unfortunately easily convinced about building interesting stuff, I was hooked on the subject quite quick.

The big question was, where to start!? In fact why would you even start to build one from scratch when you can just order a ready made one online which suits your needs.

To be honest this is an absolute superficial question regarding to most “crafting/ building” hobbies, whether that be model building or knitting. Basically, most people just does it for the process, for the joy of building and for the satisfaction of learning stuff. However, after a certain level, you actually can build an extremely capable printer for fraction of the money of an equivalent commercial one. Bare in mind though, this is not necessarily true to entry level printers and it is a long learning process with possibly significant(ish) investment along your journey.

There are number of options out there to start. You could jump right in to the deep end of it and pick one of the many available DIY printer designs from places like Thingiverse. Personally, I would not recommend that as, well,  firstly because you need a 3D printer to print many of the parts for it, secondly I believe you would need some knowledge about 3D printing to choose a design which would suit you.

I would say there are 2 (+2, I explain that shortly) reasonable routes are out there.

  1. Buy a reputable, ready made 3d printer, learn the general workings of it. Such as the process of 3D printing and different filament materials. With this option, you will know that you have a well made and working printer so you can concentrate your attention to the rest of the things without worrying about your machine. Good choice would be something like a readily assembled Prusa I3 or a LulzBot mini
  2. Buy a reputable DIY 3d printer kit. I would recommend this option to people whom have some knowledge of building anything (even if that was just LEGO) and willing to do a bit of research and thinking throughout the building process. The Prusa I3 DIY  kit or the Hephestos 2 are great options for that. These kits are tried and tested, good quality, have great support and development teams behind them
  3. (+1) Buy a Cheap Chinese kit or a ready made printer. Most of the 3D printer designs are open source designs, which means the ever resourceful Chinese manufacturers are producing their own versions of them with various success and quality. You have a wide range of DIY or ready made machines. Prices are varying and not necessarily reflecting how good the particular printer is. They all will work to a certain degree, but expect a steep learning curve and immediate desire for improvement parts in most cases, especially with the DIY kit versions. Now, I have admit I went with that choice. Why? Because I like to build stuff, figure out how things work, doing research and learning about stuff as much as possible on the hard way. It was challenging and frustrating at times, but overall I enjoyed it and I picked up a huge amount of knowledge through the process.
  4. (+2) Alternatively, you can get in touch with me and I might be able to help to start up.

I am planning to write more about 3D printing in general and my own printer builds and tips. Please follow this blog if you are interested.

Evolved Chinese 3D Printer

My Evolved 3D Printer which started life as an FlSun branded machine from China.




Collection of Bits II.

Here are the rest of the bits from the Chinese made Arduino set.

HC-SR04 – Ultrasonic distance sensor

RTC v1.0 – Real time clock module

ULN2003A – Stepper motor driver v1.0 on a breakout board

Sound sensor

Thumb Joystick

Relay breakout board

MPU6050 – Gyro and Accelerometer

Triple axis compass

8 bit expander

Apart from the above, there is a stepper motor, led matrix, extension and prototyping board, a numpad, LCD display and other easily identifiable pieces




Collection of bits

I couple of month ago I`ve dived into the world of Arduino microcontrollers. To get things going, I have purchased an original Arduino Uno starting set. It provides a tidy book which takes you through some of the things you can do with that little device. Everything is nicely explained and if you get through of all the projects you will get to know all the parts supplied with the kit.

Out of enthusiasm, I also purchased a Chinese “starter set” which is basically a collection of things you can use with the Arduino. There is no list or description of any sort of the parts, so if you like me and has no or very little experience, it leaves you with no clue whatsoever what is what.

So I thought it would be a good idea to make a list of the parts and by the POWER OF GREYSKULL Google, find out what I actually have in that box.  I am not listing obvious ones such as diodes, capacitors, resistors, general LEDs. I go through of the chips, transistors and a few sensors first.

IRF 520(N) Mosfet – Field Effect transistor

S9015 – general purpose PNP transistor

2N2222general Purpose NPN transistor

BC547BGeneral Purpose NPN Transistor

SS8050 – general Purpose NPN transistor

TMP 36GZ – Analog temperature sensor

LTV4N35Opto Isolator

6CW2CHFe38 bit shift resister

L293DNE – Half H driver/ H bridge (for driving inductive loads)

MAX7219CNG – LED matrix/ digit display driver

ATHDX – Tilt switch

VS1838B – infrared receiver

IR Led (clear) / photodiode (black) LEDs






Jack of all trade?

Have you ever heard the expression, “Jack of all trades, master of nothing”?

What do you think? Is it true? Does it need to be true? Can you be really not good in anything, if you are interested in everything (or a lot of things)?

What happens to people whom are interested in more than just one or two things at the same time? Well, in my experience, they are being looked down on. Actually, I am considered myself to be one of those “interested in everything” people, hence I say that. They are being considered as the people whom cannot focus on, make up their mind about, or  stick to anything. And most importantly the people, who does not really know much about certain stuff hence better not to form opinion, as how is that possible to know everything. But is that really true?

Due to social pressure and my upbringing, I have spent my last 20 years to find the THING which I like/ interested so much, that I can “stick with” on a very long term bases. I am not going to list every single thing here, but there is a wonderful expression which says “I was everything, but a hanged man”. I have enjoyed most of those things and in theory, I could imagine to do any of those things for a long time. Except that I cannot. I have completely failed to find ONE (or two) things which I like enough to not to do anything else.

Well, this has caused a lot of anxiety and pressure on me. I was constantly telling myself, I HAVE TO FIND THE ONE THING. That is what you hear from people, that is what you see around you, that is what you read in books, articles, blogs. FIND THE ONE THING, BE AN EXPERT, DO ONE THING!

With the advent of the MAKEr movement, suddenly there is an influx of people whom are doing a lot of things at the same time and they are immensely popular. Jimmy DiResta, just to name one, whom is being considered the “father of the maker movement” and started the backyard/workshop/ shed maker renaissance. Makers are real people, and by now, some are alternative media celebrities. I have picked up the habbit of watching these maker videos quite early. I was absolutely fascinated to see people, whom are having multiple interests and they make good use of it without being labelled “handyman”, “jack of all trades” or simply just crooks in a derogatory sense. Some of these guys even making videos about how they make a living from being interested in a lot of things. However, I have never quite managed to put my mind around that, mainly for the reasons outlined at the beginning of that post.

Soon, I have found myself in the same whirlpool of trying to find the one thing, the one business idea, the one trade, the one profession. Needless to say, just to fail in the process again and again.

However, I have found and tried wonderful things and every time I have found something I was interested in, I have realized, I still could not choose one to stick with.

Than one night when I was assembling a cheap Chinese electronic kit (a laser harp…), while in the meantime I was looking for new chisels for my woodlathe and for starter 3d printer kit on Ebay, finally I have settled on something.

What if, I am interested in all of those things which I have tried in recent years? What if my one thing is to make, create and know stuff about a plethora of things? Certain kind of things of course – I mean, for example I am not into learning practical brain surgery –  and although my list of interests is pretty long, they all involve the process of creating something. What if, this is my art, this is my “one” thing I am expert of. Creating. Trying. Discovering. Making. Knowing. Anything (almost).

So this blog is a start of that process. I will look again on those guys on YouTube with an even wider open mind. I think, I can understand now better when they give names such as “I like to make stuff” or “Make something” and presents this as a strength, not a weakness. I can see now better, what Laura is talking about when she says she want to make content about the process of creating.

This blog is my beginning to live off from which I am doing for a long time as a hobby.  Doing things, making, building anything. This blog and other online/ real life presence will be about that. Things I create and to show off which I take interest in at any one time.

It is time to accept myself,

It is time to be me.