You are on page 1of 51

Arduino and Raspberry Pi Sensor

Projects for the Evil Genius 1st Edition


Chin
Visit to download the full and correct content document:
https://ebookmass.com/product/arduino-and-raspberry-pi-sensor-projects-for-the-evil-
genius-1st-edition-chin/
Arduino and Raspberry Pi Sensor
Projectsfor the Evil Genius™
Arduino and Raspberry Pi Sensor
Projects for the Evil Genius™

Robert Chin

New York Chicago San Francisco Athens London Madrid


Mexico City Milan New Delhi Singapore Sydney Toronto
Library of Congress Control Number: 201794884

McGraw-Hill Education books are available at special quantity discounts to use as premiums and sales
promotions or for use in corporate training programs. To contact a representative, please visit the Contact
Us page at www.mhprofessional.com.

Arduino and Raspberry Pi Sensor Projects for the Evil Genius™

Copyright © 2018 by McGraw-Hill Education. All rights reserved. Printed in the United States of America.
Except as permitted under the United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without
the prior written permission of the publisher.

McGraw-Hill Education, the McGraw-Hill Education logo, Evil Genius and TAB, and related trade dress
are trademarks or registered trademarks of McGraw-Hill Education and/or its affiliates in the United States
and other countries and may not be used without written permission. All other trademarks are the property
of their respective owners. McGraw-Hill Education is not associated with any product or vendor mentioned
in this book.

1 2 3 4 5 6 7 8 9 DSS 22 21 20 19 18 17

ISBN 978-1-260-01089-3
MHID 1-260-01089-9

e-ISBN 978-1-260-01090-9
e-MHID 1-260-01090-2

This book is printed on acid-free paper.

Sponsoring Editor
Michael McCabe
Editorial Supervisor
Donna M. Martone Production Supervisor
Lynn M. Messina

Acquisitions Coordinator
Lauren Rogers
Project Manager
Patricia Wallenburg, TypeWriting

Copy Editor
James Madru

Proofreader
Claire Splan

Indexer
Claire Splan
Art Director, Cover
Jeff Weeks

Composition
TypeWriting

Information contained in this work has been obtained by McGraw-Hill Education from sources believed to
be reliable. However, neither McGraw-Hill Education nor its authors guarantee the accuracy or
completeness of any information published herein, and neither McGraw-Hill Education nor its authors shall
be responsible for any errors, omissions, or damages arising out of use of this information.
About the Author

Robert Chin has a Bachelor of Science degree in computer engineering and is


experienced in developing projects on the TI CC3200 SimpleLink, Android,
Arduino, Raspberry Pi, and PC Windows platforms using C/C++, Java, Python,
Unreal Script, DirectX, OpenGL, and OpenGL ES 2.0. He is the author of Home
Security System DIY PRO Using Android and TI CC3200 SimpleLink, Home
Security Systems DIY Using Android and Arduino, and Beginning Arduino
ov7670 Camera Development. He is also the author of Beginning Android 3d
Game Development and Beginning IOS 3d Unreal Games Development, both
published by Apress, and was the technical reviewer for UDK Game
Development, published by Course Technology CENGAGE Learning. Beginning
Android 3d Game Development was licensed to Tsinghua University through
Tsinghua University Press.
Contents

1 Introducing the Arduino and Raspberry Pi


What Is an Arduino?
Arduino Uno
Arduino Uno Specifications
Arduino Uno Components
Arduino Development System Requirements
Arduino IDE Software
Hands-on Example:
A Simple Arduino “Hello World” Program with a LED
Playing Around with the Code
What Is Raspberry Pi?
Raspberry Pi 3 Hardware Overview
Raspberry Pi System Setup
Python IDLE Development Environment
Hands-on Example:
A Simple Raspberry Pi “Hello World” Program with a LED
Summary

2 Arduino and Raspberry Pi Programming Language Basics


Overview of the C/C++ Language for the Arduino
Object-Oriented Programming
Overview of Python for Raspberry Pi
Python Functions
Python Modules
Python Class Overview
Python Class Inheritance
Summary

3 Basic Electrical Components


Electronics Basics
Resistor
LEDs
Piezo Buzzer
Potentiometer
Push Buttons
Breadboards
Hands-on Example:
Arduino Serial Monitor and LED Indicator
Hands-on Example:
Arduino RGB LED
Hands-on Example:
Arduino LED Buzzer Siren
Hands-on Example:
Arduino Random RGB LED Colors Using a Potentiometer
Hands-on Example:
Arduino RGB Light Switch
Hands-on Example:
Raspberry Pi LED Blinker Counter
Hands-on Example:
Raspberry Pi LED Fading
Hands-on Example:
Raspberry Pi RGB LED Color Selector
Hands-on Example:
Raspberry Pi LED Fading Up and Down Using a Button
Summary

4 Touch Sensor Projects


Analog Joystick
Hands-on Example:
Arduino Joystick Test
Hands-on Example:
Arduino “Simon Says” Game
Running the Program
Rotary Encoder Controller (KY-040)
Hands-on Example:
Arduino Rotary Encoder Test
Hands-on Example:
Arduino Rotary Encoder Controlling an RGB LED
Hands-on Example:
Raspberry Pi Rotary Encoder Test
Hands-on Example:
Raspberry Pi Rotary Encoder LED Blinker
Summary

5 Environmental Sensor Projects I


Reed Switch Magnetic Field Sensor
Hands-on Example:
Arduino Reed Switch Test
Hands-on Example:
Arduino Door Buzzer Alarm
Hands-on Example:
Raspberry Pi Reed Switch Test
Hands-on Example:
Raspberry Pi Reed Switch Door Alarm
TMP36 Temperature Sensor
Hands-on Example:
Arduino TMP36 Temperature Sensor Test
Flame Sensor
Hands-on Example:
Arduino Flame Sensor Test
Hands-on Example:
Arduino Fire Alarm
Hands-on Example:
Raspberry Pi Flame Sensor Test
Hands-on Example:
Raspberry Pi Fire Alarm
Infrared Proximity/Collision Sensor
Hands-on Example:
Arduino Infrared Proximity/Collision Detector
Hands-on Example:
Raspberry Pi Infrared Collision/Proximity Sensor Alarm
Temperature and Humidity Sensor (DHT11)
Hands-on Example:
Arduino DHT11 Temperature and Humidity Sensor Test
Summary

6 Environmental Sensor Projects II


Water Detector/Soil Moisture Sensor
Hands-on Example:
Arduino Water Detector Alarm
Hands-on Example:
Arduino Soil Moisture Detector
Light Detector (Photo Resistor)
Hands-on Example:
Arduino Rooster Alarm
Sound Detector
Hands-on Example:
Arduino Light Clapper
Hands-on Example:
Raspberry Pi “Out of Breath” Game
Summary

7 Human Sensor Projects


Hands-on Example:
Arduino Glass Break Alarm
Hands-on Example:
Raspberry Pi Glass Break Alarm
HC-SR501 Infrared Motion Detector
Hands-on Example:
Arduino Infrared Motion Detector Alarm
Hands-on Example:
Raspberry Pi Infrared Motion Detection Alarm
HC-SR04 Distance Sensor
Hands-on Example:
Arduino HC-SR04 Distance Sensor Intruder Alarm
Hands-on Example:
Arduino Collision Alarm
Summary

8 Arduino TFT LCD Display and Image Sensor Projects


Arduino TFT LCD Color Display Screen with SD Card Reader/Writer
Hands-on Example:
Arduino TFT Display and SD Card Reader/Writer Test
Hands-on Example:
Arduino TFT Display Door Entry Alarm with SD Card Logging
Arduino Cameras
Hands-on Example:
Arduino ArduCAM OV2640 Mini Portable Programmable Digital Camera
System
Summary
Index
CHAPTER 1
Introducing the Arduino and Raspberry Pi

THIS CHAPTER WILL INTRODUCE YOU to the Arduino and the Raspberry Pi. First, I
give a brief explanation of what the Arduino is. Then I specifically address the
Arduino Uno, discussing its general features, including its capabilities and key
functional components. This is followed by a discussion of the Arduino
Integrated Development Environment (IDE) software, which is needed to
develop programs for the Arduino. Each key function of the Arduino IDE is
reviewed, followed by a hands-on example giving detailed step-by-step
instructions on how to set up the Arduino for development and how to run and
modify an example program using the Arduino IDE. Next comes the Raspberry
Pi. I discuss what the Raspberry Pi is and the specifications for the Raspberry Pi
3. This section tells you how to set up the Raspberry Pi before using it for the
first time. Raspberry Pi hardware features are addressed, including the general
purpose input-output (GPiO) pin specifications. The final section includes a
hands-on example of how to control a light-emitting diode (LED) using the
Raspberry Pi.

What Is an Arduino?
The Arduino is an open-source microcontroller that uses the C and C++
languages to control digital and analog outputs to devices and electronic
components and to read in digital and analog inputs from other devices and
electronic components for processing. For example, an Arduino can read a signal
from a sensor in a home security system that detects the heat that a human being
emits. The sensor sends a signal to the Arduino indicating that a person is in the
home. After receiving this information, the Arduino can send commands to a
camera such as the ArduCAM Mini digital camera to start taking pictures of the
intruder. There are many different Arduino models out there. However, to create
the examples in this book, you will need an Arduino model with enough pins to
connect the components you desire, such as a camera, Bluetooth adapter, and/or
motion sensor. Figure 1-1 shows the official Arduino logo.

Figure 1-1 Official Arduino logo.

Note: The official website of the Arduino is www.arduino.cc.

Arduino Uno
There are a great many Arduino products out there, ranging from models that are
small and can actually be worn by the user to models with many digital and
analog input-output pins. For the projects in this book, I recommend the Arduino
Uno, which is an open-source microcontroller that has enough digital ports to
accommodate a camera, a Secure Digital (SD) card reader/writer with enough
digital and analog ports for other devices, sensors, lights, and any other gadgets
that you may require for your own custom projects. The official Arduino Uno
board is made by a company called Arduino SRL, formerly Smart Projects,
formed by one of the founders of the Arduino (Figure 1-2). The newer official
Arduino Uno boards are slightly different in that they are more blue-green
instead of blue in color and contain the Genuino logo under the main Arduino
logo. The Genuino trademark is used outside the United States as a result of the
split between Arduino founders.
Figure 1-2 The official Arduino Uno.

There are also unofficial Arduino Uno boards made by other companies. A
good way to tell whether a board is official or unofficial is by the color of a
component that is located near the Arduino’s USB port. This component on an
official Arduino board is a metallic gold color. The component on an unofficial
board is green. The writing on the components also differs (Figure 1-3).
Figure 1-3 Metallic gold colored component on an official Arduino Uno board.

A number of other companies also manufacture Arduino Uno boards.


Because the Arduino is an open-source item, other companies can legally
manufacture the board, and the boards vary in quality and price. Generally, an
unofficial Arduino Uno costs around $10, and an official Arduino Uno costs
around $20. The distinguishing parts of an official Arduino board are the golden
component and the high-quality Arduino and Genuino logos printed on the board
(Figure 1-4).
Figure 1-4 Key parts of an official Arduino Uno.

Arduino Uno Specifications


Microcontroller: ATmega328P
Operating voltage: 5 V
Input voltage (recommended): 7–12 V
Input voltage limit: 6–20 V
Digital I/O pins: 14 (of which 6 provide PWM output) PWM digital I/O pins:
6
Analog input pins: 6
DC current per I/O pin: 20 mA DC current for 3.3-V pin: 50 mA Flash
memory: 32 kB (ATmega328P) (of which 0.5 kB used by boot loader)
SRAM: 2 kB (ATmega328P) EEPROM: 1 kB (ATmega328P) Clock
speed: 16 MHz Length: 68.6 mm Width: 53.4 mm Weight: 25 g

Arduino Uno Components


This section covers the functional components of the Arduino Uno.

USB Connection Port


The Arduino Uno has a USB connector that is used to connect the Arduino to the
main computer development system via standard USB A male to B male cable
so that it can be programmed and debugged (Figure 1-5).

Figure 1-5 USB connector.

9-V Battery Connector


The Arduino Uno has a 9-V battery connector where you can attach a 9-V
battery to power the Arduino (Figure 1-6).
Figure 1-6 Arduino Uno 9-V battery connector.

Reset Button
There is a Reset button on the Arduino Uno that you can press to reset the board.
This restarts the program contained in the Arduino’s memory (Figure 1-7).

Figure 1-7 Arduino Uno Reset button.

Digital Pins
The Arduino Uno has many digital pins capable of simulating analog output
through the process of pulse-width modulation (PWM). For example, a LED
light generally has only two modes: on (full brightness) and off (no light
emitted). However, with digital PWM, the LED light can appear to have a
brightness in between on and off. For instance, with PWM, a LED can start from
an off state and slowly brighten until it is at its highest brightness level and then
slowly dim until back to the off state. The digital pins on the Arduino Uno are
pins 0 through 13. These PWM-capable digital pins are circled in Figure 1-8.

Figure 1-8 Arduino Uno digital pins.

Communication
The communication section of the Arduino Uno contains pins for serial
communication between the Arduino and other devices, such as a Bluetooth
adapter or a personal computer. The Tx0 and Rx0 pins are connected to the USB
port and are used for communication between your Arduino and your computer
by means of a USB cable. The Serial Monitor that can be used for sending data
to the Arduino and reading data from the Arduino uses the Tx0 and Rx0 pins.
Thus you should not connect anything to these pins if you want to use the Serial
Monitor to debug your Arduino programs or to receive user input (Figure 1-9). I
will talk more about the Serial Monitor later in this book.
Figure 1-9 Arduino Uno serial communication.

The I2C interface consists of an SDA pin (which is pin 4) that is used for
data and an SCL pin (which is pin 5) that is used for clocking or driving the
device or devices attached to the I2C interface. The SDA and SCL pins are
circled in Figure 1-10.
Figure 1-10 Arduino Uno I2C interface.

Analog Input
The Arduino Uno has six analog input pins that can read in a range of values
instead of just digital values of 0 or 1. The analog input pin uses a 10-bit analog-
to-digital converter to transform voltage input in the range of 0 to 5 V into a
number in the range between 0 and 1,023 (Figure 1-11).
Figure 1-11 Arduino Uno analog input.

Power
The Arduino Uno has outputs for 3.3 and 5 V. One section that provides power is
located on the side of the Arduino. You can also provide a separate power source
by connecting the positive terminal of the power source to the Vin pin and the
ground of the power source to the Arduino’s ground. Make sure that the voltage
being supplied is within the Arduino’s voltage range (Figure 1-12).
Figure 1-12 Arduino Uno 3.3- and 5-V power outputs.

The ground connections on the Arduino Uno are shown circled in Figure 1-
13.
Figure 1-13 Arduino Uno ground connections.

Arduino Development System Requirements


Arduino projects can be developed on Windows, Mac, and Linux operating
systems. The software needed to develop programs that run on the Arduino can
be downloaded from the main website at www.arduino.cc/en/Main/Software.
The following is a summary of the different types of Arduino IDE
distributions that are available for download. You will only need to download
and install one of these files. The file you choose will depend on the operating
system your computer is using.

Windows
Windows Installer. This is an .exe file that must be run to install the Arduino
IDE.
Windows zip file for non-administrator install. This is a zip file that must be
uncompressed in order to install the Arduino IDE. 7-zip is a free file
compression and uncompression program available at www.7-zip.org that can
be used to uncompress this program.

An Important Note: For Windows XP, I recommend the 1.0.5 r2 version of the Arduino IDE.
Later versions may not be stable and may terminate unexpectedly, behave erratically, or
may not be able to compile Arduino source code.

Mac
Mac OS X 10.7 Lion or newer. This is a zip file that must be uncompressed
and installed for users of the Mac operating system.

Linux
Linux 32 bits. Installation file for the Linux 32-bit operating system.
Linux 64 bits. Installation file for the Linux 64-bit operating system.
The easiest and cheapest way to start Arduino development is probably by
using the Windows version on an older operating system such as Windows XP.
In fact, the examples in this book were created using the Windows version of the
Arduino IDE running on Windows XP. There are in fact many sellers on Ebay
from whom you can buy a used Windows XP computer for around $50 to $100.
If you are starting from scratch and are looking for an inexpensive development
system for the Arduino, consider buying a used computer with Windows XP. The
only caution is that support for Windows XP has ended in the United States and
some other parts of the world. In China, Windows XP may still be supported
with software updates such as security patches.

Arduino IDE Software


Arduino IDE is the program used to develop the program code that runs on and
controls the Arduino. For example, to have your Arduino control the lighting
state of a LED, you will need to write a computer program in C/C++ using the
Arduino IDE. Then you will need to compile the program into a form that the
Arduino is able to execute and then transfer the final compiled program using
the Arduino IDE. From there the program automatically executes and controls
the LED that is connected to the Arduino.
New versions of the Arduino IDE are compiled daily or hourly and are
available for download. Older versions of the IDE are also available for
downloading at www.arduino.cc/en/Main/OldSoftwareReleases.
This section discusses the key features of the Arduino IDE software. The
IDE you are using may be slightly different from the version discussed in this
section, but the general functions should still be the same. I won’t go in depth
into every detail of the IDE because this section is meant as a quick-start guide
and not a reference manual. I will cover the critical features of the Arduino IDE
that you will need to get started on the projects in this book (Figure 1-14).
Figure 1-14 The Arduino IDE.

The Verify button checks to see whether the program you have entered into
the Arduino IDE is valid and without errors (Figure 1-15). These uncompiled
programs are called sketches.
Figure 1-15 The Verify button.

The Upload button first verifies that the program in the IDE is a valid C/C++
program with no errors, compiles the program into a form the Arduino can
execute, and then finally transfers the program via the USB cable connected to
your computer to your Arduino board (Figure 1-16).

Figure 1-16 The Upload button.

The New File button creates a new blank file or sketch inside the Arduino
IDE, where you can create your own C/C++ program for verification,
compilation, and transfer to the Arduino (Figure 1-17).

Figure 1-17 The New File button.

The Open File button is used to open and load the Arduino C/C++ program
source code from a file or load various sample source codes from example
Arduino projects that are included with the IDE (Figure 1-18).
Another random document with
no related content on Scribd:
CONSTITUTION OF BELGIUM:
The working of its' electoral provisions.

See (in this volume)


BELGIUM: A. D. 1894-1895; and 1899-1900.

CONSTITUTION OF CUBA:
The grant of autonomous government by Spain in 1897.

See (in this volume)


CUBA: A. D. 1897 (NOVEMBER);
and 1897-1898 (NOVEMBER-FEBRUARY).

CONSTITUTION OF CUBA:
Outline of the draft reported to the Convention of 1900-1901.

See (in this volume)


CUBA: A. D. 1901 (JANUARY).

CONSTITUTION OF DELAWARE, New.

See (in this volume)


DELAWARE: A. D. 1897.

CONSTITUTION OF IDAHO:
Adoption of Woman Suffrage.

See (in this volume)


IDAHO: A. D. 1896.

CONSTITUTION OF LOUISIANA:
Its discriminating educational qualification.

See (in this volume)


LOUISIANA: A. D. 1898.
CONSTITUTION OF MEXICO: Amendments.

The text of the constitution of Mexico, as published in 1891,


will be found in volume 1 [page 558] of this work, under the
same heading as above. In 1896, the Constitution received two
amendments promulgated by decrees published in the "Diario
Official" on the 24th of April and the 1st of May in that
year. Translations of these decrees were transmitted to the
State Department at Washington by the United States Minister
to Mexico and published in U. S. Consular Reports, July, 1896,
from which source they are copied below. That of April 24 was
as follows:

The Congress of the United Mexican States, in the exercise of


the power which article 127 of the federal constitution
concedes to it, and with the previous approbation of the
majority of the legislatures of the States, declares articles
79, 80, 82, and 83 of the constitution to be amended and an
addition to article 72 of the same, in the following tenor:

ARTICLE. 72. Congress has power:

XXXI. To appoint, both houses of Congress being assembled for


such purpose, a President of the Republic, either with the
character of substitute or with that of ad interim, to act in
the absolute or temporary defaults of the constitutional
President. Likewise, to replace in the respective cases and in
equal form the substitute as well as the ad interim, if these
in their turn should default.

XXXII. To qualify and to decide upon the petition for leave of


absence that the President of the Republic may make. It is the
exclusive faculty of the House of Deputies—II. To qualify and
decide upon the resignations of the President of the Republic
and of the magistrates of the supreme court of justice.

{165}
ARTICLE 79.

I. In the absolute defaults of the President, excepting that


arising from resignation, and in the temporary defaults,
excepting that proceeding from permission, the Secretary of
Foreign Relations, and in case there be none or if there
exists an impediment, the Secretary of Government shall take
immediate charge of the Executive power.

II. The Congress of the union shall assemble in an


extraordinary session the following day, in the Chamber of
Deputies, more than half of the total number of members of
both houses being present, the officers of the House of
Deputies acting. If no session can be had on account of no
quorum or for other cause, those present shall compel, from
day unto day, the presence of the absentees, in accordance
with the law, so as to hold the session as soon as possible.

III. In this session, the substitute President shall be


elected by the absolute majority of those present, and in a
nominal and public vote, without any proposition being
discussed therein nor anything else done but to take in the
votes, publish them, and make a close examination and publish
the name of the one elected.

IV. If no one of the candidates should have received the


absolute majority of the votes, the election shall be repeated
as to the two who had the greater number of votes, and the one
receiving the majority will be elected. If the competitors
should have received an equal number of votes, and on a
repetition of the election an equal result shall be obtained,
then the drawing of lots shall decide the one who must be
elected.

V. If there be an equality of votes for more than two


candidates, the election as to which of these shall be made,
but if at tho same time there is another candidate who may
have obtained a majority of votes, he shall be considered as
first competitor, and the second shall be chosen by votes out
of the first mentioned.

VI. If Congress be not in session, it shall meet, without the


necessity of a convocation, on the fourteenth day following
that of the default, under the direction of the board of
permanent commission which may be in duty, and shall proceed
as already stated.

VII. In case of absolute default caused by the renouncement of


the President, Congress shall convene in the form set forth
for the appointment of the substitute, and the resignation
shall not take effect until the appointment of the substitute
and of the legal protest by him.

VIII. In relation to temporary defaults, from whatever cause,


Congress shall appoint an ad interim President, observing for
this purpose the same procedure as prescribed for the cases of
absolute default. Should the President ask for leave of absence,
he will, at the time of so doing, propose the citizen who must
take his place; the permission being granted, it will not take
effect until the ad interim (president) shall have protested,
it being within the President's faculty to make use or not of
said leave, or to lessen its duration. The ad interim shall
only exercise the functions during the time of temporary
default. The petition for permission shall be addressed to the
House of Deputies, who shall at once deliver it to the proper
commission for its perusal, at the same time summoning the
Senate for an extraordinary session of Congress, before which
the commission shall render its decision. The proposition with
which the decision may end, if favorable, shall comprise in a
decree of a sole article the granting of the permission and
the approval of the proposition, which shall be decided upon
only by one ballot.
IX. If, on the day appointed by the constitution, the people's
President-elect shall not enter into the discharge of his
office, Congress shall at once appoint an ad interim
President. If the cause of the impediment be transitory, the
ad interim shall cease in the Presidential functions when said
cause ceases and the President-elect enters into the discharge
of his functions. But, should the cause be of that kind that
produces absolute impossibility, so that the President-elect
cannot enter into the exercise of power during the four years,
Congress, after appointing the ad interim President, shall,
without delay, convoke the extraordinary elections. The ad
interim President shall cease in his functions as soon as the
new President-elect protests, and this shall complete the
constitutional period. Should the impediment arise from the
fact that the election be not made or published on the 1st of
December, a President ad interim shall also be appointed, who
will discharge the Presidential duties until those requisites
are complied with and the President-elect takes due protest.

X. The defaults of the substitute President and those of the


ad interim shall also be remedied in the manner prescribed,
except in regard to the second, in the case when the
constitutional President, who, having temporarily separated
himself, may again assume the exercise of his duties.

ARTICLE 80.
Should the default of the President be absolute, the
substitute appointed by Congress shall terminate the
constitutional period.

ARTICLE 82.
The President, upon taking possession of his office, shall
swear before Congress under the following formula:

"I protest to perform loyally and patriotically the functions


of President of the United Mexican States; to keep and cause
to be kept, without any reserve, the constitution of 1857,
with all its additions and reforms, the laws of reform, and
all those laws emanating therefrom, watching everything for
the good and prosperity of the union." The Secretary of
Department, who may take provisional charge of the Executive
power, in its case, is exempted from this requisite.

The decree of May 1, 1896, was as follows:

The Congress of the Union has decreed the following: The


General Congress of the United Mexican States, in conformity
with the provisions of article 127 of the federal
constitution, and with the previous approbation of the State
legislatures, declares articles 111 and 124 of said
constitution amended and an addition made to same in the
following terms:

First.
Section III. of article 111 of the federal constitution is
amended, and an addition made to the said article in the
following terms: The States shall not—

III. Coin money, issue paper money, stamps, or stamped paper.

IV. Obstruct the transit of persons or goods crossing its


territory.

V. Prohibit or molest, either directly or indirectly, the


entrance or exit, to or from its territory, of national or
foreign merchandise.

{166}

VI. Obstruct the circulation or consumption of national or


foreign goods by means of imposts or taxes that may be exacted
through local custom-houses, by requiring the inspection or
registration of packages, or by requiring the documentation to
accompany the merchandise.
VII. Decree or maintain in force laws or fiscal decrees which
may cause differences of taxes or requisites, by reason of the
source of national or foreign merchandise, whether these
differences be established in regard to a like production in
that locality or on account of like production from different
sources.

Second.
Article 124 of the federal constitution is amended in the
following terms:

ARTICLE 124.
It is the exclusive faculty of the federation to obstruct
merchandise, imported or exported, or which passes in transit
through the national territory, likewise to regulate at all
times, and even to prohibit for reasons of policy and
security, the circulation within the Republic of all
merchandise from whatever source; but the said federation
cannot establish or decree in the district or federal
territories the taxes and laws expressed in Sections VI. and
V. of Article 111.

Transitory article.
These amendments and additions shall take effect on the 1st of
July, 1896.

CONSTITUTION OF MINNESOTA: Amendments.

See (in this volume)


MINNESOTA: A. D. 1896.

CONSTITUTION OF MISSISSIPPI: Amendment.

See (in this volume)


MISSISSIPPI: A. D. 1890-1892.
CONSTITUTION OF NEW JERSEY: Proposed Amendments.

See (in this volume)


NEW JERSEY: A. D. 1897.

CONSTITUTION OF NEW YORK.

The constitution of the State of New York, as revised by the


Convention of 1894 (see, in volume 4, NEW YORK: A. D. 1894)
[transcriber's note: volume 3, page 2350], was submitted to
the people at the election in November that year and adopted.
The important features of the revision were set forth in an
address by the Convention to the people, as follows:

"We seek to separate, in the larger cities, municipal


elections from State and national elections to the end that
the business affairs of our great municipal corporations may
be managed upon their own merits, uncontrolled by national and
State politics. … We have provided further safeguards against
abuses in legislative procedure, by requiring that all bills
shall be printed in their final form at least three days
before their passage, prohibiting riders on appropriation
bills, providing for notice to municipal authorities before
special acts relating to the larger cities can take effect,
prohibiting the issue of passes by railroad, telegraph and
telephone companies to public officers, enlarging the express
constitutional powers of the President of the Senate. … We
have extended the prohibition against lotteries so as to
include all pool-selling, book-making and other forms of
gambling. … We have sought to throw greater safeguards around
the elective franchise by prescribing a period of ninety
instead of ten days of citizenship before that right can be
exercised, so that naturalization may be taken out of the
hands of campaign committees and removed from the period
immediately before election. … We have modified the language
relating to election so that if any mechanical device for
recording and counting votes is so perfected as to be superior
to the present system, the Legislature may make trial of it. We
have established in the Constitution the well-tried and
satisfactory system of registration of votes, forbidding,
however, any requirement of personal attendance on the first
day of registration in the thinly-settled regions outside of
the cities and large villages, where voters would have long
distances to travel to the place of registration, and we have
provided for securing an honest and fair election by requiring
that on all election boards election officers shall equally
represent the two principal political parties of the State. We
have provided for a new appointment of Senate and Assembly
districts. … Attack has been made upon two rules laid down in
the proposed measure for the guidance of the Legislature in
future apportionments. One of these is the rule that no county
shall have more than three Senators unless it shall have a full
ratio for each Senator, although smaller counties may receive
a Senator or an additional Senator on a major fraction of a
ratio. … The other rule attacked is that no one county shall
have more than one-third of all the Senators, and that New
York and Kings county together shall not have more than
one-half of all the Senators. … We have declared in the
Constitution the principle of civil service reform, that
appointments and promotions are to be based upon merit and
ascertained so far as practicable by competitive examination.
We have sought by this to secure not merely the advantage
derived from declaring the principle, but the practical
benefit of its extension to the State prisons, canals and
other public works of the State, to which, under the existing
Constitution, the court of last resort has decided that civil
service rules cannot be applied. … We have prohibited the
contract system of convict labor. … We have authorized the
Legislature to provide for the improvement of the canals,
without, however, borrowing money for that purpose unless the
people expressly authorize it. … We have required the
Legislature to provide for free public schools, in which all
the children of the State may be educated, and we have
prohibited absolutely the use of public money in aid of
sectarian schools. … We have so amended the present
Constitution as to provide for a naval as well as a land force
of militia. … In order to allow every voter to exercise a
choice in voting on some of the important proposed amendments,
we have provided that the Revised Constitution shall be
submitted to the people in three parts, viz.:

1. That making an apportionment of Senators and members of the


Assembly.

2. That pertaining to the improvements of the canals.

3. All the remainder of the proposed amendments as a whole."

Journal of the Constitutional Convention,


State of New York, 1894, pages 839-846.

CONSTITUTION OF NORTH CAROLINA:


Amendment qualifying the suffrage.

See (in this volume)


NORTH CAROLINA: A. D. 1900.

{167}

--CONSTITUTION (GRONDWET) OF THE SOUTH AFRICAN


REPUBLIC.: Start--

The following are the Articles of main importance in the


Grondwet or Constitution of the South African Republic:

ARTICLE 1.
This State shall bear the name of the South African Republic.

ARTICLE 2.
The form of government of this State shall be that of a
republic.
ARTICLE 3.
It desires to be recognized and respected by the civilized
world as an independent and free people.

ARTICLE 4.
The people seek for no extension of territory, and desire it
only in accordance with just principles, when the interest of
the Republic makes such extension desirable.

ARTICLE 5.
The people desire to retain and maintain their territory in
South Africa unimpaired. The boundaries thereof are fixed by
proclamation.

ARTICLE 6.
Its territory is open for every foreigner who obeys the laws
of this Republic. All who are within the territory of this
Republic have equal claims to protection of person and
property.

ARTICLE 7.
The land or farms situate in this territory which have not yet
been given out, are declared to be the property of the State.

ARTICLE 8.
The people claim the utmost social freedom, and expect the
result from the maintenance of their religious belief, from
the observance of their obligations, from submission to law,
order and right, and the maintenance of the same. The people
permit the spread of the Gospel among the heathen under fixed
precautions against deceit or misleading.

ARTICLE 9.
The people will not allow any equalization of the coloured
inhabitants with the white.
ARTICLE 10.
The people will not suffer any slave trade or slavery in this
Republic.

ARTICLE 11.
The people reserve to themselves the protection and defence of
the independence and inviolability of the State, subject to
the laws.

ARTICLE 12.
The people entrust the legislation to a Volksraad—the highest
authority in the land—consisting of representatives or
deputies of the people, chosen by the enfranchised burghers;
but with the reservation that a period of three months shall
be left to the people to enable them if they so wish to
communicate to the Volksraad their verdict on a proposed law;
except those laws which can suffer no delay.

ARTICLE 13.
The people charge the President with the task of proposing and
executing the laws; he also brings before the Volksraad the
appointments of all civil servants for ratification.

ARTICLE 14.
The people entrust the maintenance of order to the military
force, the police, and other persons appointed by the law for
that purpose.

ARTICLE 15.
The people place the judicial power in the hands of a Supreme
Court, Circuit Court, Landrosts, Juries, and such other
persons as shall be entrusted with judicial powers, and leave
all these free to discharge their function according to their
judgment and consciences, according to the laws of the land.

ARTICLE 16.
The people shall receive from the Volksraad an estimate of the
general income and expenses of the State, and learn therefrom
how much every man's taxes shall amount to.

ARTICLE 17.
Potchefstrom, situated on the Mooi River, shall be the capital
of the Republic, and Pretoria the seat of Government.

ARTICLE 18.
All services rendered on behalf of the public are remunerated
by the public.

ARTICLE 19.
Freedom of the press is granted provided the printer and
publisher remain responsible for all the documents which
contain defamation, insult, or attacks against anyone's
character.

ARTICLE 20.
The people shall only appoint as representatives in the
Volksraad those who are members of a Protestant Church.

ARTICLE 21.
The people desire the growth, prosperity, and welfare of the
State, and with this view provision for suitable school
teachers.

ARTICLE 22.
Providing also that in time of peace precautionary measures
are taken to enable the State to wage or withstand a war.

ARTICLE 23.
In case of a hostile attack from outside, everyone, without
distinction, shall be held bound to lend his assistance on the
promulgation of martial law. …

ARTICLE 26.
The Volksraad shall be the highest authority of the country,
and the legislative power.

ARTICLE 27.
No civil servants are to be representatives of the people.

ARTICLE 28.
The Volksraad shall consist of at least twelve members, who
must possess the following qualifications:-They must have
attained the age of thirty years, and be born in the Republic,
or have for fifteen consecutive years been burghers entitled
to vote, be members of a Protestant Church, reside, and
possess immovable property, in the Republic. No persons of
notoriously bad character, or who have had a dishonouring
sentence pronounced against them, and no uncertified or
unrehabilitated insolvents shall be eligible. They may not be
related to each other in the relationship of father and son or
stepson. No coloured persons or bastards shall be admitted
into our Assemblies. In like manner no military officer or
official of the State, who draws a fixed annual or monthly
salary, shall be eligible as member of the Volksraad.

ARTICLE 29.
The members of the Volksraad are elected by a majority of
votes from among the electors of each district. No one shall
be considered as elected who has not obtained at least sixty
votes. Everyone who is born in the country and has attained
the age of twenty-one years, or has become naturalized, shall
be a burgher qualified to vote. The members of the Volksraad
are elected for the period of four years. … [The above
provisions of the Constitution, relating to the Volksraad and
the representation of the people, were modified by the
following among other provisions of an Act of the Volksraad
passed in 1891:

ARTICLE 1.
The legislative power shall rest with a representation of the
people, which shall consist of a First Volksraad and a Second
Volksraad.

{168}

ARTICLE 2.
The First Volksraad shall be the highest authority in the
State, just as the Volksraad was before this law came into
operation. The First Volksraad shall be the body named the
Volksraad until this law came into operation. From the period
of this law coming into operation, the name of that body shall
be altered from the Volksraad to the First Volksraad. The
persons forming that body as members shall, however, remain
the same, only they shall, from the said period, be named
members of the First Volksraad instead of members of the
Volksraad. All laws and resolutions having reference to the
Volksraad and the members thereof shall remain in force and
apply to the First Volksraad and the members thereof, except
in so far as a change is or shall be made by this and later
laws. …

ARTICLE 4.
The number of the members of the Second Volksraad shall be the
same as of the First Volksraad. This number shall be fixed
later by the First Volksraad for both Volksraads. …

ARTICLE 9.
The members of the First Volksraad are chosen by those
enfranchised burghers who have obtained the burgher right,
either before this law came into operation, or thereafter by
birth, and have reached the age of sixteen years. The
franchise for the First Volksraad can besides also be obtained
by those who have during ten years been eligible for the
Second Volksraad, by resolution of the First Volksraad, and
according to rules to be fixed later by law.

ARTICLE 10.
The members of the Second Volksraad are chosen by all
enfranchised burghers who have reached the age of sixteen
years. …

ARTICLE 27.
The Second Volksraad shall have the power to pass further
regulations on the following subjects as is necessary, either
by law or resolution:
(1) The department of mines.
(2) The making and support of wagon and post roads.
(3) The postal department.
(4) The department of telegraphs and telephones.
(5) The protection of inventions, samples and trademarks.
(6) The protection of the right of the author.
(7) The exploitation and support of the woods and salt-pans.
(8) The prevention and coping with contagious diseases.
(9) The condition, the rights, and obligations of companies.
(10) Insolvency.
(11) Civil procedure.
(12) Criminal procedure.
(13) Such other subjects as the First Volksraad shall decide
later by law or resolution, or the First Volksraad shall
specially refer to the Second Volksraad.

ARTICLE 28.
All laws or resolutions accepted by the Second Volksraad are
as soon as possible, that is to say at the outside within
forty-eight hours, communicated both to the First Volksraad
and to the President.

ARTICLE 29.
The President has the right, when he has received notice from
the Second Volksraad of the adoption of a law or a resolution,
to bring that law or resolution before the First Volksraad for
consideration within fourteen days after the receipt of such
notice. The President is in any case bound, after the receipt
of such a notice, to communicate it to the First Volksraad
within the said time.
ARTICLE 30.
If the President has not brought the law or resolution as
communicated before the First Volksraad for consideration, and
the First Volksraad has not on its own part thought it
necessary to take said law or resolution into consideration,
the President shall, unless with the advice and consent of the
Executive Council he thinks it undesirable in the interests of
the State, be bound to have that law or resolution published
in the first succeeding Volksraad, unless within the said
fourteen days the First Volksraad may be adjourned, in which
case the publication in the "Stasts Courant" shall take place
after the lapse of eight days from the commencement of the
first succeeding session of the First Volksraad.

ARTICLE 31.
The law or resolution adopted by the Second Volksraad shall
have no force, unless published by the President in the
"Staats Courant."

ARTICLE 43.
The President shall bring forward for discussion the proposals
for laws which have come in before the Volksraad, whether the
latter have been made known to the public three months before
the commencement of the session, or whether the same have come
in during the session of the Volksraad.

ARTICLE 44.
When the notices of laws and Government notices to the public
have not been given in time, the President shall examine with
whom the blame of that delay lies. A Landrost found guilty
hereof shall have a fine of Rds. 50 inflicted and a
Field-Cornet or lesser official of Rds. 25. …

ARTICLE 56.
The executive power resides in the State President, who is
responsible to the Volksraad. He is chosen by a majority of
the burghers entitled to vote, and for the term of five years.
He is eligible for reelection. He must have attained the age of
thirty years, and need not be a burgher of the State at the
time of his nomination, and must be a member of a Protestant
Church, and have no dishonouring sentence pronounced against
him. [By a subsequent law the President must be chosen from
among the burghers.]

ARTICLE 57.
The President is the first or highest official of the State.
All civil servants are subordinate to him; such, however, as
are charged with exercise of the judicial power are left
altogether free and independent in its exercise.

ARTICLE 58.
As long as the President holds his position as such he shall
fill no other, nor shall he discharge any ecclesiastical
office, nor carry on any business. The President cannot go
outside the boundaries of the State without consent of the
Volksraad. However, the Executive Council shall have the power
to grant him leave to go outside the boundaries of the State
upon private affairs in cases of necessity. …

ARTICLE 60.
The President shall be discharged from his post by the
Volksraad after conviction of misconduct, embezzlement of
public property, treachery, or other serious crimes, and be
treated further according to the laws.

ARTICLE 61.
If in consequence of transgression of the Constitution or
other public misdemeanors the Volksraad resolve that the
President shall be brought to trial, he shall be tried before
a special court composed of the members of the High Court, the
President and another member of the Volksraad, while the State
Attorney acts as Public Prosecutor. The accused shall be
allowed to secure assistance of a lawyer at his choice.
ARTICLE 62.
The President is charged with the proposing of laws to the
Volksraad, whether his own proposals or others which have come
in to him from the people; he must make these proposals known
to the public by means of the "Staats Courant" three months
before presenting them to the Volksraad, together with all
such other documents as are judged useful and necessary by
him.

{169}

ARTICLE 63.
All proposals for a law sent in to the President shall, before
they are published, be judged by the President and Executive
Council as to whether publication is necessary or not.

ARTICLE 64.
The President submits the proposals for laws to the Volksraad,
and charges the official to whose department they belong first
and foremost, with their explanation and defence.

ARTICLE 65.
As soon as the President has received the notice of the
Volksraad that the proposed law is adopted, he shall have that
law published within two months, and after the lapse of a
month, to be reckoned from the publication, he shall take
measures for the execution of the same.

ARTICLE 66.
Proclamation of martial law, as intended in Article 23, shall
only be made by the President with the assent of the members
of the Executive Council. …

ARTICLE 67.
The President, with advice of the Executive Council, declares
war and peace, with reference to Article 66 of the
Constitution; the Government having first, if possible,
summoned the Volksraad before the declaration of war. Treaties
of peace require the ratification of the Volksraad, which is
summoned as soon as possible for that purpose. …

ARTICLE 70.
The President shall submit, yearly, at the opening of the
Volksraad, estimates of general outgoings and income, and
therein indicate how to cover the deficit or apply the
surplus.

ARTICLE 71.
He shall also give a report during that session of that
Volksraad, of his actions during the past year, of the
condition of the Republic and everything that concerns its
general interest. …

ARTICLE 75.
The President and one member of the Executive Council shall,
if possible, visit the towns and villages of the Republic
where Landrost's officers are, once in the year; he shall
examine the state of those offices, inquire into the conduct
of the officials, and on these circuits give the inhabitants
during their stay an opportunity to bring before him anything
they are interested in. …

ARTICLE 82.
The President exercises his power along with the Executive
Council. An Executive Council shall be joined to the
President, consisting of the Commandant-General, two
enfranchised burghers, a Secretary, and a Notekeeper
(notulenhouder), who shall have an equal vote, and bear the
title of members of the Executive Council. The Superintendent
of Native Affairs and the Notekeeper shall be ex-officio
members of the Executive Council. The President and members of
the Executive Council shall have the right to sit, but not to
vote, in the Volksraad. The President is allowed, when

You might also like