NRF24L01 Based Wireless Weather Station with DHT22 and 3.2″ TFT display

While IoT is awesome, there are situations where we do not necessarily want to connect the devices to the internet but connect them together. It could be a need for a local network of sensors to monitor certain parameters on a farm for instance. This kind of project will involve a base station connected wirelessly to sensors in the field. For today’s tutorial, we will demonstrate something similar to this scenario by building a wireless weather station with a remote sensing unit and a base station where the data is gathered.

For this tutorial, we will use the NRF24L01 low-cost (less than$3) ultra-low power, bi-directional transceiver module to communicate between the base station and the remote sensing unit. It is designed to operate within the 2.4GHz ISM band which means it can be used for projects with industrial, scientific and medical applications.  The module can achieve data rates as high as 2Mbits! and uses a high-speed SPI interface in order to communicate with the Arduino or other microcontrollers/development boards.

NRF24L01 module

As mentioned earlier, there are two parts to this project. The first one is the remote sensing unit which can be placed anywhere within the range 0f the NRF module. The remote sensing unit is made up of an Arduino Nano, a DHT22 temperature and humidity sensor and the NRF24L01 wireless transceiver module. It senses temperature and humidity from the environment every second and sends it via the NRF24L01 module to the base/monitoring station.

The second part is the base/monitoring station. The base/monitoring station receives weather data from the remote sensing unit and displays it on the attached 3.2″ Color TFT display. The station is built using the fast 32bit Arduino Due, a 3.2” Color TFT display, DS3231 real-time clock module, the NRF24L01 and a DHT22 temperature and humidity sensor which is used to determine temperature and humidity within the vicinity of the base/monitoring station. Asides the temperature and humidity from both the remote sensing unit and the DHT22 attached to the base station, the station also displays the current time and date sourced from the attached ds3231 RTC module. The data from the remote sensing unit is received by the base station every second to ensure a reliable communication link is established between the base station and the remote sensing unit.

At the end of this tutorial, you will know how to build a wireless weather monitoring station and how to use the NRF24L01 transceiver to send data between two Arduinos.

Required Components

The following components are required to build this project;

  1. Arduino Due
  2. Arduino Nano
  3. 3.2″ TFT display
  4. DHT22
  5. NRF24L01
  6. DS3231 RTC
  7. Small Breadboard
  8. Wires
  9. Header Pins
  10. Xiaomi Powerbank
Required Components

As usual, you can click on the links attached to each of the components to buy the exact one that was used for this tutorial.

Schematics

There are two schematics for this project. The first one is for the transmitter (i.e the remote sensing unit). As mentioned earlier, the remote sensing unit is made up of the DHT22, the NRF24L01 and the Arduino. Connect them as shown in the schematics below.

Schematics 1 (Remote sensing unit)

To make the schematics easier to follow, here is a map of the connections of between the Arduino and the other components.

NRF24L0 – ARDUINO NANO

GND - GND
VCC  - 3.3V
CE - D7
CS - D8
SCK - D11
MOSI - D12
MISO - D13

DHT22  ARDUINO NANO

VCC - VCC
GND - GND
DATA -  D4

Note that the VCC pin of the NRF24L01 module was connected to the 3.3V pin of the Arduino, not 5V. A picture of the transmitter’s schematics implementation is shown below.

Transmitter (Remote sensing unit)

The second schematic is that of the receiver (i.e the base/monitoring station). The 3,2″ TFT display used in this tutorial comes as a shield so all we need to do is to mount it on the Arduino. Asides this and the real-time clock, the connection of the receiver is quite similar to that of the transmitter. Connect the components as shown in the schematics below.

Schematics 2

As usual, the connections between the Arduino and the other components is further described below to make the schematics easier to follow.

NRF24L01 – ARDUINO DUE

VCC - 3.3V
GND - GND
CE - D6
CS - D7
SCK - 52
MOSI - 51
MISO - 50

DHT22 – ARDUINO DUE

VCC - VCC
GND - GND
DATA - D8

DS3231 – ARDUINO DUE

VCC - VCC 
GND - GND 
SDA - SDA
SCL - SCL

A picture of the receiver’s schematic implementation is shown below.

Receiver/ Base Station

Go over the connections once again to be sure everything is as it should be before proceeding to the next section. To better understand how to use the NRF24L01 module with the Arduino, you can check out one of our previous tutorials here.

Code

Just like we had with the schematics, we have two Arduino sketches for this project. One of them will be for the transmitter while the other one will be for the monitoring station.

We start with the code of the transmitter, as usual, by including the libraries that will be used for the project, which in this case are the RF24 library (for the NRF24L01), the DHT22 Library and the SPI library. The SPI library is included in the Arduino IDE while the rest can be downloaded via the links attached to them. With the libraries included, we declare the pins of the Arduino to which our DHT is connected and create an instance of the RF24 library stating the pins of the Arduino to which the CE and CS pins of the NRF are connected.

//Written by Nick Koumaris
//Info@educ8s.tv
#include "DHT.h"
#include <SPI.h>  
#include "RF24.h"
 
#define DHTPIN 4  
#define DHTTYPE DHT22

RF24 myRadio (7, 8);
byte addresses[][6] = {"0"};
const int led_pin = 13;

 

Next,  we create a struct package for organizing the data into packets to be sent by the NRF, after which we create an object of the DHT class passing the pin of the Arduino to which DHT pin is connected and the DHT TYPE as arguments.

struct package
{
  float temperature ;
  float humidity ;
};
typedef struct package Package;
Package data;
DHT dht(DHTPIN, DHTTYPE);

 

We proceed to the void setup() function. Here we initiate serial communication and also initialize DHT and NRF modules, setting the communication channel, signal power, and the data rate of the NRF.

void setup()
{
    Serial.begin(9600);
    pinMode(led_pin, OUTPUT);
    dht.begin();
    myRadio.begin();  
    myRadio.setChannel(115); 
    myRadio.setPALevel(RF24_PA_MAX);
    myRadio.setDataRate( RF24_250KBPS ) ; 
    myRadio.openWritingPipe( addresses[0]);
    delay(1000);
}

Finally, the loop() function. Here we read the values of temperature and humidity from the DHT and send it to the receiver using the NRF24L01. To show if there is a valid transmission, a LED connected to pin 13 is blinked.

void loop()
{
  digitalWrite(led_pin, HIGH); // Flash a light to show transmitting
  readSensor();
  Serial.println(data.humidity);
  Serial.println(data.temperature);
  myRadio.write(&data, sizeof(data)); 
  digitalWrite(led_pin, LOW);
  delay(1000);
}

that’s it for the transmitter. The complete code is shown below.

//Written by Nick Koumaris
//Info@educ8s.tv
#include "DHT.h"
#include <SPI.h>  
#include "RF24.h"

#define DHTPIN 4  
#define DHTTYPE DHT22 

RF24 myRadio (7, 8);
byte addresses[][6] = {"0"};
const int led_pin = 13;

struct package
{
  float temperature ;
  float humidity ;
};


typedef struct package Package;
Package data;

DHT dht(DHTPIN, DHTTYPE);

void setup()
{
    Serial.begin(9600);
    pinMode(led_pin, OUTPUT);
    dht.begin();
    myRadio.begin();  
    myRadio.setChannel(115); 
    myRadio.setPALevel(RF24_PA_MAX);
    myRadio.setDataRate( RF24_250KBPS ) ; 
    myRadio.openWritingPipe( addresses[0]);
    delay(1000);
}



void loop()
{
  digitalWrite(led_pin, HIGH); // Flash a light to show transmitting
  readSensor();
  Serial.println(data.humidity);
  Serial.println(data.temperature);
  myRadio.write(&data, sizeof(data)); 
  digitalWrite(led_pin, LOW);
  delay(1000);
}

void readSensor()
{
 data.humidity = dht.readHumidity();
 data.temperature = dht.readTemperature();
}

For the receiver, we will use the RTC library and the Modified Adafruit TFT LCD library in addition to the ones used for the transmitter.

After installing the libraries, the code starts the same way as that of the transmitter. We include the libraries, create objects of the libraries specifying the pin of the Arduino to which the components are connected and create variables that will be used in the code.

//Written by Nick Koumaris
//info@educ8s.tv

#include <TFT_HX8357_Due.h> // https://github.com/Bodmer/TFT_HX8357_Due
#include <Sodaq_DS3231.h>  //RTC Library https://github.com/SodaqMoja/Sodaq_DS3231
#include "DHT.h"          //https://github.com/adafruit/DHT-sensor-library
#include "RF24.h"        //https://github.com/TMRh20/RF24

#define DHTPIN 8  

#define DHTTYPE DHT22 
DHT dht(DHTPIN, DHTTYPE);

RF24 myRadio (6, 7);
byte addresses[][6] = {"0"};

TFT_HX8357_Due tft = TFT_HX8357_Due();       // Invoke custom library

float remoteHumidity = 0.0;
float remoteTemperature = 0.0;

String dateString;
String hours;
int minuteNow=0;
int minutePrevious=0;

Next, we create the struct package to receive the data sent from the transmitter.

struct package
{
  float temperature ;
  float humidity ;
};

The setup() function is next. We initialize the DHT, RTC and the display, setting the desired orientation for the screen and calling the function to display the User interface created to display the data in a nice way. After this, we connect to the transmitter using the START communication function.

void setup() {

  Serial.begin(9600);
  
  tft.init();
  tft.setRotation(1);
  tft.fillScreen(TFT_BLACK);
  delay(100);

  rtc.begin();
  dht.begin();
  delay(2000);
  //setRTCTime();

  startWirelessCommunication();
  printUI();
}

Next is the loop() function. We start by checking if data is sent after which we display the time, date, indoor temperature, indoor humidity, and the temperature and humidity from the remote sensing unit (outdoor). Other functions were used to make the code readable.

void loop() {

   checkForWirelessData();

   getAndPrintTime();
   
   printIndoorTemperature();
   printIndoorHumidity();

   printRemoteTemperature();
   printRemoteHumidity();
}

The complete code for the receiver is quite large. It is attached under the download section below along with the code for the transmitter.

Demo

Copy/download the code and upload to the corresponding Arduino setup. Go through each of the hardware setups carefully before plugging the Arduino board to be sure there is no short circuit and that everything is properly connected. With this done,  connect the board and upload the code. You should see the Screen come up as shown in the image below.

Demo

To reduce the amount of time the screen is refreshed and to avoid flickers, the receiver checks if there is a difference between the last received temperature or humidity value before updating the display. If there is a difference, the display is updated, but if the values are the same, the screen is left unchanged.

That’s it for this tutorial guys, thanks for reading. If you have any question or comments, do drop them under the comments section below.

Till next time!

The video version of this tutorial is available on youtube.

Zero BZ1 Arduino Board comes with SD and LiPo charger

One of the most beautiful things about using the Arduino ecosystem is its stackable ideology, where you can easily add new functionality to almost any Arduino board and make the bare metal Arduino board look so powerful. Hackers can decide to add an IoT add-on, SD storage add-on, or even a display add-on to a plain Arduino board. This is nice concept about the whole Arduino ecosystem but it can also bring up new challenges like:

  • Cost – The more add-ons you add, the more is the cost of the final device.
  • Power consumption – Since several people design add-ons, and some do have some unnecessary features, the power consumption of the device can easily significantly increase.
  • Size – Well, this is obvious. Final product becomes bigger and maybe sometimes not attractive or professional.
Typical Arduino UNO Shield

Of course, there are many ways around to solve these problems. You can get a board that houses most if not all the things you are going to need and thankfully there are many boards that offer several add-ons in one single board. One of my favorite boards of all time has been the Gboard from IteadStudio This is a fantastic board packed with so many things, but unfortunately, you really can’t use them all since you will quickly run out memory on the little Atmega 328P processor.

Zero BZ1, (Arduino-Compatible) with SD and LiPo charger
Zero BZ1 Board

Another interesting board I recently came across is the Zero BZ1, which is an Arduino Compatible board that comes with built-in SD card storage option and a LiPo charger, but most importantly it is inexpensive at least as compared to most boards.

The Zero BZ1 is Arduino Zero compatible since it runs on the same processor; the 32KB of SRAM and 256KB of flash memory ARM Cortex M0 microcontroller SAMD21G18. The inbuilt Lithium Polymer (LiPo) battery charger and regulator makes it ideal for battery-powered applications, combined with the SD card you will get a full powered device geared towards data logging application that can run autonomously for a long time.

It comes with a Micro SD slot, Real-time Clock (RTC), 10-bit DAC, Lipo regulator, USB for uploading and debugging, LED for indicator or debugging, an onboard temperature sensor and some decent number of IOs. Any attached LiPo battery can be charger using a USB or a 5v – 6v solar panel.

Below are some of the device specs:

  • Processor – ARM Cortex M0 microcontroller SAMD21G18
  • Memory – 32Kb of SRAM and 256KB of Flash
  • Operating Frequency – 48MHz
  • Others – PWM Supported – 20 PWM pins
    • 12bit A/D converters, 14
    • 10bit D/A converter, 1
    • I2C,  6
    • SPI, 6
    • UART, 6
    • Temperature sensor
    •  SD card Socket
    • AP2112 Voltage regulator 600mA
    • MCP73831 Li-Polymer Charge Management Controller
  • Dimension – 24mm x 54mm (0.94in X  2.14in)

An interesting possibility is combing the Zero BZ1 with anESP32, which will easily make it an ideal edge computing IoT device. The board is currently being crowdfunded on Kickstarter, and it goes for about $18. The Zero BZ1 Kickstarter campaign is running until January 14th. If you are lucky enough, you might be able to get the board for $14 as an early bird. The shipping is expected in March 2019.

DIY Pen/Laser Engraver ESP32 Controller

Buildlog.Net Blog published a new project. It’s an ESP32 Controller board used to control X/Y and Z axis of Pen or Laser engraving machines.

I have done several pen and laser machines lately, so I decided to create a custom PCB for Grbl_ESP32 for these types of machines. This is a small (70mm x 60mm) PCB with all the features a pen plotter or laser cutter/engraver would need.

These typically use stepper motors for the X and Y axes. On pen plotters, the Z axis is controlled by a servo or solenoid. On lasers you need an accurate PWM for laser power control.

DIY Pen/Laser Engraver ESP32 Controller – [Link]

World’s First 50W Seven-Die LED Emitter

LED Engin, an Osram business, has unveiled the LZ7 Plus, the world’s first 50W seven-die LED emitter. The trend in stage lighting fixtures has evolved from not only delivering ultra-bright light with narrow beam, but also creating more sophisticated color schemes and high CRI white. LZ7 Plus is uniquely designed to address this trend, featuring seven high-power dies in six colors, which can be individually controlled to deliver intense, saturated colors, as well as high quality white light as a result of color mixing. The LZ7 Plus can be used in various stage fixtures, such as static and moving head wash fixtures, as well as profile fixtures. 

The new LED features a 50W package with high-current red, green and blue dies, as well as cyan, two phosphor-converted lime dies and phosphor-converted amber die. The dies are closely packed in a low thermal resistance package with an integrated flat glass lens. The addition of high performance cyan, lime and amber to the traditional RGB color in a compact light-emitting surface of 3.4mm x 3.4mm, when coupled with secondary optics, produces an ultra-bright light with narrow beam, richer and wider color combination, as well as high CRI white, all from a single LED emitter.

To achieve this unprecedented performance, the underlying powerhouse is LED Engin’s proprietary LuxiGenTM platform. Featuring a patented multi-layer ceramic substrate technology, the platform allows all seven dies to be placed closely together, and delivers an ultra-low thermal resistance allowing heat to be dissipated efficiently from the dies.

There is growing demand for stage lighting with more sophisticated color requirements, without sacrificing brightness and beam quality,

said David Tahmassebi, CEO of LED Engin.

The LZ7 Plus offers an unparalleled combination of colors in a powerful, high quality package to deliver performance not seen before in stage lighting.

more information: www.osram-group.com

AMS AS7024 Vital Signs Sensor Module

New Vital Signs Sensor module enables highly accurate, fast and convenient cuffless 24/7 blood pressure, heart-rate (HRM), heart-rate variability (HRV), and electrocardiograms (ECG) measurement

New Vital Signs Sensor module enables highly accurate, fast and convenient cuffless 24/7 blood pressure, heart-rate (HRM), heart-rate variability (HRV), and electrocardiograms (ECG) measurement. The new module integrates all necessary hardware (LEDs, photo-sensor, analog front-end (AFE) and sequencer) and software components. In addition the module enables skin temperature and skin resistivity measurements. The AS7024’s low-power design and small from factor is well suited to application in fitness bands, smart watches and smart patches, in which board space is limited.

AS7024 Function Diagram
AS7024 Function Diagram

Key features

  • Single module integrated solution
  • Dimension 2.7mm x 6.1mm
  • Low noise Optical Front End
  • Low noise analog electrical front for ECG and additional measurements

Additional features

  • Single module integrated solution – 5 Photo Diodes (4 for PPG, 1 for Prox), 3 LEDs (2 green, 1 IR), Analog Front End
  • Dimension 2.7mm x 6.1mm
  • Low noise Optical Front End (Synchronous demodulators, Programmable sequencer & HP filter)
  • Low noise analog electrical front for ECG and additional measurements
  • Algorithms for HRM, motion compensation, blood pressure

The operation of the AS7024 is based on photoplethysmography (PPG) and electrocardiogram (ECG). PPG is the most used HRM method which measures the pulse rate by sampling light modulated by the blood vessels, which expand and contract as blood pulses through them. ECG is the reference for any measurement of the bio potential generated by the heart. The AS7024 is supported by algorithms converting the PPG and ECG readings into digital HRM, HRV and Blood Pressure values. The module includes the LEDs, photo-sensor, analog front-end (AFE) and sequencer as well as application software. In addition to HRM/HRV and Blood Pressure, the module also enables skin temperature and skin resistivity measurements by providing interfaces to external sensors. The AS7024’s low-power design and small from factor is particularly well suited to application in fitness bands, smart watches, sports watches and smart patches, in which board space is limited and in which users look for extended, multi-day intervals between battery recharges.

more information: ams.com

Garz and Fricke’s launches new SBC that runs Linux on i.MX6 ULL and i.MX6 Solo

Garz & Fricke is a German-based company, which deals with the production of single board computers (SBCs), embedded systems and smart vending machines. Ever since it was founded in 1992, the company has grown and is releasing two new IoT boards, a compact “Nallino Core” SBC and i.MX6 Solo based “Santvend Battery Core” SBC. The IoT boards will be distributed by a UK-based company called Crystal Display Systems (CDS) in Europe and in the UK.

The Nallino Core SBC is equipped with a Bluetooth 4.0 BLE module, a micro SD slot and a micro USB OTG port. Compared to the Santvend model which is equipped with the DDR 3L RAM, the Nallino core module uses DDR 3 RAM. It also has a Real Time Clock (RTC) and buzzers. The Nallino Core has been created to support Linux Operating systems however it also has the option of an Android operating system. As compared to other Linux driven compute modules, the Nallino SBC is slighter bigger than most of boards, it measures for about 113mm by 47mm by 18mm, and weighs 55 grams.

Specifications of the Nallino Core Module:

  • Operating Temperature: 0 to 60 degree Celsius
  • Storage Temperature: -20 to 70 degree Celsius
  • Type of CPU: i.MX6ULL
  • Core Type: ARM Cortex – A7
  • Memory: 4GB MLC eMMC
  • UART & SPI
  • Display: 24 – bit RGB TTL.
  • 1 speaker and extra buzzer interface.

Santvend Battery Core is an SBC built for the Internet of Things. Unlike the Nallino Core SBC, the Santvend Battery Core supports only Linux Yocto operating systems. However, it comes with a 3G/4G modem which makes it a good option for working on the Internet of Things (IoT) related projects.

The Santvend battery core comes with an optimized power management system with standby and wake from sleep functions, and it enables uninterrupted operation which is independent of the mains power supply. Fitted with a 3G/4G modem and MDB interface, SANTVEND core battery is ready for the Internet of Things. The platform is available in a version prepared specially for outdoor use. SANTVEND core battery can be operated by a 12V battery.

The board comes with an ARM Cortex –A9 and has i.MX6Solo as its CPU. It also comes with a real-time clock like the Nallino core. There is a micro-USB OTG, a micro SD slot, and HDMI ports. A 4GB MLC eMMC serves as the memory and 1GB 32 bit DDR2 as the RAM. The SBC provides a 1W speaker, mic interfaces, CAN for communication, LVDS for display.

The Nallino and Santvend Battery Cores are still under the coming soon class, but it is expected to be sold in Europe and the UK very soon. No information regarding the price has been made public yet or when it will. Further information about the boards can be found their product pages. Product for the Nallino SBC is here and the product page for the Santvend battery core is here.

TMP117 +/- 0.1°C accuracy temperature sensor

This device is the industry’s first to exceed Class-A platinum resistive temperature detector (RTD) medical grade accuracy across a wide temperature range. As a single-chip digital alternative to a platinum RTD, the TMP117 enables engineers to reduce system complexity and layout challenges, as well as slash power usage and extend battery life.

The TMP117 is a high-precision digital temperature sensor. It is designed to meet ASTM E1112 and ISO 80601 requirements for electronic patient thermometers. The TMP117 provides a 16-bit temperature result with a resolution of 0.0078°C and an accuracy of up to ±0.1°C across the temperature range of -20°C to 50°C with no calibration. The TMP117 has in interface that is I2C- and SMBus™-compatible, programmable alert functionality, and the device can support up to four devices on a single bus. Integrated EEPROM is included for device programming with an additional 48-bits memory available for general use.

The low power consumption of the TMP117 minimizes the impact of self-heating on measurement accuracy. The TMP117 operates from 1.8 V to 5.5 V and typically consumes 3.5 µA.

TMP117 Funtion Diagram
TMP117 Funtion Diagram

For non-medical applications, the TMP117 can serve as a single chip digital alternative to a Platinum RTD. The TMP117 has an accuracy comparable to a Class AA RTD, while only using a fraction of the power of the power typically needed for a PT100 RTD. The TMP117 simplifies the design effort by removing many of the complexities of RTDs such as precision references, matched traces, complicated algorithms, and calibration.

The TMP117 units are 100% tested on a production setup that is NIST traceable and verified with equipment that is calibrated to ISO/IEC 17025 accredited standards.

Features

  • TMP117 High Accuracy Temperature Sensor
    • ±0.1°C (Maximum) From –20°C to +50°C
    • ±0.15°C (Maximum) From –40°C to +70°C
    • ±0.2°C (Maximum) From –40°C to +100°C
    • ±0.25°C (Maximum) From –55°C to +125°C
    • ±0.3°C (Maximum) From –55°C to +150°C
  • Operating Temperature Range: –55°C to +150°C
  • Low Power Consumption:
    • 3.5-µA, 1-Hz Conversion Cycle
    • 150-nA Shutdown Current
  • Supply Range: 1.8 V to 5.5 V
  • 16-Bit Resolution: 0.0078°C (1 LSB)
  • Programmable Temperature Alert Limits
  • Selectable Averaging
  • Digital Offset for System Correction
  • General-Purpose EEPROM: 48 Bits
  • NIST Traceability
  • SMBus™, I2C Interface Compatibility

Learn more: www.ti.com/product/TMP117

source: www.oemsecrets.com

3.6A Bidirectional DC Motor Driver Shield for Arduino Nano

This is another Arduino Nano shield which can drive a Brushed DC Motor in both directions with PWM signal for speed control and it also includes current trip feature. Project is based on DRV8870 IC which can handle current up to 3.6Amps, The shield also includes an IR sensor and trimmer potentiometer. Trimmer Pot helps to develop speed motor control application, IR sensor can be used to make remote based DC motor driver. DRV8870 requires two PWM signals to control the motor speed and direction and both these pins are connected to D9 and D10 PWM pins of Arduino Nano.  Analog pin A0 connected to Trimmer Pot, digital pin D12 connected to IR sensor, two IN1 and IN2 PWM pins are connected to Digital PWM pin D9 and D10 of Arduino Nano. The board can drive brushed DC Motor up to 3.6Amp and voltage 6.5V to 12V DC.  This shield can drive higher voltage DC motor up to 45V with few changes. Remove R3 and D1 and use higher value and voltage rating capacitor C1 on motor supply. Trimmer potentiometer PR1 is used to adjust the maximum load trip current. For more information refer DRV8870 datasheet.

3.6A Bidirectional DC Motor Driver Shield for Arduino Nano – [Link]

3.6A Bidirectional DC Motor Driver Shield for Arduino Nano

This is another Arduino Nano shield which can drive a Brushed DC Motor in both directions with PWM signal for speed control and it also includes current trip feature. Project is based on DRV8870 IC which can handle current up to 3.6Amps, The shield also includes an IR sensor and trimmer potentiometer. Trimmer Pot helps to develop speed motor control application, IR sensor can be used to make remote based DC motor driver. DRV8870 requires two PWM signals to control the motor speed and direction and both these pins are connected to D9 and D10 PWM pins of Arduino Nano.  Analog pin A0 connected to Trimmer Pot, digital pin D12 connected to IR sensor, two IN1 and IN2 PWM pins are connected to Digital PWM pin D9 and D10 of Arduino Nano. The board can drive brushed DC Motor up to 3.6Amp and voltage 6.5V to 12V DC.  This shield can drive higher voltage DC motor up to 45V with few changes. Remove R3 and D1 and use higher value and voltage rating capacitor C1 on motor supply. Trimmer potentiometer PR1 is used to adjust the maximum load trip current. For more information refer DRV8870 datasheet.

A single-power input, VM Motor supply, serves as both device power and motor winding bias voltage. The integrated charge pump of the device boosts VM internally and fully enhances the high-side FETs. Motor speed can be controlled with pulse-width modulation, at frequencies between 0 to 100 kHz. The device has an integrated sleep mode that is enabled by bringing both inputs low. An assortment of protection features prevent the device from being damaged if a system fault occurs.

DRV8870 Description

The DRV8870 device is a brushed-DC motor driver for printers, appliances, industrial equipment, and other small machines. Two logic inputs control the H-bridge driver, which consists of four N-channel MOSFETs that can control motors directionally with up to 3.6-A peak current. The inputs can be pulse-width modulated (PWM) to control motor speed, using a choice of current-decay modes. Setting both inputs low enters a low-power sleep mode. The DRV8870 device features integrated current regulation, based on the analog input VREF and the voltage on the ISEN pin, which is proportional to motor current through an external sense resistor. The ability to limit current to a known level can significantly reduce the system power requirements and bulk capacitance needed to maintain stable voltage, especially for motor startup and stall conditions.

Features

  • Supply 6.5V to 12V DC
  • Motor Load Up to 3.6Amps
  • Over Load Current Facility
  • Over Load Trip Adjust Trimmer Pot
  • Trimmer Pot provided on Analog Pin A0 to make Motor Speed Controller
  • IR Sensor On D12 Digital Pin
  • PWM Frequency 0-100Khz
  • Motor Input Pin In1 and In2 Connected to D9 and D10 PWM Pins
  • PCB Dimensions 59.19mm X 38.15mm

Schematic

Parts List

Connections

Function Diagramm

H-Bridge States

Photos

Battery Management Deep Dive On-demand Technical Training

photo: sparkfun.com

This is a great collection of on-demand training on battery management solutions from Texas Instruments.

TI’s battery experts have decades of experience. Their battery scientists bring cutting-edge solutions for new battery chemistries & technologies, from charging, gauging, monitoring, protection and more. This technical training was especially developed for design engineers working with power supply for battery-powered systems. Additional resources and design tools are provided for each training to complete your training experience.

Table of Contents

  1. Battery management fundamentals
  2. Battery management tools: crash course
  3. Battery chargers: fundamentals
  4. Battery chargers: pick your application
  5. Battery chargers: “How to…” problem solvers
  6. Battery gauges: get started
  7. Battery gauges: get help for your device
  8. Battery monitors
  9.  Battery protection

Battery Management Deep Dive On-demand Technical Training – [Link]

TOP PCB Companies