Book Image

Internet of Things Programming with JavaScript

Book Image

Internet of Things Programming with JavaScript

Overview of this book

The Internet of Things is taking the tech world by storm, and JavaScript is at its helm. This book will get you to grips with this exciting new technology. Where do Node.js, HTML5 and Windows 10 IoT Core come in with JavaScript and IoT? Why Raspberry Pi Zero rather than Arduino? How do you configure and build an IoT network from scratch? All your IoT JavaScript questions are answered in this book.
Table of Contents (15 chapters)
Internet of Things Programming with JavaScript
Credits
About the Author
www.packtpub.com
Customer Feedback
Preface

DS3231 module setup


The module DS3231 is a real-time clock. It can be used to get the time and date from an integrated circuit, so it can work with your system to control specific events that you want to program from an embedded chip. It can work perfectly with the Raspberry Pi Zero in order to get the time and date in real time.

You need to be sure that you have the latest updates. To do that, type the following commands in your terminal:

sudo apt-get update
sudo apt-get -y upgrade

Modify the system file with the following command:

sudo nano /etc/modules

Add the following lines to the modules.txt file:

snd-bcm2835 
i2c-bcm2835 
i2c-dev 
rtc-ds1307

Hardware setup

In this section, we will look at the pins of the RTC module:

DS3231   Pi GPIO 
GNDP     1-06 
VCC      (3.3V) 
SDA      (I2CSDA) 
SCL      (I2CSCL)

This is the RTC module, and we can see the pins of the chip:

The following diagram shows, the circuit connection:

The following image shows the final connection...