Upload
dangliem
View
220
Download
1
Embed Size (px)
Citation preview
www.sixfab.com-1-
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
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
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
www.sixfab.com-4-
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
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
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
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
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
7~6~54
~3210
IOrRST3V35VGND
GND
Vin
SCLSDAArefGND
1312
~11~10~98
0
1
2
3
4
5
5V
GND
5V
GND
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
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
7~6~54
~3210
IOrRST3V35VGND
GND
Vin
SCLSDAArefGND
1312
~11~10~98
0
1
2
3
4
5
5V
GND
5V
GND
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