SONGLE Single Relay Module for Arduino

  • Type: SPDT (Singe Pole Double Throw)
  • Coil Voltage: 5VDC
  • Contact Rating: 10A 250VAC/10A 125VAC/10A 30VDC


Click to access SRD(T73).pdf

3 Pin design requires 5V supply, Ground and a signal pulled to HIGH for switching. A clue to whether this type of relay is working or not is that the switch is audible.




These pins function as follows:

SO: The module’s serial output.   Your Arduino will read this output.

CS:  Chip Select.   Setting low, selects the Module and tells it to supply an output that is synchronize with a clock

SCK : The Serial Clock… an input from your Arduino.

VCC: 5V supply

GND:  Ground.

– (or Minus):   The K thermocouple minus input.

+ ( or Plus):  The K Thermocouple plus input.

IMPORTANT NOTE– Most K thermocouples come with a red lead and a yellow lead.  The red lead is normally your negative connection and the yellow lead is your positive.  That is industry standard.

That said, some of the suppliers for the module are different, and will provide you a thermocouple with red indicating positive.

The way to know is if you increase the temperature at the thermocouple tip, and the indication goes lower. (Henry’s bench, 2017)


Artwork: The basic idea of a thermocouple: two dissimilar metals (gray curves) are joined together at their two ends. If one end of the thermocouple is placed on something hot (the hot junction) and the other end on something cold (the cold junction), a voltage (potential difference) develops. You can measure it by placing a voltmeter (V) across the two junctions. (Explainstuff, 2018)

DS18B20 One Wire Thermometer


Click to access DS18B20.pdf


Explainstuff, 2018. Thermocuples. [online] Available at: <; [Accessed 12 April 2018].
Henry’s Bench, 2017. MAX6675 Temp module arduino manual and tutorial. [online] Available at: <> [Accessed 12 April 2018].



Project change


Though it is not recommended to ‘give up’ on any project, it is worth recognizing time constraints, the learning requirements of a brief, and when to cut your losses.

After buying two HC-05 bluetooth modules with the intention of pairing them, for the communication of our fitness tracker, we found the datasheet and then ran through the following online tutorials for the module:

We had the best results with the last site, and each website details their own success with their particular version of the module. All have several comments relaying others success, despite this, we had no luck pairing the the modules ourselves. This shows there is variation in the modules, what works for one does not necessarily work for all.


A Smart Pan Project



The suggestion for the project is to investigate the potential savings to be made from creating a smart sauce pan, to optimise electric hotplates and hobs. We began by purchasing a MAX6675 Thermocouple and a cheap hotplate. We already had a 5V relay module rated 240V @ 7Amps. Below is a photo showing the inside of the hotplate. There is a power supply, thermal fuse, and a basic thermostatic switch. Our 5V relay module is wired inline of the power supply, making sure to isolate it from any metal casing. The thermocouple has been screwed through the supporting chassis, so that it is in contact with the underside of the heating element.

hot plate guts.jpg

The initial plan is to map the cooling rate of the heating element to see if the residual heat when the power is off is usable, and to what degree.

Experiment Setup

Experiment Board_bb

Earn Your Energy

After researching available Bluetooth modules, I discovered there are a few things to consider. Bluetooth operates using a communication setup, where a module is either listed as a master, or a slave. Some can be set as either, which has obvious benefits.

Bluetooth networks (commonly referred to as piconets) use a master/slave model to control when and where devices can send data. In this model, a single master device can be connected to up to seven different slave devices. Any slave device in the piconet can only be connected to a single master. (Sparkfun, 2018)


(Sparkfun b, 2018)


Further reading reviews of modules on the market highlighted the HC-05 as an accessible, readily available and relatively cheap option. It also has the option to function as either master or slave.  I have ordered two of these modules to start approaching the necessary communication aspect of this product.

Sparkfun, 2018. Bluetooth basics. [Online] Available at: <>%5BAccessed 18 March 2018].

Sparkfun b, 2018 (jimbo).Examples of Bluetooth master/slave piconet topologies . [Image online] Available at: <>%5BAccessed 18 March 2018].

Earn Your Energy

Project 2 Concept.


For this project my team is aiming to tackle the escalating health problems of the world’s population, that are largely attributed to poor lifestyle.

People who do regular activity have a lower risk of many chronic diseases, such as heart disease, type 2 diabetes, stroke, and some cancers.

Research shows that physical activity can also boost self-esteem, mood, sleep quality and energy, as well as reducing your risk of stress, depression, dementia and Alzheimer’s disease.

“If exercise were a pill, it would be one of the most cost-effective drugs ever invented,” says Dr Nick Cavill, a health promotion consultant. (NHS Choices,2015)

Our proposal is to produce a smart power socket that delivers energy in return for exercise. The aim is to make people more active, increase their awareness of how much energy they consume, and ultimately, get them to waste less energy. It may well encourage people to enjoy the broader benefits to exercise, for example: social interactions, and self improvement.

The product will consist of a wearable activity tracker, and a smart power socket. The two will interact via a bluetooth module.



We began by purchasing two HC-05 class 2 bluetooth modules, with the intention of pairing them as a master and slave. The modules were bought from for £5.49 each.

It was after research of bluetooth options that we settled on the HC-05, because of the extent of successful pier examples and articles available on the internet. Though we would have much less success ourselves.

HC-05 datasheet

(Martyn curry, 2014)

The module is wired with a voltage divider lowering the input to 3.3V, this is as per the requirements from the datasheet. In addition to this setup, we had an LED wired to the STATE pin, this supposedly should indicate when the module has successfully paired with another device.

Default Settings

The default settings for new modules are
– Name = HC-05
– Password = 1234
– Baud rate in communication mode = 9600*
– Baud rate in AT/Command mode = 38400

*Our default baud rate is listed as 38400


After wiring the bluetooth module, it’s possible to change things such as the its name, individual password, etc. Start by uploading a blank sketch to the arduino, open the serial monitor and type “AT”, the module should respond with “OK”.


Refer to page 5 of the datasheet for AT the commands.


Martyn curry, 2014. Arduino With HC-05 Bluetooth Module in Slave Mode. [online] Available at: <> [Accessed 6 April 2018].

NHS Choices, 2015. Benefits of Exercise. [online] Available at: <; [Accessed 18 March 2018].




L7805 voltage regulator

Essentially the voltage regulator supplies a 5v output with 1.5A  to within 2%. It works by dissipating excess energy as heat. If the circuit draws a lot, then a metal heat sink is required to dissipate more heat.


Pin on the left is voltage in

Centre pin is ground

Pin on the right is voltage out

(Z-HUT, 2017)

Links to the datasheets are in the references.


Authorship or Source, Year. Title of web document or web page. [type of medium] (date of update if available) Available at: include web address/URL * [Accessed date].

All Data Sheet, 2018. Electric components datasheet. [online] Available at: <> [Accessed 24 February 2018].
Z-HUT, 2017. How to power your ARDUINO project with a L7805 voltage regulator.  Available at: <!v=eTapK5dRaw4> [Accessed 24 February 2018].

SW-520 tilt sensor


The tilt sensor is essentially a switch. It contains a little ball that moves inside, making or breaking a circuit depending on its position. The ball can be heard by gently wobbling the sensor, and its effect can be shown by using a multimeter to test the continuity between its two legs, and leaning the sensor over.

 Tilt sensor fritzing

(Adafruit learning system, 2017)

This is the pseudo-code as I understand it so far, the loop and debounce are currently incomplete. The code follows the flowchart.

Tilt sensor pseudo-code

/* Better Debouncer
* This debouncing circuit is more rugged, and will work with tilt switches!

int inPin = 2; // the number of the input pin
int outPin = 13; // the number of the output pin

int LEDstate = HIGH; // the current state of the output pin
int reading; // the current reading from the input pin
int previous = LOW; // the previous reading from the input pin

// the following variables are long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0; // the last time the output pin was toggled
long debounce = 50; // the debounce time, increase if the output flickers

void setup()
pinMode(inPin, INPUT);
digitalWrite(inPin, HIGH); // turn on the built in pull-up resistor
pinMode(outPin, OUTPUT);

void loop()
int switchstate;

reading = digitalRead(inPin);

// If the switch changed, due to bounce or pressing…
if (reading != previous) {
// reset the debouncing timer
time = millis();

if ((millis() – time) > debounce) {
// whatever the switch is at, its been there for a long time
// so lets settle on it!
switchstate = reading;

// Now invert the output on the pin13 LED
if (switchstate == HIGH)
LEDstate = LOW;
LEDstate = HIGH;
digitalWrite(outPin, LEDstate);

// Save the last reading so we keep a running tally
previous = reading;

(Lady ada, 2018)

“int inPin = 2;” refers to the input at digital pin 2,

“int outPin = 13;” refers to the output at digital pin 13.

“digitalWrite(inPin, HIGH);”  turns on the built in pull-up resistor

“long time = 0;         // the last time the output pin was toggled

“long debounce = 50;”   // the debounce time, increase if the output flickers

The program is set to read pin 2 every 50 milliseconds. As there is an actual ball bearing moving to make or break a circuit, the “debounce” section allows for the ball to settle. Otherwise as it moves into place, every small vibration will be read as a new command. This could be changed to make it more or less sensitive.

This video shows the basic setup. The on board LED is switched off when the tilt sensor moves past 90 degrees. It doesn’t matter which direction the sensor faces. 


Lady ada, 2018. Using a tilt sensor. [online] Available at: <; [Accessed 23 February 2018].

Adafruit learning system, 2017. Tilt sensor [pdf] Adafruit. Available at: < [Accessed 23 February 2018].