EasyManua.ls Logo

Freenove Ultimate Starter Kit User Manual

Freenove Ultimate Starter Kit
286 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #157 background imageLoading...
Page #157 background image
157
Chapter 14 Relay & Motor
www.freenove.com
support@freenove.com
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
}
//if changing-state of the button last beyond the time we set,we considered that
//the current button state is an effective change rather than a buffeting
if(millis() - lastChangeTime > captureTime){
//if button state is changed ,update the data.
if(reading != buttonState){
buttonState = reading;
//if the state is low ,the action is pressing
if(buttonState == LOW){
printf("Button is pressed!\n");
relayState = !relayState;
if(relayState){
printf("turn on relay ...\n");
}
else {
printf("turn off relay ...\n");
}
}
//if the state is high ,the action is releasing
else {
printf("Button is released!\n");
}
}
}
digitalWrite(relayPin,relayState);
lastbuttonState = reading;
}
return 0;
}
The code is in the same logic as TableLamp code above.

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the Freenove Ultimate Starter Kit and is the answer not in the manual?

Freenove Ultimate Starter Kit Specifications

General IconGeneral
MicrocontrollerATmega328P
Operating Voltage5V
Input Voltage (recommended)7-12V
Analog Input Pins6
DC Current per I/O Pin20 mA
Clock Speed16 MHz
LED_BUILTIN13
Compatible withArduino
ComponentsResistors, LEDs, buttons, sensors
Programming LanguageC++
Power SupplyUSB or external power supply
Digital I/O Pins14 (6 provide PWM output)
Flash Memory32 KB (0.5 KB used by bootloader)
SRAM2 KB
EEPROM1 KB

Summary

Warning and About Freenove

Important Safety Warnings

Important safety precautions and warnings for using Freenove products.

About Freenove Platform

Overview of Freenove as an open-source electronics platform and its services.

References and Support Information

Downloadable Project Resources

Links to download project sketches and references for the Freenove Ultimate Starter Kit.

Freenove Technical Support

Information on how to get free and quick technical support from Freenove.

System Installation and Preparation

Raspberry Pi System Installation

List of required components for installing the Raspberry Pi system.

Chapter 0 Preparation Steps

Introduction to Linux commands, WiringPi installation, and project code.

Linux Command Usage

Introduction to frequently-used Linux commands and their usage methods.

Install WiringPi Library

Steps to install the WiringPi GPIO access library for Raspberry Pi.

GPIO Basics and Numbering Schemes

Explanation of GPIO numbering systems: BCM, physical, and WiringPi.

Chapter 1 LED Projects

Project 1.1 LED Blink

Project to control LED blinking using Raspberry Pi GPIO.

LED Component Knowledge

Explanation of LED as a diode and its working principle.

Chapter 2 Button and LED Interaction

Project 2.1 Button and LED Control

Project to control LED state using a button.

Project 2.2 MINI Table Lamp

Project to build a MINI table lamp using a button and LED, with debounce.

Push Button Component Knowledge

Description of a push button and how its circuit turns on when pressed.

Chapter 3 LEDBar Graph Projects

Project 3.1 Flowing Water Light

Project to create a flowing water light effect using multiple LEDs.

LED Bar Graph Component Knowledge

Information on the LED bar graph component, an integration of 10 LEDs.

Chapter 4 Analog and PWM

Project 4.1 Breathing LED Effect

Project to control LED brightness using PWM for a breathing light effect.

PWM Signal Control Knowledge

Introduction to Pulse-Width Modulation (PWM) for controlling analog circuits.

Chapter 5 RGBLED Projects

Project 5.1 Colorful LED Control

Project to control an RGBLED to switch colors automatically.

RGBLED Component List

List of components for the Colorful LED project.

Chapter 6 Buzzer Projects

Project 6.1 Doorbell Simulation

Project to create a doorbell using a button and an active buzzer.

Buzzer Component Knowledge

Description of active and passive buzzers and how to identify them.

Transistor Usage for Current Amplification

Explanation of why a transistor is needed to amplify current for driving a buzzer.

Project 6.2 Alertor

Project to create an alarm using a button and a passive buzzer.

Chapter 7 AD/DA Converter

Project 7.1 Potentiometer Voltage Reading

Project to read potentiometer voltage using ADC and control LED brightness with DAC.

ADC Circuit Knowledge

Explanation of Analog-to-Digital Converter (ADC) and its resolution.

DAC Circuit Knowledge

Explanation of Digital-to-Analog Converter (DAC) and its accuracy.

Potentiometer Component Knowledge

Description of a potentiometer as a resistive element with adjustable resistance.

Chapter 8 Potentiometer & LED

Project 8.1 Soft Light Control

Project to control LED brightness using a potentiometer and PWM.

Chapter 9 Potentiometer & RGBLED

Project 9.1 Colorful Light Control

Project using potentiometers to control RGBLED colors.

Chapter 10 Photoresistor & LED

Project 10.1 Night Lamp Operation

How the Night Lamp project works by adjusting LED brightness based on ambient light.

Photoresistor Component Knowledge

Explanation of a photoresistor as a light-sensitive resistor for detecting light intensity.

Chapter 11 Thermistor

Project 11.1 Thermometer

Project to build a thermometer using a thermistor to measure temperature.

Thermistor Resistance-Temperature Relationship

Formula relating thermistor resistance to temperature, including parameters like B and R.

Chapter 12 Joystick

Project 12.1 Joystick Data Reading

How to read and print the X, Y, and Z axis data from a joystick.

Joystick Sensor Mechanism and Axes

Explanation of joystick operation, including analog X/Y axes and digital Z press detection.

Chapter 13 Motor & Driver

Project 13.1 Motor Control with Potentiometer

Project to control motor speed and direction using a potentiometer and L293D driver.

L293D Motor Driver Capabilities

Details on the L293D chip's 4-channel motor drive capabilities.

Chapter 14 Relay & Motor

Project 14.1.1 Relay and Motor Activation

Project to control a relay and motor using a push button, with LED indication.

Relay Functionality and Circuit Diagram

Explanation of relay function, feature, and circuit symbol for a 5V relay.

Chapter 15 Servo Motor

Project 15.1 Servo Sweep Movement

Project to make a servo motor rotate from 0 to 180 degrees and back.

Servo Motor Control via PWM Signals

How servo motors are controlled using 50Hz PWM signals and duty cycles for angle positioning.

Chapter 16 Stepping Motor

Project 16.1 Stepping Motor Driving

Project to drive a stepping motor and understand its working principles.

Stepping Motor Operation Modes and Control

Explanation of stepping motor modes (four-step, half-step) and rotation control.

Chapter 17 74HC595 & LEDBar Graph

Project 17.1 Flowing Water Light with 74HC595

Project to create a flowing water light using 74HC595 for efficient GPIO usage.

74HC595 Chip Functionality and Ports

Description of the 74HC595 chip's function and its port descriptions.

Chapter 18 74HC595 & 7-Segment Display

Project 18.1 7-Segment Display Character Output

Project to control a 7-segment display using 74HC595 to show characters '0'-'F'.

Project 18.2 4-Digit 7-Segment Display Control

Project to control a 4-digit 7-segment display using dynamic scanning.

7-Segment Display Basics and Pinout

Explanation of 7-segment displays, including common anode/cathode types and pin diagrams.

Chapter 19 74HC595 & LED Matrix

Project 19.1 LED Matrix Display Graphics

Project to control an 8x8 LED matrix using two 74HC595 chips for graphics and characters.

LED Matrix Module Structure and Connections

Description of LED matrix modules, focusing on common anode connections.

Chapter 20 LCD1602 Display

Project 20.1 I2C LCD1602 Display Interface

Project to display characters and variables on an LCD1602 using an I2C interface.

Chapter 21 Hygrothermograph DHT11

Project 21.1 Hygrothermograph Data Reading

Project to read temperature and humidity data from a DHT11 sensor.

DHT11 Sensor Functionality and Data Reading

Details on DHT11 sensor operation, voltage range, and data reading methods.

Chapter 22 Matrix Keypad

Project 22.1 Matrix Keypad Input Reading

Project to read and print key codes from a 4x4 matrix keypad.

4x4 Matrix Keypad Structure and Scanning

Explanation of the 4x4 matrix keypad structure and key press detection using scanning.

Chapter 23 Infrared Motion Sensor

Project 23.1 Sense LED with Motion Detection

Project to control an LED using an infrared motion sensor for automatic lighting.

HC SR501 Motion Sensor Features

Description of HC SR501 sensor features, working voltage, trigger modes, and sensitivity adjustments.

Chapter 24 Ultrasonic Ranging

Project 24.1 Ultrasonic Distance Measurement

Project to measure distance using an ultrasonic ranging module (HC SR04).

Ultrasonic Ranging Principle

Explanation of ultrasonic distance measurement using sound wave reflection and time-of-flight.

HC SR04 Module Specifications

Technical specifications for the HC SR04 ultrasonic module, including voltage and distance limits.

Chapter 25 Attitude Sensor MPU6050

Project 25.1 Read MPU6050 Sensor Data

Project to read acceleration and gyroscope data from the MPU6050 sensor.

MPU6050 Sensor Capabilities

Overview of the MPU6050 sensor, its capabilities, and I2C communication protocol.

MPU6050 Module Pinout

Details on MPU6050 module pin functions and I2C address configuration.

Chapter 26 WebIOPi & IoT

Project 26.1 Remote LED Control

Project to build a WebIOPi service and control an LED remotely via a web browser.

WebIOPi Service Framework Installation

Step-by-step guide for installing the WebIOPi framework on Raspberry Pi.

Running and Accessing WebIOPi Remotely

Instructions on starting the WebIOPi service and accessing it via a web browser.

WebIOPi Interface Navigation

Navigating the WebIOPi interface to control GPIO pins and their states.

WebIOPi Functionality and Considerations

Discussion on WebIOPi's capabilities and potential issues with installation packages and bugs.

Chapter 27 Solder Circuit Board

Project 27.1 Solder a Buzzer Circuit

Project to solder a simple circuit for a buzzer activated by a button, requiring no programming.

Project 27.2 Solder Flowing Water Light

Project to solder a circuit for an improved flowing water light with LEDs.

What's Next?

Further Learning and Resources

Guidance on learning Processing, exploring Freenove products, and contacting for support.