Top Banner
www.sixfab.com -1- [email protected] 7 ~6 ~5 4 ~3 2 1 0 IOr RST 3V3 5V GND GND Vin SCL SDA Aref GND 13 12 ~11 ~10 ~9 8 0 1 2 3 4 5 5V GND 5V GND Blink Like in all microcontroller projects, first thing to learn on Tinylab is to blink an LED. We are going to learn controlling digital outputs on Tinylab with an LED. We can change the delay time, or use other components like relays and buzzers. Acquired skills: Defining input/output pins digitalWrite function delay() function Watchthevideo Seethecode
11

Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

May 02, 2018

Download

Documents

dangliem
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

www.sixfab.com-1-

[email protected]

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

Blink

Like in all microcontroller projects, first thing to learn on Tinylab is to blink an LED.We are going to learn controlling digital outputs on Tinylab with an LED. We canchange the delay time, or use other components like relays and buzzers.

Acquired skills:Defining input/output pins digitalWrite functiondelay() function

Watchthevideo Seethecode

Page 2: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

[email protected]

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

ButtonandLED

We are not using Tinylab to only output data, we can read data from the digital i/o pinsand interact other perhiperals according to the code we wrote. In this project, we use apush-button to control an LED. You can add other buttons or use other componentslike buzzer and relay to react our input with the buttons.

Acquired skills:Defining variables. digitalRead functionif-else clause

-2-

Watchthevideo Seethecode

Page 3: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

[email protected]

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

Buzzer

We have used the buzzer on our Tinylab before. Now we are going to use it with thehelp of an .h file to create melodies. If you are good with musical notes, you cancreate your own melodies using the note definitions given in the .h file.

Acquired skills:Adding an external file. Difference between setup() and loop() functions. for loop

-3-

Watchthevideo Seethecode

Page 4: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

www.sixfab.com-4-

[email protected]

LCD

We can use the LCD on the Tinylab to display measured, calculated and other data.You can write your name or the state of an LED (ON or OFF) to LCD.

Acquired skills:LCD functionsi2c comminucation

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

TINYLAB

by sixfab Inc.

GND

Watchthevideo Seethecode

Page 5: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

[email protected]

PotentiometerTunedLEDLight

We can dim the LEDs using a technique called PWM. In this project, we are using thepotentiometer on Tinylab to change the brightness of an LED. Alternatively, we canuse the temperature sensor or the LDR (light sensor).

Acquired skills:analogWrite functionanalogRead function

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

+-

GND

-5-

Watchthevideo Seethecode

Page 6: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

[email protected]

KnightRider

Knight rider is the common known name of the sequenced LED lights. It is based fromthe famous TV show. We can control the speed of the change with the potentiometeron Tinylab. We can display the delay time and which LED is at ON stage using LCD.

Acquired skills: Use of arraysMathematical functionsDisplaying variables on LCD

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

+-

GND

-6-

Watchthevideo Seethecode

Page 7: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

[email protected]

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

LDRandLED

We all can push a button to turn on a lightbulb. But what should we do if we want thelight to turn on based on the ambient light? We can implement this idea using thelight sensor and an LED on the Tinylab. It can also be used to turn on any electricalappliance with the help of the relay on the board.

Acquired skills:AC control using relay and a microcontrollerIntroduction to smart home projects.

-7-

Watchthevideo Seethecode

Page 8: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

[email protected]

7SegmentDisplay

7-segment displays are all around us: elevator floor indicators, calculators, clocks etc.In this project, we will increase and decrase the number displayed on 7-segmentusing buttons.

Acquired skills:Using a 7-segment displaylc.setDigit() functionlc.setRow() function

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

-8-

Watchthevideo Seethecode

Page 9: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

[email protected]

MobileControlledDeviceYou can use an app on your phone to open or close curtains at your home, turn ON orOFF any appliance with the help of a Bluetooth module and Tinylab. In this project,we are going to control the speed of a motor and LED on Tinylab via Bluetooth.You can also use the buttons on the app to control LEDs, buzzer, relay and you candisplay which button is pressed on the LCD. With the help of AppInventor, you caneasily make your own smartphone app to suit your needs.

Acquired skills:Bluetooth connectionsMathematical functionsUART comminucation

BluetoothConnected

MotorSpeedControl

Slow Normal

Fast UltraFast

-9-

Watchthevideo Seethecode

Page 10: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

[email protected]

XbeeControlledLight

Xbee modules are used to communicate between various devices. It also supportsmesh networks and can reach up to kilometers in range. In our project, we are usingthem to control the relay on Tinylab to switch ON or OFF a lightbulb.

Acquired skills:XBee communication Communication between two microcontrollersAC control using a microcontroller

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

XbeeConnected

-10-

Watchthevideo Seethecode

Page 11: Blink - Sixfabsixfab.com/tinylabexamples.pdf · appliance with the help of the relay on the board. Acquired skills: AC control using relay and a microcontroller ... WiFi connection

7~6~54

~3210

IOrRST3V35VGND

GND

Vin

SCLSDAArefGND

1312

~11~10~98

0

1

2

3

4

5

5V

GND

5V

GND

[email protected]

TwitterBot

Watchthevideo Seethecode

You can easily put an ESP8266 module in the socket and connect to internet with aTinylab. In our project, we are measuring the temperature and ambient light andposting the data to Twittter. You can make it automatic and tweet the sensor valueseach hour.

Acquired skills:WiFi connection using ESP8266AT command set of ESP8266Connecting to a server with Tinylab

TwitterBot

TemperatureLux

::

23°151

-11-

#tinylabreports#tinylab