Here is the latest project (shinny penny) that caught my eye. I have been working through this one there seems to be a new idea at each step.
Idea and planning:
My daughter wanted some colored blinking lights for her new loft bed. They had to stay a solid color and blink. I headed down to the workshop to see what I could come up with.
I have used the ESP8266-FastLed-WebServer software before and it works quite well. 2 thumbs up to Jason for all of his hard work. So with the software taken care of all I had to do was to focus on the hardware. To be honest I like the hardware side of things a little better than the software.
The hardware plan is pretty simple. The three main parts being the ESP8266 for processing and communications, DC-DC step down for the power, logic level shifter for the data signal line.
Here is the quick schematic I did at work before I plunged into the project at home.
Parts:
I rummaged around the workbench and came up with:
Amica NodeMCU v2
4-channel logic level shifter breakout board
LM2596 power module
1x 100uF a cap
1x 330 Ohm resistor
1x 2.1mm DC Barrel Jack
Length of WS2818 5v RGB LEDs. I used 1 meter.
Putting it all together
I dialed in the power module down to 3.3v. It is variable which is very nice. I keep a couple of them around to provide a quick and stable 3.3v power to some of my projects.
I have a barrel jack providing 5v from a wall wart. It runs into the M2596 tha I have set down to 3.3v for the NodeMCU. It uses a variable resistor to control the voltage level. The adjustment on it is pretty fine and I haven’t had any issue with it drifting once it is set. Note: I still need to run 5v to the LEDs and then also to the 4-channel Logic Level Shifter.
This is the only part that can get tricky. The LLS has two sides a low and high side indicated by the L and H. The low side will see connections to 3.3v, GND, and Pin 6 of the NodeMCU. The high side will see 5v, GND, and data out to the LEDs. A resistor is place inline to the data line into the LEDs. This is done per best practices to protect the data line.
I ran a pig tail of through a hole in the case. Then the three wires are connected inside. It is a quick connector that came with the lights. I just added the pins to the ends for quick and easy connections here. The Red goes to 5v, the White goes to GND, and the Green is the data line.
The NodeMCU sees a 3.3v wire for power, Ground, and a connection to Pin 6 from the LLS to control the LEDs.
Alright, things seem to work on the bench just fine, now it is time to wire it up while in the case to make sure everything works before I button it up.
I had some lights outside and needed and case to weather the elements and Black and Decker battery pack (emptied) worked out quite well, so decided to give it a second life.
While this serves its purpose I had the grand idea of whipping up a PCB real quick to make it look neater and mount easier. I charged into that full-bore with version 1.0. The joke about any version 1.0 is pretty much true. It was a learning experience and glad it didn’t cost too much as I used jlcpcb.com; they have the $2.00 prototype board. I have used them before and the boards are of good quality and arrive fairly quickly.
• wrong NodeMCU module, this is for the larger v0.9. Create a new footprint for the Amica v2.
• simplify power – should have from the start, but I grabbed this power module I had laying around already set to 3.3v.
• wrong sized capacitor hole – pull out the micrometers.
• layout in general – organize
I took that information and setup version 1.5. I started with the old board on a sheet of paper and listed problems, fixes, and changes I wanted in the new version. I went back to the drawing board. This time paying a whole of attention to every detail. I pulled out the micrometers and double-checked the sizes of holes, pins placements, the works. Stuff one should do the first time around and not try to whip one off quickly. This one is off to pcbway.com for production. I have not used them before, but I was looking around and decided to try out another production house. They were a little more, but still the boards are cheaper than the shipping in both cases.
SweatPea’s Pretty Blinking Lights version 1.5 PCB
SWPBL version 2.0
While working through version 1.5, I started to pull out another idea and meld it with this one, SWPBL version 2.0. I have wanted to create a development board from the ground up. No reason really, I have plenty of pre-assembled, but for the knowledge and to say I can I guess. And I ordered 5 12-E modules a few months ago and have been looking for just such a project to use them on. Anyhoot. I grabbed the data sheet for the ESP8266 12-E and started to study about this wonderful little chip. I found a great reference for what pins are best used for operation of the 12-E. There are also the Reset and Flash buttons included. I am waffling on the idea of adding LEDs anywhere on the board as it will be in a box, but it could prove useful in trouble shooting the board should a problem arise. Between the data sheet and the Arduino Core document, I started with the list of pins needed for operation and stability. They include: Reset, CH_PD, and GPIO0 are pulled high. GPIO15 is pulled low. I have switches to ground on the Reset pin for Reset, and on GPIO0 for Flash functions.
Which had my mind wandering as to how each pull-up and -down resistors are calculated. I am not an engineer by trade, but like to play one at night; so that means I learn on the go. To date I have just relied on what an example schematic shows, not really knowing the exact how and why. Now it is time to do a little math and figure out the why. I found this electronics tutorial very helpful and informative. The math works out for this project as well. Bonus.
I also round myself pondering the question of using a ground plane versus ground traces as I have been. In version 2 I am going to be using a ground plane for the advantages of
I started to build a simple FDTI interface for programming, but naw, that just didn’t sit very well with me as I thought USB would be best for ease of use. Here I found the CH330N. Many of you may be familiar with the CH340 family which powers many of dev board and device. The 330 is just its little brother. It is cheap. I wound up ordering 50 from lcdc.com and they were $0.40 per chip, shipping included. Easy to add to my project. It is a small package for soldering. You will notice that most of what I have done it with through-hole parts. I am going to take a stab at the smaller sizes now. I have a new soldering tip for the Hakko on order just for this process.
Here is the progress of version 2.0 right now. All of the electrical checks worked out so now I am working on how to lay everything out. Since I am using the bare ESP8266 module, I am doing some extra reading to make sure the power and such don’t interfere with the wireless. The wireless world is hard enough to live in these days as it is a crowded space and don’t want to handicap my device.
SPPBL schematic version 2.0
Datasheets used through out this process.
ESP8266 12-E Datasheet, Espressif – The heart of the project
ESP8266 12-E – a good reference. ESP8266 Arduino Core
CH330N – USB to UART chip a local Google translation copy
CH330N info and applications – Hackaday reference, VERY informative.
TI 74AHC125 – Quad Logic Lever Shifter
© 2019, wrightmac. All rights reserved.
No tags for this post.