How to Connect HC-05 to Arduino Nano

July 21st, 2020

The HC-05 is a simple and affordable Bluetooth module that can be connected to the Arduino Nano in a few simple steps and transfer data as a master and slave drive. In this tutorial, we will learn how to wire the HC-05 to the Arduino Nano and write up a simple Bluetooth module to get you started!

Part One: Wiring

As seen from the above document, you will need a few jumper cables, a 1k ohm resistor, and a 2k ohm resistor. You can also use a breadboard to connect the module to your Arduino board. (See below diagram) *PLEASE NOTE THATTX SHOULD GO TO D3 AND RX SHOULD GO TO D2, THE DOCUMENT HAS IT FLIPPED.

To start all the way on the right, we have the VCC pin, which will connect to the 5V pin on the Arduino Nano. The VCC pin will receive power in the form of 5V from the Arduino Nano. Next we have the GND pin, which connects to the corresponding GND pin on the Arduino Nano. This will just send back the voltage to the Arduino Nano and complete the circuit. Now we have the TXD or Transmitter Pin, which transmit data in the of 3.3v from the HC-05 to the Arduino Nano’s D2 Pin. The Arduino Nano can handle this, but when we move over to the receiver pin, the Arduino Nano is transmitting 5 Volts to the HC-05. This is too much for the HC-05 as it sends and receives data in the form of 3.3V, and we risk damaging the module. So, we have to put 2 resistors as seen in the diagrams above. Now that we have successfully wired our HC-05 module, we can move onto the code!

Part 2: Code

Before we get started with the code, your going to want to download BT Terminal from the Google Playstore so that you communicate between your module and phone. Now for the code:

#include <SoftwareSerial.h>

// Define the data transmit/receive pins in Arduino

#define TxD 2

#define RxD 3

SoftwareSerial mySerial(RxD, TxD); // RX, TX for Bluetooth

void setup() {

mySerial.begin(9600); // For Bluetooth

Serial.begin(9600); // For the IDE monitor Tools -> Serial Monitor

// Any code that you want to run once....

}

void loop() {

// put your main code here, to run repeatedly:

boolean isValidInput; do { byte c; // get the next character from the bluetooth serial port

while ( !mySerial.available() ) ; // LOOP...

c = mySerial.read(); // Execute the option based on the character recieved

Serial.print(c); // Print the character received to the IDE serial monitor

switch ( c ) {

case 'a': // You've entered a

// Do the code you need when 'a' is received.....

mySerial.println( "You've entered an 'a'" );

isValidInput = true;

break;

case 'b': // You've entered b

// Do the code you need when 'b' is received.....

mySerial.println( "You've entered an 'b'" );

isValidInput = true;

break;

default:

// Do the code you need when any other character is received.....

mySerial.println( "Please enter 'a' or 'b'" );

isValidInput = false;

break;

}

} while ( isValidInput == true ); // Repeat the loop

}

I borrowed the following code from the people at TechDepot Egypt, check them out here: https://www.instructables.com/id/Connecting-HC-05-Bluetooth-Module-to-Arduino/

Part 3: Putting it All Together

Run the program after you have entered in the code. Go to your phone and connect to the Bluetooth module under settings first. It will ask you for a 4 Digit pin. This will most likely be 1234 or 0000. Once that is done go back to the BT Terminal app and connect to the module under them. Now you can send any messages from the app and use the HC-05 Bluetooth module to your advantage!

Uncategorized

Best Universities for Master's in Electrical Engineering in USA

July 12th, 2019

Reference Designer has very popular tutorial section that covers a number of Electrical Engineering topics. Many of our readers wanted to know about Masters program in Electrical Engineering in United States. Before we go into the details, you must understand that there is no substitute of hands on experience in Electrical Engineering

Engineering is the second most popular major in the United States after Business and Management. Master’s program in electrical engineering can fetch you a premium salary with starting range of $110k/ year

Here are top ranked 10 universities which offer Graduate program in Electrical engineering

Harvard University

Electrical engineering has continued to play a pivotal role in power
and energy distribution, communications, and computation, even as the power-carrying channels have evolved from heavy metal cables to nanowires or optical fibers the networks of communications have evolved from wires to wireless to neurons and the basic electrical
switches have evolved from vacuum tubes to transistors to carbon nanotubes.

Tuition for Graduate Programs: $44,816

https://gsas.harvard.edu/programs-of-study/all/electrical-engineering

Northwestern University

The PhD program in electrical engineering emphasizes excellence in education and research, providing graduates with a solid foundation for a career in industry, academia, and research labs.Tuition:
$52,239

https://www.tgs.northwestern.edu/academics/programs/electrical-engineering/index.html

Washington University in St Louis

The Electrical Systems Engineering offers doctoral-level and master
-level degrees in Electrical Engineering and in Systems Science Mathematics. At the doctoral level, both the PhD and DSc degrees are available, which typically require four to five years of full-time study leading to an original research contribution. Applications
to signal processing, statistics and machine learning, control and mechanical engineering, digital and analog circuit design, and finance.

Tuition: $50,650

https://engineering.wustl.edu/Programs/Pages/electrical-engineering.aspx

University of Southern California

The MS in Electrical Engineering will have the professional skills necessary to compete effectively in a world of rapid technological change as well as to assume leadership roles within industrial, entrepreneurial, academic, or governmental environments in the
broad context of electrical engineering.Tuition: $43,200

viterbigradadmission.usc.edu/programs/masters/msprograms/electrical-computer-engineering/ms-electrical-engineering/

Tufts University

The Electrical and Computer Engineering is a growing interdisciplinary
department with a focus on research and education in a wide variety of sub-disciplines, ranging from image and signal processing to nanoscale engineering.
Tuition: $49,892

https://asegrad.tufts.edu/academics/explore-graduate-programs/electrical-engineering

Lehigh University

The rapidly growing graduate program in Electrical Engineering is uniquely
positioned to advance enabling technologies that drive revolutionary developments in nanotechnology, biotechnology, optical technologies, information and communications technologies, and sensors and sensor networks.
Tuition: $26,280

Northeastern University

The PhD program in Electrical Engineering aims to teach students to
develop efficient systems that contribute to business, safety, health, and entertainment. Northeastern’s PhD program in Electrical Engineering offers the opportunity to pursue cutting-edge research in the following areas: Signal and image processing biomedical
signal processing and brain-computer interface pattern recognition adaptive signal processing wireless and underwater communications information theory and coding .Tuition:
$23,408

northeastern.edu/graduate/program/master-of-science-in-electrical-and-computer-engineering-5265/

Southern Methodist University

M.S. degree in electrical engineering or in a closely related discipline
from a U.S. college or university accredited by a regional accrediting association or completion of an international degree that is equivalent to a U.S. master’s degree from a college or university of recognized standing.

Tuition: $40,896

https://www.smu.edu/Lyle/Departments/ECE/DegreePrograms/MS_EE

Colorado School of mines

Master of Science and Doctor of Philosophy in Electrical Engineering.
These degree programs demand academic rigor and depth yet also address real-world problems. In many cases, individual research projects encompass than one research area. Information and Systems Sciences is an interdisciplinary research area that encompasses
the fields of control systems, communications, signal and image processing, compressive sensing, robotics, and mechatronics.

Tuition: $35,220

electrical.mines.edu/graduate-program/

University of Denver

MS in electrical engineering offers students the opportunity to enhance
their understanding of specialized electrical systems such as search and rescue robotics, sustainable energy and power systems, unmanned vehicle systems and social emotive robots. We provide a graduate education that emphasizes both multi-disciplinary and
cross-disciplinary knowledge.

Tuition: $47,520

engineering.ucdenver.edu/academics/graduate-programs/electrical-engineering/ms-in-electrical-engineering

To find out more about colleges offering electrical engineering master’s program, check out College Hippo

Uncategorized

Reference Designer in Media and more Calculators

May 8th, 2019

We wanted to place all the references to the Reference Designer at one place and hence this post. Our tutorials have been referenced in many educational websites.

One of our products ( ArduinoPixed) has been mentioned in Raspberry Pi Magazine.

We are also taking this post to update new calculators available at Reference Designer.

1. ArduinoPixed on MagPi Magazine

MagPi - the official Raspberry Pi Magazine reviewed ArduinoPixed and their verdict has endorsed the Reference designer's Arduinopixed. Giving 9 out of 10 it says - "A quick build, even quicker software setup, and you’re away with a fantastic marriage of Arduino and Raspberry Pi." Check the MagPi post - here

2.  Sant Louis Area Microwave Society 

Has mentioned the dBm to Watt Calculator in its list of Calculators - Check the Society Page here

3. Calculators

We realized that some of the calculators are un noticed - we we wanted to put them on one place.

  1. Angle between Vectors - Here is a tutorial that calculates the Angle between two vectors in 3 Dimension - check it out.
  2. pH Calculator - Here is it

Uncategorized

Sending Hex Text on Serial Port on Windows

March 21st, 2019

Many small hardware communicate on UART Serial port, often using a USB to UART chip. You sometimes need to communicate with these devices from your Windows machine - and this is the topic of this blog.

Using Python

Python comes to your rescue. With increasing use of Python it has become a de facto standard not only for many front and back end web software and services but also for controlling hardware. Sending data to Serial Port using Python is easy.

Install PySerial

Once you have installed Pythnon ( the latest version at the time of writing is 3.7) and and the pip, you need to install the pyserial library

pip install pyserial

The Serial Port code

You need to write the following code to send the Hex Data to Serial Port and read it back.

import serial

ser = serial.Serial("COM5", 9600) command = b'\x41\x42\x43\x44\x48\x65\x6c\x6c\x6f'

ser.write(command)

s = ser.read(9)

print(s)

You could also use a software called Realterm - It does work, though we are not sure if it could be harmful.

Uncategorized

Arduinopixed Schematics

December 20th, 2018

Here is some more details and cleaner schematics of Arduinopixed. Most part of the Schematics is self explanatory but I have included some minimal explanation.

Page 1

ArduinoPixed Page 1

1. U1 is the 4 Port USB Hub.
2. J2, J3, J4 are USB Connectors.
3. U4 is a 5V to 3.3V Regulator.
4. R2 is fuse at 5V Entry point

Page 2

Arduinopixed Schematics - Sheet 2

Some explanations

1. U2 is USB to UART chip
2. U3 is ATMEGA chip
3. J8 and J9 form the header for any Add on Board
4. J5 Header is used for programming ATMEGA, if required.
5. SW3 is on board Switch
6. D1 is LED
7. R6 is thermistor that can be used for temperature monitoring.

Uncategorized

Programming ArduinoPixed

November 15th, 2018

The Arduinopixed comes pre programmed with bootloader. If however, you need to re program the bootloader, this blog should help you. Here are the list of the steps you need to follow.

1. Please purchase an Arduino Nano v3.0 board. These are available for under $2 - for example
https://www.alibaba.com/product-detail/Shenzhen-factory-Compatible-CH340-Nano-V_60571630186.html?spm=a2700.7724838.2017121.5.28492fc8oIgvnY
Make sure you buy the one that has bootloader preloaded. In the Arduino Nano with preloaded bootloader, it will blink with LED when powered ON.

2. Make a 6 Pin Cable - One end will connect to Arduino Nano board and the other end will connect to ArduinoPixed Board ( J5 Connector) . The connection will be as follows

Figure 1 : Pinout Connection between Arduino Nano and ArduinoPixed

3. Install Arduino IDE on a Windows Computer and start the Arduino Program

4. Connect the Arduino Nano with the Computer using a USB Cable. Make sure you are able to download a LED Blinking example program on it.

5. Add a 10uF Cap on the Arduino Nano board between its RESET PIN and GND ( Notice that you will have to remove this capacitor if you wish to do the step 4 above again).

6. In the Tools -> Board menu select the item that corresponds to the Arduino in which you are going to burn the bootloader(in this case, Arduino Nano w/Atmega 328 again). Then go to the Tools->Programmer menu, and select “Arduino as ISP” instead of the default “AVRISP mkII”:

7. Finally, click in the Tools -> Burn Bootloader menu item

Uncategorized