element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Just Encase
  • Challenges & Projects
  • Design Challenges
  • Just Encase
  • More
  • Cancel
Just Encase
Blog Monitoring and Protection an Ecological Area #5 - Assembling and Adding LCD Display to the Transmitter
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Just Encase requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
Author: guillengap
Date Created: 17 Jan 2022 8:26 PM
Views: 424
Likes: 4
Comments: 2
  • Arduino MKR WAN 1300
  • lora
  • Monitoring and Protection an Ecological Area
  • just_encase
Related
Recommended

Monitoring and Protection an Ecological Area #5 - Assembling and Adding LCD Display to the Transmitter

guillengap
guillengap
17 Jan 2022

Table of Contents

  1. Project Introduction
  2. Getting Started
  3. Communication Between Two MKR WAN 1300
  4. LoRaWAN System Range Testing
  5. Assembling and Adding LCD Display to the Transmitter
  6. Assembling and Adding LCD Display to the Receiver
  7. LoRaWAN´s Field Test with a DS18B20 Sensor
  8. Adding Multiple Sensors: DS18B20, DHT22 and MQ-135
  9. Modifying Receiver Code for Multiple Sensors
  10. LoRaWAN´s Field Test with Multiple Sensors
  11. Connecting LoRaWAN to an IoT Provider through the Arduino NANO 33 IoT
  12. LoRaWAN and IoT Connection with a DS18B20 Sensor
  13. Testing LoRaWAN and IoT Connection with a DS18B20 Sensor
  14. LoRaWAN and IoT Connection with Multiple Sensors
  15. Testing LoRaWAN and IoT Connection with Multiple Sensors
  16. Project Report Updated

**********************************************************************************************************************

 Assembling and Adding LCD Display to the Transmitter

Assembling the transmitter

In the figure below I show the lid of the box to make the marks for the drill holes.

Now below we see how this piece was after drilling.

Once the holes are large enough, then it's time to attach the connectors.

In the figure below I show you the pieces that I print on the 3D printer. These pieces are used to fix the Arduino MKR WAN 1300 board and the LCD display.

In the image below you can see how to assemble the 16x2 LCD display that comes in the gift kit.

Then we fix the Arduino MKR WAN 1300 board, the 16x2 LCD display, the DS18B20 sensor and the antenna.

The transmitter would look like the figure below.

As a power supply I used a generic 5V Portable Charger Power Bank 16800 mAh. In addition to providing more accurate voltages, this device gave me better results since it has a power button, a voltage regulator and detects when a device is connected or not.

I also recommend using a heavy-duty USB to make a good connection

Schematic diagram

After adding the 16x2 display, the wiring diagram of the receiver is as shown below.

Code

All the information needed to install the library you can get in this link: Grove-LCD RGB Backlight Library from Github

After making these changes, the transmitter code is shown below: 

LoRaSender_v2.ino

// AUTHOR: GUILLERMO PEREZ GUILLEN

#include <SPI.h>
#include <LoRa.h>
#include <OneWire.h> // DS1B20->               
#include <DallasTemperature.h>
#include <Wire.h> // LCD->
#include "rgb_lcd.h"
rgb_lcd lcd;
const int colorR = 173;
const int colorG = 255;
const int colorB = 47;

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire); 

int counter = 0;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  lcd.setRGB(colorR, colorG, colorB);
  // Print a message to the LCD.
  lcd.print("ECOLOGY!");  
  lcd.setCursor(0, 1); // LCD 
  lcd.print("LoRa Sender");
  if (!LoRa.begin(915E6)) {
  lcd.setCursor(0, 1); // LCD 
  lcd.print("Starting LoRa failed!");    
    while (1);
  }
  sensors.begin();
}

void loop() {
  sensors.requestTemperatures();   //The command to read the temperature is sent
  int temp= sensors.getTempCByIndex(0); //The temperature is obtained in ยบC
  lcd.clear();
  lcd.setCursor(0, 0); // LCD 
  lcd.print("Packet:");    
  lcd.setCursor(8, 0); // LCD 
  lcd.print(counter);
  lcd.setCursor(0, 1); // LCD 
  lcd.print("Temp:");    
  lcd.setCursor(8, 1); // LCD 
  lcd.print(temp);
  // send packet
  LoRa.beginPacket();
  LoRa.print(temp);
  LoRa.endPacket();
  counter++;
  delay(4000);
}

Download section:

  • You can get the code from this post below:

assembling_and_adding_lcd_display_to_the_transmitter.zip

  • Below I attach the STL files used in this post:
stl_files.zip
Anonymous
  • guillengap
    guillengap 3 months ago in reply to skruglewicz

    I just updated my post and you can see the information and an image of the power supply that I used... Basically, I used a generic Portable Powerbank in the transmitter and an ANKER POWERCORE II 6700mAh Portable Powerbank in the receiver although there are already 25800mAh  in the market... The transmitter consumes more power so I recommend a good portable power bank. in my case the generic gave more power... Greetings

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • skruglewicz
    skruglewicz 3 months ago

    What are you using for power.

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube