Friday, September 18, 2015

NodeMCU breadboard aid

Before I go on with this story I will tell you what the NodeMCU is.

Since just over a year there is a hot product on the market and that is called the ESP8266. This tiny chip has a processor (running at 80 Mhz), memory, I/O pins and best off all WIFI. The number of the pins depend on which type you purchase.

The ESP8266-01 has just 2 I/O pins. Not a lot but enough for a button and a led or a sensor and a led etc. etc. And yes there is enough memory in it to adresa a whole bundle of Neopixels.
The largest one (at this moment) is the ESP8266-12 which has 11 digital I/O pins and 1 Analogue input.

So the great part is that you can use it as you would use any micro controller (AKA Arduino)  but you can control the I/O pins over the internet or you can read the I/O pins over the internet. That makes it very usefull for many projects.
Oh, and did I mention that it costs just 3 to 4 dollar/euro !!!!

Any drawbacks ??

Yes. The chip is not breadboard friendly as the spacing of the pins is different and there is no USB connection like the Arduino's have. And they operate on 3.3 volts.

And that is where the NodeMCU comes in.
It is the ESP8266-12 (so the most extensive version) breadboad friendly with an USB connection. Ideal for all kinds of projects.
And just a bit more expensive. It is in the range of 6 to 8 dollar/euro.

Breadboard friendly ??

Well not exactly. look at the pictures below.



As you can see the NodeMCU indeed fits on a breadboard. Now look closer:



Ha there is no room left to put breadboard cables to attach leds, buttons, sensors, servo's etc. The NodeMCU is just as wide as the breadboard itself.

You could decide to put just the right side of the pins on the breadboard and leave the left side floating in the air like the next picture shows you:



This will work and I must admit that I have used it for some purposes. There are however some flaws.

Indeed all digital I/O pins are on the right side of the board so you can access them all. The GND and 3.3 volt are also accessible on that side of the print. Sufficient for most projects.

However the 5Volt power line and the Analogue input are on the right side of the board and therefore not accessible at all.

There is a new release of the NodeMCU (version 1.0 and up) which is smaller and leaves room for 1 row of breadboard pins on both sides. Better but not yet what we want.

The solution

So what I did is I made myself a small PCB with female headers.


There are 4 rows of female headers on the PCB, The inner ones is where the NodeMCU will fit in. The outer ones is where the breadboard cables will fit in.

As I used stripboard with long rows the soldering was easy.


Just measure where the rows of headers should be positioned and solder them in place.
Next cut the long PCB rows in the middle so no connection is made between the right side of the pins and the left side.

Next step.


Thoroughly test if there is no short circuit between the rows of pins and test if there IS a connection between the header where the NodeMCU fits in and the headers where the bereadboard cables fit in. Do this well and you avoid problems when designing your project.

Now but the PCB to size and ready we are.


Here you can see the NodeMCU next to the breadboard.


And this picture tells it all.

I will be getting more into the ESP8266 in future stories so stay tuned.

Till next time
Have fun

Luc Volders

Thursday, September 10, 2015

LM 317: How to make any voltage you need

In a previous blog entry I showed you how I found several power supplies at a flea market for unbelievable low prices. These power supplies vary in voltages. However in our projects we will mainly use 3.3 volts, 5 volt and 12 volt.

There are off course dedicated voltage regulators available like the famous 7805 which takes an imput voltage and makes 5 volts from that.

But I did not wated to be limited to only 5 volts. So that is why I ordered several of the LM317 regulator. This is an adjustable voltage regulator. I ordered 10 pieces as they just cost a few dimes a piece. Here is a picture of one of them.



It is about the same size as a 7805 voltage regulator but the specifications are impressive. The LMT317 is capable of outputting and 1.5 amps load in a voltage range of 1.25 to 37 volts. Next to that is has a thermal overload protection and a current limiting protection. This makes it ideal for a lot of projects.

Let's first look at the pin layout.


At the V-in pin you put a power supply up to 40 volts. On the Adj (adjust) pin you put a resistor divider which detremines how much voltage will come out of the V-out pin and that is it.

So the official schematis look like this (made with Fritzing).



For testing purposes I put it on a breadboard and made a drawing of that in Fritzing to:


As you can see Frizing put the potentiometer adjuster directly on the ground rail of the breadboard. In reality I wired the leads from the potmeter to the breadboard as my potmeters are not suitable for breadboard use.

So for starters I attached a 12 volt power supply and started fiddling with the potentiometer. Here are the results:



Next step was to test it with a battery pack. The battery holder was designed by myself and 3D printed. If you want to print some yourself for your projects click here.



There is some voltage loss. My batterly pack normally supplies 4.76 volts with 3 AAA batteries. The max I got now was 3.9 volts. This is about 20% voltage loss and must be taken into consideration. However this voltage regulator will normally not be used in a battery operated environment.

Outstanding !!!

So if I designed a battery pack for 4 AAA batteries (or AA for more longlasting power) I gan get my voltage starting at 1.35 volts and up to 5 volts.

One last step.

You do not want to have a potmeter in all your designs. they will make your projects more expensive and certainly more voluminous, and they are more difficult to obtain. So we need to find a solution for that.

On the internet (off course) I found a LM317 calculator. You can find it and download it by clicking on this linkLook under the download tab and then under calculators it is the fourth calculator called Regulator Design.



On the left side of the screen you can fill in your desired voltage (Uout[V]) and the value of the first resistor (which is the fixed one in the schematics above) If you then click on the R2 ? button the program wil calculate the value of the second resistor (which is the potmeter value in the above schematics). Neat huh ???




But it gets better.
I did not have a resistor of 660 ohm at hand. I did though have a resistor of 620 ohm at hand. So what will happen if we put that in. Well the program calculates that in the right part of the screen. So I put in 220 at the first value and 620 at the second value and hit the Uout ? button.



So according to the calculations the output value with these two resistor values would be 4.77 volts. If this is correct I can live with that. So let's test it.


Ok that is a bit more as expected. But hey that will be due to the resistor deviation. It is however well within a usable range.

Definitely usable.

Till next time.
Have fun.
Luc Volders