RSS

Tag Archives: Sketch

First Steps with the Arduino-UNO R3 and NANO | Maker, MakerED, MakerSpaces, Coding | How-To transform an LCD1602 SPI Sketch to an LCD1602 I2C Sketch

First Steps with the Arduino-UNO R3 and NANO | Maker, MakerED, MakerSpaces, Coding | How-To transform an LCD1602 SPI Sketch to an LCD1602 I2C Sketch

.

Fritzing-Wiring

.


How-To transform an LCD1602 SPI Sketch to an LCD1602 I2C Sketch

We were already playing around, as seen on my tutorials below, with the Temperature/Humidity sensors DHT11, DHT22 and LCD1602, without I2C possibility. There were a lot of cables to connect, we will try out this time to use a LCD with I2C bus connection as it uses ONLY 4 wires to connect. It’s a perfect project for newbies in coding as they will see the measured values directly on the LCD screen, the success and happy factor is guaranteed!

Related tutorials:

 

Let us have first a look on the wiring (cabling) which is actually very easy, have a look below please:

.

Fritzing-Wiring

====> Click image, please, to enlarge.

The wiring (cabling) will take about +/- 5-10 minutes depending on your own rhythm… Let us have a look on the coding now: we will use exactly the same code (Sketch) as in our first tutorial here, which we will change just a bit to fit for I2C LCD1602 display:

Copy&Paste the code from above tutorial where it is marked “I also made an example where I display the results on a LCD. Here’s the source code of that example:” and paste it into the Arduino IDE. Connect the Arduino NANO with your computer now. Open the Arduino IDE and choose the board “Arduino NANO”, see screenshot below, please:

Arduino-IDE-Board Manager-1

Click image, please, to enlarge.

.

Next step, on the same Arduino IDE select the Processor:

.

Arduino-IDE-Board Manager-OLD-NEW-BOOTLOADER

Click image, please, to enlarge.

.

TIP: when the LED on the Arduino NANO is lightning GREEN it is an original NANO and you must choose “Atmega328P”; if the LED is lightning RED, it is a clone and you must choose “Atmega328P (Old Bootloader)”.

.

NOW it is about time to adapt the code (Sketch) to an I2C-LCD1602 display, let us have a look on the Sketch (the original):

.

OLD Code to change

Click image, please, to enlarge.

.

As we can see in line 10: the library is meant for a normal LCD display, it needs to get changed for a “I2C LCD Library”.

In line 15: the same it shows the wiring pins for a normal LCD display, it needs to get changed for a “I2C LCD” display.

In line19: It is BETTER to add as well the I2C-Address, mostly “0x27” OR “0x3F”.

That is NOT much to change, we will see in the screenshot below the How-To:

.

NEW Code to change

Click image please, to enlarge.

.

By enlarging (click on the image) you will see by comparing where the changes are. I commented in the lines the WHY… Try it out to change it yourselves or just download the Sketch (Code) here below who is working:

Copy&Paste this code into a NEW Sketch on the Arduino IDE and upload now the code to the Arduino NANO (or Arduino UNO) and enjoy it!

.

Stay tuned for next blog post(s) 😉

.


.

GUST-AVRIL2014-800px-2L’auteur Gust MEES est Formateur andragogique / pédagogique TIC, membre du “Comité Conseil” de “Luxembourg Safer Internet” (LuSI), appelé maintenant BEESECURE, partenaire officiel (consultant) du Ministère de l’éducation au Luxembourg du projet  ”MySecureIT“, partenaire officiel du Ministère du Commerce au Luxembourg du projet ”CASES” (Cyberworld Awareness and Security Enhancement Structure). L’auteur était aussi gagnant d’un concours en électronique en 1979 ( Pays germaniques ) et voyait son projet publié dans le magazine électronique “ELO”.


The author Gust MEES is ICT Course Instructor, ”Member of the Advisory Board” from “Luxembourg Safer Internet” (LuSI), BEESECURE, Official Partner (Consultant) from the Ministry of Education in Luxembourg, project “MySecureIT“, Official Partner from the Ministry of Commerce in Luxembourg, project “CASES” (Cyberworld Awareness and Security Enhancement Structure).

The author was also a winner of an electronics contest (Germanic countries) in 1979 and got his project published in the “Electronics Magazine ELO”.

.

.

Keywords necessary for me to create this blog post: Arduino UNO R3, Arduino NANO, UNO R3 Project, LCD 1602, Sensors, DHT11,  DHT22, Temperature/Humidity Sensor, coding, learning to learn, learning by doing, trouble shooting, hygrometer, I2C, LCD 20×4,  transforming normal LCD1602 Sketch into I2C Sketch

.

.

 

Tags: , , , , , , , , , , , , , , , ,

First Steps with the NodeMCU ESP8266 Wi-Fi Module | Maker, MakerED, Coding | Tips

First Steps with the NodeMCU ESP8266 Wi-Fi Module | Maker, MakerED, Coding | Tips

.

ESP8266-NodeMCU

.


First Steps with the NodeMCU ESP8266 Wi-Fi Module

Click image, please, to enlarge.

In our previous tutorials we were using already the NodeMCU ESP8266 Wi-Fi Module and we discussed about “Security“, “Cyber-Security” issues while using “IoT“, “Internet of Things” and the importance that the router MUST be protected by a NEW password and NOT ALLOW to let connect any devices to our router/internet, unless we decide to let them (ONLY our owns) connect!

Please check again the tutorials below:

It was a bit a difficult procedure to find out the “MAC Address” of the NodeMCU ESP8266 Wi-Fi Module, isn’t it?! Well there is a more easy way to find out with a little Sketch.

Please check the tutorial and copy the Sketch from:

Now it is much more easy to run a project with a NodeMCU ESP8266 Wi-Fi Module. Connect your module to the computer through the USB cable,  chose the board in the Arduino IDE and upload the sketch. Check below the how-to, please.

Click the image, please, to enlarge.

.

Please check again (I don’t want to reinvent the wheel…) the tutorial below who explains very well in detail:

Once having the “MAC Address” of our NodeMCU ESP8266 Wi-Fi Module we can now easily incorporate it into the allowed devices in our router.

.

NOW, click on the button “Add Wireless Device” as shown in above image.

.

Router-4

Click image, please, to enlarge.

.

A new window opens where you can add the new devices “MAC Address” which you wrote down before. Do so please and then click the button “OK“. Go back and have a look if the device is now in the authorized devices in your Network.

SO, now when you use a Sketch with “IoT” with the NodeMCU ESP8266 Wi-Fi Module, the device is recognized and allowed in your Network!

.


.

GUST-AVRIL2014-800px-2L’auteur Gust MEES est Formateur andragogique / pédagogique TIC, membre du “Comité Conseil” de “Luxembourg Safer Internet” (LuSI), appelé maintenant BEESECURE, partenaire officiel (consultant) du Ministère de l’éducation au Luxembourg du projet  ”MySecureIT“, partenaire officiel du Ministère du Commerce au Luxembourg du projet ”CASES” (Cyberworld Awareness and Security Enhancement Structure). L’auteur était aussi gagnant d’un concours en électronique en 1979 ( Pays germaniques ) et voyait son projet publié dans le magazine électronique “ELO”.


The author Gust MEES is ICT Course Instructor, ”Member of the Advisory Board” from “Luxembourg Safer Internet” (LuSI), BEESECURE, Official Partner (Consultant) from the Ministry of Education in Luxembourg, project “MySecureIT“, Official Partner from the Ministry of Commerce in Luxembourg, project “CASES” (Cyberworld Awareness and Security Enhancement Structure).

The author was also a winner of an electronics contest (Germanic countries) in 1979 and got his project published in the “Electronics Magazine ELO”.

.

Stay tuned for next blog post(s) 😉..
.

Keywords necessary for me to create this project: ESP8266, Wi-Fi module, ESP8266 and Adafruit Feather HUZZAH NOT the same pinout!!, where to buy?, Arduino IDE, web server, Coding, Maker, MakerED, MakerSpaces, IoT, Internet of Things, Router, 

.

.

.

.

.

.

 

Tags: , , , , , , , , , , , , , , , , ,