stm32 blue pill wires with 1.8 tft lcd display for sale
An oscilloscope is an essential tool for any electronics engineer. A popular inexpensive digital signal oscilloscope is the Rigol DS1054Z, supporting 4 analog channels and 50 MHz bandwidth. But it retails for $349, probably a worthwhile investment for a professional but steep for a casual hobbyist. Fortunately, with about $10 in parts it is possible to build a minimal oscilloscope, sporting only 1 analog channel at ~2 MHz bandwidth maximum. Not in the league of “real” commercial oscilloscopies, but still powerful enough to be useful.
Based on Andy Hill’s project, pingumacpenguin/STM32-O-Scope: STM32F103 based minimalist oscilloscope., in turn based on Ray Burnette’s idea. See also this thread on stm32duino forums: $10 O-Scope revisited by ahull on May 09, 2015. All credit goes to them, I’m only following instructions.
One confusing part of the steps is that it says “Hardware SPI1 on the STM32F103C8T6 ALSO needs to be connected and pins are as follows.” then lists “SPI1_NSS (PA4) (LQFP44 pin 14) (n.c.)”, but n.c. means not-connected. PA4 is the slave select pin, also known as S̅S̅, SSEL, CS, C̅S̅, CE, nSS, /SS, or SS#. In this case they capitalized nSS as NSS. To be clear, PA4/NSS does not need to be connected.
Secondly, the instructions said “SPI1_MOSO (PA6) (LQFP48 pin 16) (White)” but there isn’t a MOSO master out / slave out label on my display, in contrast to “SPI1_MOSI (PA7) (LQFP48 pin 17) (Grey)” they probably meant MISO. Got it reversed the first time, but worked after swapping. To summarize here are all the connections that worked for me:
For prototyping, I used female-to-female jumper wires from this pack: Dupont line 120pcs 10cm male to male + male to female +female to female jumper wire Dupont cable for arduino, purchased for $3.51 (not included in the total price of this $10 o’scope). You could also use female-to-male jumper wires and a breadboard, or solder male-to-male wires, or use a custom printed circuit board, but F-F jumper wires are the most expedient for the initial prototype.
The STM32-O-Scope software is an Arduino project. Flash the generic_boot20_pc13.bin bootloader using a USB-to-serial adapter onto the STM32F103 blue pill board. Then connect over USB and select the board and virtual serial port in the Arduino application, load up the pingumacpenguin/STM32-O-Scope sketch.
-#include "Time.h" //If you have issues with the default Time library change the name of this library to Time1 for example.+#include "Time1.h" //If you have issues with the default Time library change the name of this library to Time1 for example. #define TZ "UTC+1"
Looks nice! To try it out, the STM32-O-Scope software includes a test signal on PB1, a square wave of approximately 500 Hz. Connect PB0 to PB1 and the square wave appears on the display as we expect:
The wiki recommends using a 1 MΩ resistor as an attentuator. I used a 1% 1/4 watt resistor (not included in the $10 price), measured 1.000 MΩ with a multimeter, in series with the PB0 input connecting to the PB1 test signal, and it was barely visible on the display. May be useful for measuring higher voltage signals, but not the test signal.
From the source code we see the additional wires for adding the optional touchscreen input. You can use an LCD screen without a touch panel, but I opted for one since it was only a couple more bucks. Now that the display works, time to hook it up, five more wires:
All of these pins are adjacent, but are on the other side of the blue pill board. I used right angle headers ($0.74 for 10pcs 40 Pin 1x40 Single Row Male 2.54mm Breakable Pin Header Right Angle Connector Strip bending, not included in the $10 price; also note panel module included pre-soldered striaght headers already). This leads to slightly awkward wiring, but it is passable:
That’s a lot of wires. Peeled off the protective film, but touching the screen did nothing. Turns out it is disabled in the code, enable by removing this code:
Rebuild and reflash. Boots up and asks to press the dot to calibrate the screen. When I touch and hold it, concentric circles appear. Then touching the signal display draws red dots. Will have to learn about how this is meant to work exactly, but seems to be functioning.
This display module not only has an LCD and touch screen panel, but also an SD card slot, through an unpopulated header. 4 connections, also using SPI: SD_CS, SD_MOSI, SD_MISO, and SD_SCK. The LCD is connected to SPI1 (PA7/6/5/4), touch to SPI2 (PB12/13/14/15), could the SD card adapter connect to PA15/PB3/PB4/PB5?
Haven’t tried it because the STM32-O-Scope sketch doesn’t include support for the SD card, but could be an interesting project to investigate adding it. Storing the time series to the SD card? In the meantime, the STM32-O-Scope can already send data over serial to a PC for later analysis.
For the price, $10 + change (and a few spare parts I had lying around), when combined with the STM32-O-Scope softwrae we have seen it is possible to build an inexpensive yet usable oscilloscope. I’m not sure if I’ll use it for any serious projects, or should instead buy a “real” scope (Hackaday has a review of some slightly more expensive commercial oscilloscopes: A tale of two sub-$100 oscilloscopes), but we’ll see, at least it’s something.
We will organize the kinds of display interfaces we offer, and how they differ. You will get to know what kind of external and internal interfaces we have and what are their main applications.
First, let us start with dividing internal and external interfaces in LCD modules. Internal interface of display means it used inside the device. Those are usually the embedded interfaces that are not visible, and we do not have access to them as the users of the device. External interfaces, on the other hand, are connected to the device using a cable. Once we have defined internal and external interfaces, both of these categories come as universal or image transfer interfaces.
A protocol defines the rules of information exchange, where the interface is the medium. The example here could be the language. When I use my voice to communicate with other people, my voice is an interface. Over this interface my voice is being sent to other people’s ears, and the protocol is the language used. Right now, I am using the English protocol. If you understand the protocol, you understand what I am saying. If I switch to a different language, Polish or some other language that you do not understand, you have the same interface, you will still hear me, but because of a different protocol, you do not understand me anymore. In this article we will talk only about interfaces, how to connect devices to each other. We will not focus on protocols.
Let’s try to get the interfaces right. For internal interfaces, interfaces embedded into the device, we have universal interfaces and image transfer interfaces. Universal display interface can send other data, not only an image. Being universal, they are not perfect for image transfer, because in most of the displays used nowadays, the image transfer is one of the most demanding. The bit rate, the data transfer needed for the image transfer is rather high. Higher that many universal interfaces can offer. If we need to send an image every once in a while, then we don’t need very high bandwidth. If we do not need live video stream, then we can use some of the internal universal interfaces such as SPI, I2C or even slow interfaces as RS232 or UART.
The first universal interface will be SPI (Serial Peripheral Interface). This interface is serial, used for communication between a host, in SPI called a Master, and devices called Slaves. One host can communicate with many slaves. To select the Slave, we use the Chip select or SS line and then we use two data lines, Master output or Master input. And of course we have to define the clock, to synchronize the data, because this is a clock synchronized interface.
It can be fast but is not fast enough for live video. The baud rate can be 1 MBd, but it can also be 10 MBd or even 50 MBd on the SPI or QSPI. QSPI is a Quad SPI, a kind of modification of SPI that is faster. But still this interface is very universal, we can use it to connect memory or some input and outputs internally in our device. In the display universe the SPI is used for simple displays, for small size displays, where we can transfer the image relatively fast, because the resolution is low. The maximum size for SPI display interface would be 3.5 inch, 320 by 240 pixel TFT displays. If we have higher resolution, image transfer will be too slow to use SPI even with a high-speed SPI.
If, for example, the Master is sending some data, the only thing Slaves can do is to receive it. And then we need to wait a little bit for the Master to finish. We can then respond as Slave to Master. In I2C Slave selection works a little bit different than in SPI, where we had a Chip Select line (CS line) or SS line to select from. In I2C we first need to send the logical address to the interface that is being written by Slaves. In general, this procedure is slow and universal interface used also to connect the simple memory and some other I2S that we have around our microcontroller on the PCB. It is very useful, but usually not used for image transfer. This interface is very popular in the display world for touchscreens. Most of the embedded touch screens that we use have I2C interface because the touchscreen does not generate many data. We only have coordinates of the finger or few fingers at most, that need to be sent back to the microcontroller, to the device processor. The slow baud rate is good enough for the touchscreen, but not enough for the image.
That is not a case for SPI or I2C, because we have a clock there that gives the speed to every device. Then each device works according to the clock. In UART we do not have a clock. It is rather not used for image transfer. The UART, or SPI, or I2C can be used for low resolution displays. For high resolution displays we need an Intelligent Display, a display that will generate the image internally and through these slow universal interfaces we only send commands, or we send the image once, the image is being stored into the internal memory of the intelligent display, that we will use later sending the commands. You can find Riverdi’s intelligent display line on our website: https://riverdi.com/product-category/intelligent-displays/.
These Riverdi products are very advanced Intelligent Displays, made with Bridgetek controllers. The controllers use SPI and QSPI for communication. That means your software, your system, your microcontroller can be simple. You can use SPI interface to drive them, and you can still have high resolution image, even as high as 1280 by 800 pixels in 10.1-inch LCD displays. So, please remember that if you want to use a slow universal interface and have a high-resolution image, you need to use an Intelligent Display.
There are also the internal image transfer interfaces. The image transfer interface allows continuous high speed image transfer. Internal transfer is high enough to refresh the display many times per second. This is called the refresh rate of a display. When you go to a display, monitor, or TV set specification, you will see refresh rate or maximum refresh rate parameter. If it’s 60 Hertz, that means the display image is refreshed 60 times per second. More advanced displays would have higher values, like 100 Hertz. The refresh rate means we need to send full image 60 times or 100 times in each second. To visualize this amount of data, we need to multiply refresh rate by the resolution of the screen. For example, for a 7-inch Riverdi LVDS display with resolution 1024 by 600 it is roughly 600 thousand pixels.
The most common internal image transfer interface in industrial LCD displays nowadays is LVDS – Low Voltage Differential Signal. A crucial feature of this interface is that it is differential. It means that the signal is immune to interference and we can use a twisted pair of wires to transfer the data. We can send data fast and it will not be corrupt by any noise, interference. This kind of data corruption is quite common in other interfaces.Key Takeaway: In LVDS display interface the differential signal allows you to send the signal at a very high speed and keep it safe from noise.
The next, older image transfer interface is called RGB. Name comes from the colors sent parallelly to the display: red, green and blue. LVDS is a serial interface and the RGB is a parallel interface. The main difference is that RGB is not differential, so it is easier to disturb signal with noise and you configure the speed of this interface too high. Parallel interface means that we send every bit in a separate line. In theory this interface could be fast, but because it is not differential, the transfer speed is limited. Moreover, the RGB display interface will work with rather small screen sizes – usually up to 7-inch or 10-inch.
12 inch screen size is the total maximum for a LCD display with RGB interface, but the resolution will be lower, like 800 by 600. For this display size it is very low resolution. This is the reason why the 7-inch is size above which the LCD displays are being switched from RGB to LVDS interface. Among Riverdi products (if you go to the Riverdi website and to the IPS display tab), there are displays without the controller, and the small displays like 3.5-inch, 4.3-inch and 5-inch are equipped with RGB interface. But when you go to the 7-inch LCD displays tab on Riverdi website, you will find RGB, LVDS and MIPI displays. But when you go to the 10-inch or bigger displays, you will only find the LVDS displays because our 10-inch LCD displays are high resolution 1280 by 800, and it is impossible to build it with the RGB interface.Key Takeaway: RGB is low speed and not immune to noise. Use it for the smaller size displays or with lower resolution.
MIPI – Mobile Industry Processor Interface – is an internally embedded image transfer interface, getting popular these days. This kind of interface is used in mobile applications, tablets or mobile phones, but it is entering as an option in industrial applications. In Riverdi we offer 7-inch MIPI displays, but please be careful with other MIPI displays on the market. Many come from mobile phones or tablet market. Also, the TFT glass availability may not be stable as the mobile market changes really fast, every six months or every year. When you buy a 7-inch Riverdi MIPI interface display you are safe, because it is an industrial display.
This is why we have a limited number of displays with MIPI interface – we want to be sure that what we sale will be available for a long time. Longevity is one of Riverdi’s core values and we do not want to deliver anything that will not be supported for a minimum 3 to 5 years. It is because many of our customers are making industrial, medical or military devices and they need displays to be available long-term.Key Takeaway: MIPI is an important and growing interface in the display market.
Next interface is the Vx1. It is similar to LVDS and MIPI, so it’s low voltage differential signal. Vx1 is a very high-speed interface, usually used in large high-resolution screens, like 55-inch 4K TVs or even larger ones. If you buy this kind of a TV set right now, probably the embedded interface inside will be the Vx1.Key takeaway: Vx1 is a super-fast interface used for high bandwidth image transfer, with high refresh rate and high-resolution displays, used in 4K screens and above.
The last internal image transfer interface is Embedded DisplayPort (eDP). We call it the new LVDS, because many new industrial displays are equipped with the eDP. If you go through industrial manufacturers of TFT LCD displays, you will notice increasing number of models available with the eDP. eDP is also a native interface in new Intel or AMD based processors.Key Takeaway: With the embedded DisplayPort as a native display interface you can cut down costs, because you do not need anything extra to connect a display to the processor.
Now, with the processors on the market, we need displays with embedded DisplayPort. Many laptops or monitors already use embedded DisplayPort as an internal interface instead of LVDS. LVDS still is the most popular industrial LCD display interface. All the internal image transfer interfaces like MIPI, Vx1 and eDP are variations of LVDS, where the protocols and the signals are a little bit different. For example, for eDP we can have lower noise and reduced power consumption. All of them have advantages over regular LVDS, but they are all LVDS type.
Now, let’s take a closer look at external interfaces. Those are the ones that we usually have direct access to. It can be TV or monitor connected to your computer with the HDMI . It can be a DVI usually used for monitors. Or VGA which is an outdated image interface for monitors. The DisplayPort that is a HDMI successor. Finally, an universal USB-C, the most common interface nowadays used to connect devices.
Let us start with USB-C, the most universal interface . It is one of the best interfaces that we have ever designed, because it is really fast and also very universal. It not only transfers data, not only it is fast enough to transfer image, but it can also transmit a lot of power.
USB-C transmits up to 100 watt of power, because you can increase voltage and current. In a regular USB it is usually 5 volt and 0.5 or 1.0 amp, so only a couple watts. In USB-C you increase the voltage up to 20 volt and with the 5 amp current, so in total it’s even 100 watt of power. This interface is made not only for data, but for real power transfer. Through USB-C you can charge your phone and your laptop. If you buy a new laptop right now, you may even not get a regular power connector, but only an USB-C. The USB-C is a very smart interface. If you connect the devices, they can negotiate with each other which one has more power. For example, if we connect a charger to a laptop, the charger has more power and will charge the laptop, but if you connect the laptop with the same interface to your mobile phone, then they will discuss the power levels, and of course the laptop will be charging the phone. You can already find monitors on the market that have USB-C instead of HDMI. Those monitors can be powered from your computer and need only one USB cable, both for image transfer and power. For sure the future belongs to USB-C implementations.Key Takeaway: USB-C is a really smart, universal and fast interface for displays. It comes with power transmission option.
Let’s move on to image transfer interfaces. The most common one is HDMI – High-Definition Multimedia Interface. M stands for Multimedia, because it transfers image with sound. If you connect your computer to your TV set with HDMI, you will need one cable for both the video and the audio. There are variations of HDMI connectors:standard HDMI,
The next one is DVI – Digital Visual Interface. The first DVI was not a multimedia interface, because it did not have audio data transfer. Nowadays, there are some variations that can transfer audio, but it is non-standard. We can assume DVI is rather for image transfer. It is a digital interface, similar in signals to HDMI. The latest variation is DVI-I, where I stands for integrated interface. It can have a digital and analog part for VGA compatibility. In the picture above there is a DVI-D, digital only, where we do not have the pins for analog VGA interface. Analog VGA is sometimes available in your desktop computer, but not in laptops anymore.Key Takeaway: DVI is digital visual interface with multiple variations and updates, similar in signal to HDMI
The oldest video interface still in use is the VGA – Video Graphic Array interface. It becomes less and less popular. This is an analog interface, not a digital one like all the other abovementioned interfaces. Analog interface means that we do not transmit the bits, but we send the voltages values. The analog signals are not stable, they are quite easy to disturb, so the transfer cannot be very high in speed and volumeKey takeaway: VGA’s popularity is declining, and it is not the best solution if you have a high-resolution display or noisy environment.
The last external interface that we can find in our devices nowadays is a DisplayPort. DisplayPort is similar to HDMI or DVI. It can also transfer image and sound. It is even faster than the HDMI. Usually, the DisplayPort is used for high resolution displays, for new monitors and TVs with 4K or 8K resolution where it is really hard, or nearly impossible, to achieve such resolution using HDMI interface.Key Takeaway: DisplayPort is super-fast image and sound transmitting interface, used in highest resolution displays.
Got three of them all working(1 with Arduino Leonardo and 2 with NodeMCU ESP8266).arduino will need a solution to the 5v out 3.3v in(10s solder job) NodeMCU is directly compatible.i used adafruits code.Very happy. getting more. also hiletgo products have all been functional so far. becoming a fan.Update: switched to TFT_eSPI.h library. Wow. Orders of magnitude faster display now. A bit trickier to setup but well worth it.
The Serial Peripheral Interface is a synchronous serial communication interface for short-distance communication, it is typically used in embedded systems. The interface was developed by Motorola in the mid 1980’s and has become a very popular standard.
It is used with many kinds of sensors, LCD’s and also SD-Cards. SPI operates in a Master-Slave model, with a possibility of multiple slave devices, each selected in turn by a SS (slave select) or CS (chip select) pin that is usually pulled low by the master.
You should also note the SPI slave devices that do not have a tri-state mode on their MISO pins, should not be used on the same bus as devices that have without using an external tri-state buffer circuit between the non-tristate device and the rest of the devices on the MISO bus.
To begin communication, the bus master configures the clock, using a frequency supported by the slave device, typically up to a few MHz. The master then selects the slave device with a logic level 0 on the select line. If a waiting period is required, such as for an analog-to-digital conversion, the master must wait for at least that period of time before issuing clock cycles.
Transmissions normally involve two shift registers of some given word-size, such as eight bits, one in the master and one in the slave; they are connected in a virtual ring topology. Data is usually shifted out with the most significant bit first. On the clock edge, both master and slave shift out a bit and output it on the transmission line to the counterpart. On the next clock edge, at each receiver the bit is sampled from the transmission line and set as a new least-significant bit of the shift register. After the register bits have been shifted out and in, the master and slave have exchanged register values. If more data needs to be exchanged, the shift registers are reloaded and the process repeats. Transmission may continue for any number of clock cycles. When complete, the master stops toggling the clock signal, and typically deselects the slave.
In addition to setting the clock frequency, the master must also configure the clock polarity and phase with respect to the data. Motorola SPI Block Guide names these two options as CPOL and CPHA (for clock polarity and phase) respectively, a convention most vendors have also adopted.
An alternative way of considering it is to say that a CPHA=0 cycle consists of a half cycle with the clock idle, followed by a half cycle with the clock asserted.
An alternative way of considering it is to say that a CPHA=1 cycle consists of a half cycle with the clock asserted, followed by a half cycle with the clock idle.
The combinations of polarity and phases are often referred to as modes which are commonly numbered according to the following convention, with CPOL as the high order bit and CPHA as the low order bit:
Note that in Full Duplex operation, the Master device could transmit and receive with different modes. For instance, it could transmit in Mode 0 and be receiving in Mode 1 at the same time.
Pull-up resistors between the power source and chip select lines are recommended for systems where the master’s chip select pins may default to an undefined state. When separate software routines initialize each chip select and communicate with its slave, pull-up resistors prevent other uninitialized slaves from responding.
Since the MISO pins of the slaves are connected together, they are required to be tri-state pins (high, low or high-impedance), where the high-impedance output must be applied when the slave is not selected. Slave devices not supporting tri-state may be used in independent slave configuration by adding a tri-state buffer chip controlled by the chip select signal. (Since only a single signal line needs to be tri-stated per slave, one typical standard logic chip that contains four tristate buffers with independent gate inputs can be used to interface up to four slave devices to an SPI bus.)
Some products that implement SPI may be connected in a daisy chain configuration, the first slave output being connected to the second slave input, etc. The SPI port of each slave is designed to send out during the second group of clock pulses an exact copy of the data it received during the first group of clock pulses. The whole chain acts as a communication shift register; daisy chaining is often done with shift registers to provide a bank of inputs or outputs through SPI. Each slave copies input to output in the next clock cycle until the active low SS line goes high. Such a feature only requires a single SS line from the master, rather than a separate SS line for each slave.
Some slave devices are designed to ignore any SPI communications in which the number of clock pulses is greater than specified. Others do not care, ignoring extra inputs and continuing to shift the same output bit. It is common for different devices to use SPI communications with different lengths, as, for example, when SPI is used to access the scan chain of a digital IC by issuing a command word of one size (perhaps 32 bits) and then getting a response of a different size (perhaps 153 bits, one for each pin in that scan chain).
Below is an example of bit-banging the SPI protocol as an SPI master with CPOL=0, CPHA=0, and eight bits per transfer. The example is written in the C programming language. Because this is CPOL=0 the clock must be pulled low before the chip select is activated. The chip select line must be activated, which normally means being toggled low, for the peripheral before the start of the transfer, and then deactivated afterwards. Most peripherals allow or require several transfers while the select line is low; this routine might be called several times before deselecting the chip.
This is a third release of combined soldering iron controller for Hakko T12 tips and 858D rework station based on STM32 micro controller. This time the oled display was replaced by ili9341 TFT one with SPI interface. There are several display variants (2.2", 2.4", 2.8" or 3.2") in the market, so you can chose the one that satisfies your requirements, I used 2.2" display. The touch screen feature is not used in this project, but you can use display with touch screen panel.
The soldering controller supports using soldering iron and Hot Air Gun at the same time. In the main mode, you can activate any device or activate both devices simultaneously or turn them off. As soosn as the display resolution is higher than oled display, the information of both devices can be displayed on the main screen.
Before updating the firmware, save the PID parameters if you have modified them. The landscape orientation is still the default. Some issues can be faced in the portrait display mode. Report them to be fixed.
To decrease the controller price and increase its reusability, the complete schematics was split in 3 separate PCBs. The main PCB conntains the main low-voltage components: stm32 blackpill board, op-amps, voltage dc-dc converter and regulator, mosfets that manage the soldering iron and Hot Air Gun fan. The AC power PCB contains the high-voltage part of the project: the triac, optional high-voltage relay and opto-couplers that creates galvanic isolation from the main board. These boards connected via 5-wire interface cable. The display PCB contains the TFT display and two rotary encoders.
JP11 is a optional DIP-type connector for SD-card reader on the TFT display. This connector is used to load external files to the SPI flash memory IC. Just solder the pin-header here.
The debug switch is optional one. You can solder the wire instead. It is used to disconnect 24v power from the bluepill board when the firmware is loading from your PC or while debug the firmware. As soon as 24v AC-DC power supply is not isolated one and the PC has non-isolated power supply also, it is possible to destroy blackpill board when it receives the power from different sources.
The high-voltage board implements wide lines and should be ordered with2ozdepth to allow high current to the Hot Air Gun heater. It would be very expensive to order the complete board with 2 oz depth, so the high-voltage part was split to a separate PCB. Yet, the interface connector is completely isolated from AC power via two opto-couplers OK1 and OK2. The EasyEda page contains two versions of the pcb, both are correct. You can select the one you like.
The interface connector has 5 wires that manages the AC power board:"+24" is +24 volt from AC-DC power supply to activate K1 relay. You can remove this wire if you do not install the relay
The schematics of the board is very simple. It contains two rotary encoders and TFT display. Also, you can see the mosfet that manages the TFT display brightness.
The controller requires big size PCB to fit all the components so it is convenient to create the display separate board. Also, It is convenient to solder rotary encoders to the display board and use encoder neck to fix this board on the acrylic front panel.
This controller is working with ili9341 based TFT displays only. You can select the display size (2.2", 2.4", 2.8" or 3.2"). The display has sufficient resolution 320x240 to show required information. I used the 2.2" one to fit the case.
The Hakko T12 soldering tips are very convenient tools: they are heating extremely fast and have a sensor inside that allows to keep the temperature very accurate. The tips require just three wires: plus, minus (ground) and earth ground. The heating element inside the tip is connected consequently with the thermo couple allowing to decrease the required wires. It makes the cable very flexible and light weight.
When connecting the Hot Air Gun handle to the controller via GX16-8 plug you can use the following reference of the plug pin-out. Unfortunately, I do not know the color of the wires because my handle was assembled. I have been told that there is a different kind of hakko 858D handles in the market and your handle can have different pinout. To check your handle pinout you can keep in mind the following criteria:The plug should have two wires for the heating element, two wires for the temperature sensor and two wires for the fan. The reed switch shares gnd with a temperature sensor.
This feature increases the safety of soldering iron. There are two automatic power-off features are implemented inside the controller, software driven and hardware driven. The hardware driven one requires optional TILT or REED switch installed in the iron handle. In the software mode, the controller turns on the Idle mode if the supplied power to the iron is stable for a while. In this case, the controller will power off the iron in specified timeout. When the time to automatic shutdown near, it will be displayed as a seconds remaining. When you use the iron, the supplied power changes and the controller resets the automatic power off timeout.
To use the hardware TILT switch, you must setup automatic power off timeout and standby temperature. If the standby temperature is "OFF" the hardware tilt switch will not be used and software solution described previously will be activated. Also, you can setup standby time (timeout to switch to low power mode). When the tilt switch enabled, the main working mode changes the following way. The iron is starting heating. When it reaches the preset temperature the "Ready" message will be displayed and the controller will keep the preset temperature. If the soldering IRON is not used (laying on the table) the controller will switch low power mode. If the iron keep laying for automatic off timeout, the controller will switch off the power completely. As soon as you start using the iron, the controller restores the preset temperature.
The main component is the BlackPill board. You can use the pure STM32F401CCU6 micro controller if you wish to create compact variant of the soldering station.
Connect this DC-DC converter consequently with b0505 isolated cobverter: 24v -> MP1584 DC-DC converter -> b0505 -> ams1117 gnd you get isolated power supply for your stm32 micro controller. This king of power supply is isolated and low-noise power that ensure accurate ADC temperature readings.
This project is based on the BlackPill board with STM32F401CCU6 micro controller. To flash prebuilt firmware to the controller the st link v2 programmer and ST link utility are required.
Download the STM32 ST-LINK utility fromstsite. Install the utility in your system. Launch the ST-LINK utility, connect the programmer to the 4pins SWD interface of BlackPill board, press "connect" button. The main window should display the memory content of the BlackPill board. Press flash button to write the firmaware to the BlackPill board.
As you can see, the main AC power after fuse that can be installed on the pannel of the case, goes into JP3 socket on the high voltage board. You can connect main power switch to the JP6 socket or short it oins and completely remove main switch if do not like to use it. JP4 and JP2 sockets are used to connect to the GX16-8 connector of the Hot Air Gun. The power to the heater goes from JP4 socket and all other wires connected to the JP2. Earth ground should be connected to the Earth ground of AC power (not shown here). JP8 and JP9 connectors should be connected together. Soldering Iron GX12-5 connector should be connected to JP1 and JP5 sockets. JP10 used to connect optional automatic mode switch. Using this switch you can disconnect the Hot Air Gun completely from the controller when it is not needed. JP3 should be connected to the J1 connector on the TFT board. This is 14-wires connector to attach the display and rotary encoders.
Using JP11 you can connect the SD-CARD installed on TFT display to the controller when going to upload some files from SD-CARD to SPI FLASH. For instance, it can be used whel upload localization data files.
In the controller schematics you can see two 500k potentiometers R5 and R19 that tunes the operation amplifier U4.1 and U4.2 to get the expected temperature readings at controller pins PA4 and PA5 of BlackPill board. You can use different operating amplifier, so these potentiometers are increasing the controller flexibility.
To simplify controller tuning procedure, the tune modes are implemented in the controller. This modes can be activated from the system menu item "tune iron" or "gun menu->tune gun". When the tune mode is activated, the controller powers on the iron or Hot Air Gun and displays on the screen applied power (in percents) and the gauge of the current temperature readings. The gauge has a label "450" or "500" depending on what hardware you are tuning. When the gauge reaches this label, the temperature should be 450 or 500 degrees of Celsius.
As soon as you have stabilized the iron temperature near 450 degrees, rotate the 500k potentiometer trim to shift gauge bar on the display left or right. Adjust the potentiometer so the bar would be as near to the reference temperature as possible. Then long press the encoder handle (for about 2 seconds) to turn the iron off and finish the procedure. It is recommended to use the thick tip that produce the highest voltage when performing the tune procedure. For example, T12-K, T12-D52 or similar.
As you can see from the picture above, the debug screen shows the following information:iron status (off or on). You can manage the power supplied to the soldering iron by rotating the upper encoder. As the encoder rotated, you adjust the power supplied to the iron (in internal units). The more power supplied to the iron the faster it heats. Supplied power value displayied in the right column ("irnP") in the internal units.
If the SPI FLASH is formatted and working correctly, you should see the screen above. As you can see, it is the root directory list of SPI FLASH. In case of FLASH error, the error message would be displayed indicating the FLASH is not readable. If your SPI FLASH is unformatted, the corresponding message would be displayed and the controller asks you to confirm the FLASH should be formatted. When the FLASH will be formatted, you should see the empty file list.
The current tip can be calibrated using "calibrate tip" menu item. If the tip is not calibrated yet, the "[!]" sign would be displayed near the tip name on the main screen. There are two calibration modes in the current version of the controller firmware: automatic and manual.
First, turn the power on by pressing the encoder lightly to start calibration process from the first referense point. The iron start heating. When the reference temperature reached, the controller beeps and get ready to read the real temperature value. Check the iron temperature by the external thermo-couple and enter this temperature to the controller: rotate the encoder handle to select the real temperature then press the encoder lightly. Then the controller continues with the next reference point. This procedure finishes when you enter temperature of all 8 reference points or when the real temperature will be greater than 430 Celsius. During this procedure controller updates the tip calibration data.
In manual tip calibration you must "guess" the internal temperature readings that matches the calibration temperature. First, you should select one of the 4 calibration temperature and press the encoder lightly to start calibration process. This procedure is iterative: you start with the some preset temperature value in internal units (for example, calibrated by automatic procedure) the controller heats the tip to this preset temperature and gets ready. Then you measure the real temperature by the external thermo-couple. If the real temperature is not equal to the preset one, you should increase or decrease the internal preset temperature by rotating the encoder handle.
The progress bar in the lower part of the display shows the difference between preset and current temperature (in internal units) of the tip. The controller keeps the tip temperature near the preset value (vertical line on the progress bar) all the time. To increment the preset temperature, turn the encoder right, to decrease - turn it left.
When the low power (standby) mode activated, the controller shows the "standby" icon in the upper-right corner of the display lie shown on the picture below.
The "tune iron PID" and "gun setup->tune gun PID" menu items in the main menu allowing tuning PID parameters of soldering iron and Hot Air Gun. When tune PID mode activated, you can see three values of PID parameters on the display, Kp - proportional, Ki - integral, Kd - differential. First, choose the parameter you are going to change and press the encoder button. You turn into tuning test mode. There are two graphs: the temperature difference and power math dispersion. Both graphs are auto magnifying ones and its maximum value is shown on the Y-axis by the corresponding color.
Prebuilt version of the controller software can be downloaded from the github repository. To upload this hex file into controller, you can use stm32 st-linkutility.
In order to use your native language, the NLS data should be uploaded into SPI FLASH. To do so, you have to:Connect your SD-CARD reader (the TFT display board has one) to the JP11 connector via 4 wires: SD_CS (Chip Select), MOSI, MISO, SCK. If you have not implemet the JP11 socket, remember following: SD_CS (Chip Select) - PB12, MOSI - PB15, MISO - PB14, SCK - PB10.
When the controller copies files from SD-CARD to SPI FLASH, it reads thecfg.jsonfile and loads the language data accordingly with this file. For each language in the list, it checks the language consistency and copies data files when the language is consistent (have both message and font file). Yet, the controller copies only files that is newer that existed on SPI FLASH one. Font data file can be used for several languages. For instance, you can use ubuntu_we.font for several Wester Europe languages.