Download Lab 9: Control of LEDs and DC Motors via Bluetooth COEN

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript
Lab 9: Control of LEDs and DC Motors via Bluetooth
COEN-4720 Embedded Systems
Cristinel Ababei
Dept. of Electrical and Computer Engineering, Marquette University
1. Objective
The objective of this lab is to use an HC-06 Bluetooth module connected to the LandTiger board and
to create several simple projects including: sending temperature data to host PC (or Android or iOS
device) and controlling the board’s LEDs or a DC brushless or stepper motor connected to the board
wirelessly from the host PC (or Android or iOS device).
1. Introduction
1.1. Background on Bluetooth Wireless Technology
Bluetooth is a wireless technology standard for exchanging data over short distances (using shortwavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile
devices, and building personal area networks (PANs). Invented by telecom vendor Ericsson in 1994,
it was originally conceived as a wireless alternative to RS-232 data cables. It can connect several
devices, overcoming problems of synchronization [1]. In short, Bluetooth is a standard for the shortrange wireless interconnection of cellular phones, computers, and other electronic devices.
Please take some time and read through the pointers included in reference [1] to read more about
Bluetooth. It is outside the scope of this lab to teach details about it. However, you are encouraged to
look into it more on your own.
1.2. HC-06 Bluetooth Module
In this lab, we will use the JY-MCU BT_BOARD V1.07 (also referred to as HC-06): Arduino
Wireless Bluetooth Transceiver Module [2,3], which is shown in Fig.1.
Figure 1: Photographs of the "JY-MCU BT_BOARD V1.07" Bluetooth module.
1
This is a popular serial Bluetooth module, which uses the Bluetooth Specification v2.0.
It can work either as a master or a slave. It is built around the BC417 Bluetooth to Serial chip, which
is a single chip radio and baseband IC for Bluetooth 2.4 GHz systems including enhanced data rates
(EDR) to 3Mbps [4]. This chip is loaded with features, including UART interface with
programmable baud rate up to 3Mbaud with an optional bypass mode. By default, it works as a
Slave, 9600 baudrate, N, 8, 1, and Pincode 1234.
While very popular (there are several other versions, such as HC-03, HC-04, and HC-05 among
others) and easy to use, it somewhat lacks in up to date documentation. Nevertheless, the manual of
version 1.05 is a good starting point to read and find out more about this module. Please take some
time to briefly read the manual available for download at [3].
Some of the features of the HC-06 Bluetooth module include [3]:
 Serial port operation voltage 3.3V
 Baudrate set at 9600, but you can change it using AT commands
 Operation current, pairing at 30mA, after pairing 8mA during communication
 Can pair and communicate with laptops, laptop Bluetooth adapters, Bluetooth Shields on
Arduino, smart phones such as Android, etc.
The module has six pins:
 VCC: supply voltage with range 3.6 V to 6 V (BC417 chip needs 3.3V generated with the help
of a voltage regulator on the same PCB).
 GND: ground.
 RXD: Serial RX. Note, this would be connected to the TX pin of the Arduino board.
 TXD: Serial TX. As you would expect, this this would be connected to the RX pin of the
Arduino board.
 KEY: Not used.
 STATE: Not used.
2.
Example #1: Sending a text message from an MCU board to the host PC
This is a simple Arduino project (not LandTiger) which basically uses the Bluetooth module
connected to the Arduino board to broadcast a message, “Cris says hi!”, every other second. The
message is received on the host PC and displayed into a Serial terminal.
This project is described in detail in Section 3 of the following lab; its source code is publicly
available therein as well:
http://dejazzer.com/geen1200/resources/G1200_EECE_Lab3.pdf
Assignment #1: You must replicate the functionality of this example using the LandTiger board.
You basically need to attach the HC-06 module to the LandTiger board, which must be programmed
to pass the message to the bluetooth module, which in turn broadcasts the message that will be
2
received on the host PC side and printed in the serial terminal. You are allowed to replace the “host
PC” with “Android device” or “iOS device” such as smartphone or tablet for more fun.
3.
Example #2: Wireless data acquisition system
This is another simple Arduino project (not LandTiger) which basically uses the Bluetooth module
connected to the Arduino board to send temperature data to the host PC. This is essentially a simple
data acquisition (DAQ) system. Its block diagram and brief description are presented in Section 4 of
the same document as before:
http://dejazzer.com/geen1200/resources/G1200_EECE_Lab3.pdf
The Arduino source code for this example is provided in the archive of files for this lab.
Assignment #2: You must replicate the functionality of this example using the LandTiger board.
You basically need to attach the HC-06 module to the LandTiger board, which must be programmed
to pass the temperature data to the bluetooth module, which in turn sends that to the host PC, where
they are printed in the serial terminal. You are allowed to replace the “host PC” with “Android
device” or “iOS device” such as smartphone or tablet. If you do not have your own DHT22
temperature sensor (most likely), please use something like a transistor based temperature-sensor;
you should be able to find transistors and other necessary electronic components in the DLL lab.
Read the following resources for how to do that and/or search more on your own [5].
4.
Example #3: Wireless control of LEDs on LandTiger board
This is a project that you must develop without having given any example. Imagine that you are
working for a say a company and your manager asks you to think of and implement the following
project. It’s up to you to propose the design, to search information online on the state-of-the-art on it,
find datasheets, read, think, prototype, test, etc. and repeat until you get something that works
according to the specs.
Assignment #3: You must use the “host PC” or “Android device” or “iOS device” such as
smartphone or tablet to send control commands via Bluetooth to the HC-06 module connected to the
LandTiger board. These commands would control a DC motor also attached to the board. But
because we do not have a DC brushless motor available to each of us, we’ll control the LEDs to light
up from-left-to-right or from right-to-left to mimic the direction in which the motor spins. You must
also display information about the direction of rotation and the current “rotation speed” on the LCD
display of the LandTiger board.
3
References
[1] Bluetooth information;
https://en.wikipedia.org/wiki/Bluetooth
https://www.bluetooth.com/what-is-bluetooth-technology/bluetooth-technology-basics
http://www.wirelessdevnet.com/channels/bluetooth/features/bluetooth.html
http://www.radio-electronics.com/info/wireless/bluetooth/bluetooth_overview.php
[2] JY-MCU BT_BOARD V1.07: Arduino Wireless Bluetooth Transceiver Module Slave 4 Pin
Serial + DuPont Cable;
https://www.amazon.com/gp/product/B00OLL9XH0/ref=oh_aui_detailpage_o06_s00?ie=UTF8
&psc=1
[3] Bluetooth Transceiver RF Module Wireless Serial TTL V1.05 Manual; http://www.ram-eshop.com/ds/general/Bluetooth_TRx_Module_New.pdf
[4] BC417 Bluetooth to Serial chip Datasheet by CSR;
https://cdn.sparkfun.com/datasheets/Wireless/Bluetooth/CSR-BC417-datasheet.pdf
http://www.csr.com/products/29/bluecore4-ext
[5] Temperature measurement using diodes/transistors
http://www.cypress.com/file/128126/download
http://cds.linear.com/docs/en/application-note/an137f.pdf
4