Mostrar mensagens com a etiqueta Arduino. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta Arduino. Mostrar todas as mensagens

Today I bring you guys something new, something that ended up to develop under some pressure and in a short time. In some of my recent projects where the energy consumption was smaller, I ended up to replace the AA batteries for Coin Cell batteries that took a lot less space. During the development process, I ended up draining a lot of batteries, so I replaced the normal batteries for rechargeable batteries. However, I completely forgot that I would need to recharge them. As a coin cell charger was quite off expensive in my area, I ended up to develop a charger by my self what ended up to be cheap(something around 3€) and fast. I used the TP4056 in this project that is a charger for a single cell lithium-ion batteries that will be in charge of charging the batteries!


Materials Used:
  • 1x Coin Cell Holder
  • 1x Small Prototype Board
  • 1x TP4056
  • 2x Very small wires

Schematics:



There are some things that should be taken into consideration when putting the project together. It is extremely important to assure that we do not solder the opposite poles between the battery holder and the TP4056. Each pin of the coin cell battery holder has its own polarity.

During the process of joining everything, I designed a simple case for the project to keep everything together and at the same time beautify the charger. The case can be downloaded from here.


And now... The final aspect of it:





Welcome back! If you only now joined us and are trying to program ESP-01 with UART ESP-01 I strongly advise you to take a look at Part 1 of our series otherwise, if you have your own way to program ESP-01 you can use it. I'm assuming that you should have finished Part 1 by now and that everything went fine and you are ready to proceed. So let's flash some code into our ESP-01!!

What will we need?

For this, we only will not need anything of special, only basic stuff that you already got like:

  • UART ESP-01 (our hacked version)
  • ESP-01
  • Arduino IDE

Preparation

To program our ESPs we will use Arduino IDE and for that, we need to install nodeMCU boards on it so you will be able to upload the sketch. If you haven't done it yet, you can take a look at this tutorial and see what you should do to install this boards on IDE.

Test your first Arduino program on your ESP-01

After finishing the board's installation, go to Boards menu and select "Generic ESP8266 Module". The normal configuration for an ESP-01 is the following:
Arduino IDE Configuration
  • Flash Mode: DIO
  • Flash Frequency: 40 MHz
  • CPU Frequency: 80MHz
  • Flash Size: 512K
  • Upload Speed: 15200 baud

Is important to say that are some ESP-01 that instead have 512K have 1Mb of Flash Size so it's your responsibility to read products description from the store you buy your ESP-01 and see which flash size it as.

Choose ArduinoISP as a programmer.

In the list of examples ESP8266Wifi, choose WifiScan. Put your ESP in Flashing Mode and then upload the program. Open the Serial Monitor (at 115200 baud). Your ESP-01 now scans your Wifi network and returns the found networks. You should now see something similar to the next image but with your nearby networks.

Sketch output with nearby networks



Hi there guys, long time no see! Today I came here to talk about the ESP-01 that is so tiny and can be so helpful to shrinkify the space needed for our projects despite it sometimes could be a real pain in the ass to program.
ESP-01
All those wires and GPIO pins that we need to connect and assure that ESP-01 is plugged into a 3.3V stable power supply make us lose a lot of precious time and even sometimes our patience. So I decided to buy an adapter to program it without the headaches of connecting the wires and I went from this...
Schematic to program ESP-01

to...
UART ESP-01


And it's so much simple you just need to plug there your ESP-01 and no more wires! Everything would be great if it worked, but the reality was that I was not able to flash the ESP-01.
But why!?


THE NEW PROBLEM -.-"

In order to ESP-01 enter in flash mode, you need to connect GPIO 0 to GND and this UART ESP-01 doesn't do that, so after some time spent on research, I think I found one good way to fix this. A simple hack that only takes a few minutes and makes possible connect both pins. The solution that I found consists of welding a switch to GND and GPIO 0. The advantage of using a switch here is that if we swipe it to the right it will create a bridge between the GND and GPIO 0 and will turn UART into an ESP-01 programmer but otherwise if we swipe it to the left it will break the bridge and UART ESP-01 will work as a normal UART.


THE SOLUTION

The solution for this, as said before, is really simple and for that, we only need a welding iron, a normal switch and one header pin or a piece of wire to join UART ESP-01 to the switch.

Material needed

After gathering all the necessary material we should start by preparing it. The first thing that we need to do is cut one of the side pins of the button because we will need only need to 2 of them and this way we prevent from the other one touch in anything that it shouldn't.

Button after cut the side pin
Now we only need to put everything together and we will be ready to program our ESP-01. Before starting to weld the button to UART ESP-01, take a look at the UART ESP-01 schematic to understand and see where each pin is located.

UART ESP-01  upside down schematic

Pick the button and weld the side button pin to GND and with a header pin or a piece of wire soldering the middle pin to GPIO 0.

UART ESP-01 with weld button

After welding both I strongly recommend using hot glue in order to help to fix the button and to prevent that anything messes up with what we just finished to do. In the picture below, you can see how I did it.

After applied the hot glue

Now everything is finished and we finally are ready to program our ESP-01. So let's move on to Part 2  and upload some custom code to it.

Hi there,

Today I will show you how to install ESP8266 support for the Arduino IDE and at the end you already should be able to flash your code directly from Arduino IDE to your NodeMCU. So let's start!

First of all open the Arduino IDE and go to File > Preference

Image 1 - Arduino IDE File Menu


Then copy the link below and paste it on "Additional Boards Manager URLs" as you can see in image 2.

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Image 2 - Preferences Window

Now just click OK to save and close Preferences Windows. If you complete successfully the steps above now we should be able to install ESP8266 support to Arduino IDE. Just go to Tools > Board > Boards Manager...

Image 3 - Arduino IDE Tools Menu

Type into search box esp8266 or navigate through options and search for esp8266 community and install it as you can see in image bellow.


Image 4 - Boards Manager Window

Congratulations, now you should be able to find ESP boards in Tools Menu and flash it directly from Arduino IDE.
Today I'm going to share with you how connect a ILI9341 TFT to an Arduino with IC CD4050 for level shifting. I will be using Arduino Nano but you can you use any other Arduino based board. 

Project Preview

Materials used:

- 2.2" ILI9341 TFT
- IC CD4050
- Arduino Nano
- Some wires

Explanation:
As mentioned before I will connect a ILI9341 TFT to Arduino and for help me doing that I will use IC CD4050 for level shifting from 5V to 3.3V. For the ones who doesn't know most Arduino boards operates with 5V logic and there are a lot of LCD like mine that only operate at 3.3V. For this situation you can do it as well with resistors and will accomplish the same result you just need to calculate the value of resistor that you need to use for level shifting from 5V to 3.3V.
CD4050
The image above represents the pinout of a CD4050 and as you can see it has 2 pins to power up the IC one for power(Vdd) and other for ground(Vss). The rest, despite of pins 13 and 16 that are NC pins, are in group of 2 pins where one is the input and the other is the output after the level shifting.

Schematic:
The image below is the schematic that I used to accomplish my objective and for better perception I created a table where you can see which Arduino pin connect LCD and where and if it goes through CD4050.

Schematic

   Arduino      CD4050   ILI9341 TFT
D4✓RESET
D5✓CS
D6✓D/S
3.3VxLED
D11✓MOSI
D12✓MISO
D13✓SCK
3.3VxVCC
Connections table
Code:
In this part we will need to add 2 external libraries to our Arduino IDE and you can download both from the links below:

- Adafruit GFX Library
- Adafruit ILI9341 Library

It is important to mention that any of the libraries that we will use were created by me. All the effort into both libraries is from  Adafruit.

After add both libraries it's time to see if everything is working. Just open Arduino IDE and go to File > Examples > Adafruit ILI9341 and open the sketch "graphicstest". Now you just need to do 2 small changes comment line 26 and uncomment line 28 and replace the LCD pins names for Arduino pin numbers that we used to connect it and you are ready to upload your sketch. You can see my final code bellow:

Demo:
After everything assemblied if everything went right you should get this:

Project Demo


Demo:
Description:
Simple project where I build a Mood Lamp with arduino.
Materials:
  • 1x Attiny85
  • 4x RGB LED (common anode)
  • 12x 220Ω Resistors
  • 1x Power Jack Female
Schematic:

Code:
You can get it from my repository here.