Some time ago I have bought a Segger Jlink Plus programmer. It’s a fine device which I mostly use for programming STM32 microcontrollers so the SWD connection comes handy.
And since I tend to experiment with different setups I hate the fact that I constantly need to transfer the cable (that came with the programmer) to new setups and have to connect the jump wires again.
So I had an idea to create an adapter where SWD pins are already available so I can use few jumper wires to connect to SWD connector on the demo board and voila.
I’m printing PLAs in 215 °C (419 °F) so I was wondering if I throw the small cube of PLA into a boiling water (100 °C or 212 °F) what will happen.
According to this small test – nothing. The cube got wet (no surprise here :)), but other than that the cube stayed the same. Not sure if it is the shape or the PLA is really not affected by boiling water since I have read on Reddit there are some issues with PLA. Not to mention that PLA is not really food safe material.
I have some silk PLA lying around though, so I will try to print a small vase (unfortunately my current printer supports printing only with height of 100mm which is rather small for a vase).
There is this store in Austria (also in Slovenia, but the item was available only in Austria) called Hofer (Aldi in some countries) and they were selling 3d printer for 200 EUR which is pretty budget oriented so I’ve bought one. It says BALCO on the printer and apparently it’s a printer from an Australian company. Have to admit it was one of the best buys lately.
This time we will not bother with testing on the ESP32 since it would be just blinking the LED every 1 second and we already did it.
So let’s just create a new project with virtual LED. The steps are similar to what we did in our first project, but we have to select LED from widget box selection and name it V0
The idea is to blink the virtual LED in the mobile application from the ESP32 application. Delay should be 1 second.
Program ESP32 and run the project on the mobile.
We can see how the virtual LED is blinking, but the delay between blinks is far from 1 second. So what is happening?
Here is one important lesson we need to know. The communication between application on the mobile and ESP32 is not direct, but through Blynk cloud which means ESP32 is sending data to the cloud and Blynk application is reading this data. In between some delays appear due to traffic on the internet and it is really hard to predict how much delay will there be between blinks.
This one is a function in Python returning the distance. You need to define TRIG for the transmitter and ECHO for the receiver.
Why are we multiplying with 171500?
Since the speed of sound is 343 m/s and the sound needs to travel double the distance from the sensor to the obstacle we need to half the calculated distance (from the formula v=d/t). We get 171.5 m/s, but since we want the result in millimetres the result has to be multiplied by 1000 (you know – 1m = 100cm = 1000mm) .
We just added some logging, but you can really ignore that if you want.
Anyway, let’s create an app now. We will be using the text input widget.
In settings (just click on the widget) you need to select virtual pin for the output. We are using V0, but you can really use whichever you want (just change the code accordingly).
For this project you will need an Arduino Uno board, a way to program it and an application Blynk on your phone.
Initial code was just a regular Arduino code to see that I didn’t make a mistake. It is rather trivial with this project, but it is good to be consistent and really test the basic code, so you will know the code is working.
Since we don’t have any wireless connection to the Arduino Uno we will be using USB connection for that.
After checking the documentation on the Blynk page we need to install the Blynk library first.
And we also need to create a button in the Blink project on the phone.
Open the Blynk app and click on “New Project”. The project name will be “Blink” since we are blinking the LED on the Arduino Uno board. From the CHOOSE DEVICE list select Arduino UNO and for connection type USB. Theme is not important.
When you finish clik CREATE button and the Auth token is sent to the mail address you used to register.
You can see in the documentation page regarding USB connection that you need to use some scripts. Depending on which operating system you are using the extension is .bat or .sh.
There is an error in the example on the above mentioned page in the command Blynk.begin: The command should be Blynk.begin(Serial, auth); and not Blynk.begin(auth, Serial);
The script to start on the computer is located in the directory called scripts inside the Blynk library directory. It is called blynk-ser.sh on Mac or Linux and blynk-ser.bat on the Windows machine.
I tested the script on Mac machine with an Arduino Uno copy (using CH340 driver) and latest operating system (Catalina).
When starting the script it offered me port /dev/tty.usbserial-1410 but running the script with that port I always got a Resource busy message.
After some searching on the internet I got nothing. I was sure there is a “problem” with socat code, but wasn’t sure what and why. Anyway after playing with only socat I found out that the device /dev/cu.wchusbserial1410 gets me somewhere, but only if I start the script as a root. So the command:
For this project you will need an ESP32 board, a way to program it and an application Blynk on your phone.
Initial code was just a regular Arduino code to see that I didn’t make a mistake. It is rather trivial with this project, but it is good to be consistent and really test the basic code, so you will know the code is working.
After checking the documentation on the Blynk page we need to install the Blynk library first.
And we also need to create a button in the Blink project on the phone.
Open the Blynk app and click on “New Project”. The project name will be “Blink” since we are blinking the LED on the ESP32 board. From the CHOOSE DEVICE list select ESP32 Dev Board and for connection type Wi-Fi. Theme is not important.
When you finish clik CREATE button and the Auth token is sent to the mail address you used to register.
Let’s add the button to the project from the list and click on it to modify it.
We will use the gp2 digital pin, since this is the pin to which blue LED is connected.
Let’s learn how to use Blynk environment to control different hardware platforms, for example Arduino. First you need to install the application on the Android or iOS device.
Initial installation
After installation you also need to register so you can get the data properly routed to your page and not to somebody else.
There is also an option to run your own server, but I recommend that you start with an account on Blynk server, just to test that everything is working as it should.
You will also receive an email with links to different services about Blynk (libraries, examples).
Arduino and Blynk
Since the Arduino environment is rather easy to start with, I will start with this and the library is the same for all the environments. So basically – how to turn the Arduino Uno embedded LED on or off.
Is Blynk free?
Basically yes, but there is a caveat. You are using the app by expending the energy. You get 2000 units of energy after you create new project and the list of widgets you can add is shown with their energy “value”.
It means you lower available energy by adding different elements to it.
What happens when I run out of energy?
You can purchase more energy by clicking on the +Add button on the right side of the where you get a list of prices for different Energy packs (levels of energy).