Introduction: LOFI Blocks - Control Arduino Robot With Mobile App
LOFI Blocks is an app and a robot recipe that will help you learn (or teach others!) how to control ROBOTS
By snapping colorful blocks you will learn principles of programming and code your robot to avoid obstacles, follow light and do plenty of other things.
More info: WWW.LOFIBLOCKS.COM
HOW TO GET THE ROBOT?
BUILD IT YOURSELF! - if you have an Arduino board together with some basic electronic components you can make a DIY version of LOFI Robot from our recipe that will work with LOFI Blocks app.
GET OUR KIT - if you would like to have an all-inclusive package with all the parts needed to build the robot and user friendly LOFI Brain controller order our LOFI Robot - EDUBOX kit.
WHAT CAN THE APP DO?
- Simple interface for visual programming - based on Google Blockly, similar to Scratch.
- Connects with LOFI Robot or any other Arduino based robot.
- Blocks for controlling two DC motors, four analog inputs, four analog outputs (PWM or servo), distance sensor and buzzer.
- Built in gamepad and accelerometer to control your robot.Built in inputs monitor and a basic console to simplify debuging
Step 1: CONFIGURATION
- Build a robot form LOFI Robot EDUBOX kit or DIY Arduino version
- If you are using Android pair your device with bluetooth module. If you are using iOS pairing is not necessary.
- Upload LOFI Robot firmware to your LOFI Brain controller or other Arduino that you are using.
- Install LOFI Blocks app on your device.
- Launch the app and click robot head icon in the top-right corner, connection panel will appear with list of available robots that you can connect to.If the app connects properly with the robot a round outline will appear on the robot head icon.
- You can start to code!
- Android - min. Android 4.0
- iOS - min. iPad3 or iPhone5
- Online - works on Chrome (in progress)
- Ofline - Windows and Mac OSX (in progress)
DO IT YOURSELF VERSION CONSTRUCTION
LOFI Robot provides a set of lasercut wooden blocks to start building your robot. You can find building manual and link for design files HERE or on Instructables. If you have access to a lasercuttter (maybe you can find one available in your local makerspace or fab lab) and some vector drawing software such as free AutoCad360 you can easily modify the parts to use it with Arduino board and breadboard on top. Without the lasercut part still it shouldn`t be too complicated to build a two-wheel robot from scratch. Find some plastic or wooden plate to mount dc motors and arduino on it, use some duck tape, zip ties, your imagination and you are almost there. If you are into 3D printing you can find plenty of 3D printed robot chasis on the web.
ELECTRONIC PARTS LIST
Arduino Leonardo or UNO - or in fact any other Arduino compatible boardBreadboardJumper wires2 x geared DC motorL293D - dc motor driverHC-SR04 distance sensorBluetooth module - most popular HC-05, HC-06 bluetooth 2.0 modules or HM-10 BLE module for iOSBuzzerSome kind of power supply - 4xAA battery pack or a powerbank
INPUTS and OUTPUTS
Four analog inputs and four analog outputs in LOFI Blocks are related to Arduino pins as follows:
INPUT1 - A0
INPUT2 - A1
INPUT3 - A2
INPUT4 - A3
OUTPUT1 - D10
OUTPUT2 - D9
OUTPUT3 - D6
OUTPUT4 - D5
Please notice that digital pin 5 is shared between OUTPUT4 and motor M2 power regulation.
To supply power and direction control to DC motors we use an L239D motor driver.
Connect it to Arduino board as follows:
ENABLE1 - D3
INPUT1 - D4
OUTPUT1 - DC motor 1-1
GND - GNDGND - GND
OUTPUT2 - DC motor 1-2
INPUT2 - D2Vs - 5V
ENABLE2 - D5
INPUT3 - D7
OUTPUT3 - DC motor 2-1
GND - GNDGND - GND
OUTPUT4 - DC motor 2-2
INPUT4 - D8
Vss - 5V
We use bluetooth for mobile communication between the app and arduino board
On Android LOFI Blocks communicates with bluetooth 2.0 (classic) modules such as HC-06 or HC-05 or any other similar module. BLE support on Android is on the way!
On iOS the app communicates with HM-10 and HM-11 bluetooth LE modules, depending on their UUID, service and characteristics IDs, so by now it will not work with other BLE modules.
If you needto use a different BLE to Serial module it might be possible to change its UUID and characteristics to mimic HM-10. LOFI Brain firmware uses serial speed 57600 bauds to communicate with bluetooth module. Most bluetooth modules have the default speed set to 9600 bauds so keep in mind to change it with AT commands or modify the firmware.
Connections (bluetooth - arduino):
Vcc - 5VGND - GND
TX - RX
RX - TX
The most popular HC-SR04 ultrasonic distance sensor is used for for basic object detections and object avoidance.
Connections (HC-SR04 - arduino):
Vcc - 5v
Echo - D11
Trig - D12
GND - GND
Simple on/off buzzer is used as basic sound actuator.
Connections (buzzer - arduino):Signal - D13GND - GND
UPLOAD LOFI ROBOT FIRMWARE TO ARDUINO
LOF Brain firmware for ARDUINO LEONARDO (or similar ATMEGA328u4 boards).
etolocka made it!