Project showcase
BLE Larson Scanner (Hackster Box Project)

BLE Larson Scanner (Hackster Box Project) © GPL3+

Create your Larson (Cylon or Kit Car) Scanner, controlled by BLE with the Arduino 101, made with Hackster Box

  • 4,051 views
  • 2 comments
  • 13 respects

Components and supplies

Apps and online services

Ide web
Arduino IDE
MIT App Inventor App Inventor

About this project

Introduction

For some time now, I've wanted to do the Larson Scanner (Cylon & Kit Car effect), since I'm a fan of science fiction series, taking advantage of the launch of the Hackster Box, I decided to use it for this project . So I started searching the net for some examples; I found several and they all used a potentiometer to control the speed of the LEDs. This made me think that with the Arduino 101 I could do the same, but using a mobile app and BLE instead of the potentiometer, so I put my hands to work and this is the result.

This its another video more closer, but the quality its very low, sorry

https://youtu.be/8vVHFPVY0wM

Let's start with the assembly of the circuit.

We will need the following materials, all included in the hackster box:

  • 1 Arduino 101
  • 1 Protoboard
  • 6 LEDs
  • 6 Resistors 1k

Wires

Make the circuit as shown below.

Steps

Copy the Arduino code from the link below and upload to Arduino 101.

Load the App Inventor project and install it on your Android phone.

Link the device "LARSON", run the app "Hackster Live Larson BLE". Search and select device "LARSON", and move the slider to change the speed of the scanner.

That is all. If you like the project, please click on the respect button and share it. Thanks!!!

Code

BLE Larson Scanner INOArduino
/*
 * Larson BLE Scanner made by Gustavo Reynaga @gsreynaga based on:
 * KITT emulator! Created By John Boxall http://tronixstuff.com
 * &
 * Copyright (c) 2016 Intel Corporation.  All rights reserved.
 * See the bottom of this file for the license terms.
 */

#include <CurieBLE.h>

BLEPeripheral blePeripheral;  // BLE Peripheral Device (the board you're programming)
BLEService LarsonService("19B10010-E8F2-537E-4F6C-D104768A1214"); // BLE Larson Scanner Service

// BLE LED Switch Characteristic - custom 128-bit UUID, read and writable by central
BLEUnsignedCharCharacteristic switchCharacteristic("19B10011-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);

void setup() {
  Serial.begin(115200);

  // set LEDs pin to output mode
  
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);

  // set advertised local name and service UUID:
  blePeripheral.setLocalName("LARSON");
  blePeripheral.setAdvertisedServiceUuid(LarsonService.uuid());

  // add service and characteristic:
  blePeripheral.addAttribute(LarsonService);
  blePeripheral.addAttribute(switchCharacteristic);

  // set the initial value for the characeristic:
  switchCharacteristic.setValue(0);

  // begin advertising BLE service:
  blePeripheral.begin();

  Serial.println("BLE LED Peripheral");
}

void loop() {
  // listen for BLE peripherals to connect:
  BLECentral central = blePeripheral.central();

  // if a central is connected to peripheral:
  if (central) {
    Serial.print("Connected to central: ");
    // print the central's MAC address:
    Serial.println(central.address());

    // while the central is still connected to peripheral:
    while (central.connected()) {
      // if the remote device wrote to the characteristic,
      // use the value to control the LED:
        if (switchCharacteristic.written()) {
        Serial.println(switchCharacteristic.value());
          int del = switchCharacteristic.value(); //Assign value to "del" variable
        
          digitalWrite(3, HIGH);   // turn on LED on pin 3
          delay(del);              // wait
          digitalWrite(3, LOW);    // turn it off
          digitalWrite(4, HIGH);   // turn on LED on pin 4
          delay(del);              // wait
          digitalWrite(4, LOW);    // turn it off
          digitalWrite(5, HIGH);   // turn on LED on pin 5
          delay(del);              // wait
          digitalWrite(5, LOW);    // turn it off
          digitalWrite(6, HIGH);   // turn on LED on pin 6
          delay(del);              // wait
          digitalWrite(6, LOW);    // turn it off
          digitalWrite(7, HIGH);   // turn on LED on pin 7
          delay(del);              // wait
          digitalWrite(7, LOW);    // turn it off
          digitalWrite(8, HIGH);   // turn on LED on pin 8
          delay(del);              // wait
          digitalWrite(8, LOW);    // turn it off
        
          digitalWrite(8, HIGH);   // turn on LED on pin 8
          delay(del);              // wait
          digitalWrite(8, LOW);    // turn it off
          digitalWrite(7, HIGH);   // turn on LED on pin 7
          delay(del);              // wait
          digitalWrite(7, LOW);    // turn it off
          digitalWrite(6, HIGH);   // turn on LED on pin 6
          delay(del);              // wait
          digitalWrite(6, LOW);    // turn it off
          digitalWrite(5, HIGH);   // turn on LED on pin 5
          delay(del);              // wait
          digitalWrite(5, LOW);    // turn it off
          digitalWrite(4, HIGH);   // turn on LED on pin 4
          delay(del);              // wait
          digitalWrite(4, LOW);    // turn it off
                  
        } else {                              // a 0 value
          Serial.println(F("Scanner off"));
          //digitalWrite(ledPin, LOW);          // will turn the LED off

          digitalWrite(3, LOW);    // turn it off
          digitalWrite(4, LOW);    // turn it off
          digitalWrite(5, LOW);    // turn it off
          digitalWrite(6, LOW);    // turn it off
          digitalWrite(7, LOW);    // turn it off
          digitalWrite(8, LOW);    // turn it off
          
        }
      }
    

    // when the central disconnects, print it out:
    Serial.print(F("Disconnected from central: "));
    Serial.println(central.address());
  }
}

/*
   Copyright (c) 2016 Intel Corporation.  All rights reserved.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/
BLE Larson Scanner AIA Source FileXML
Source Project for App Invnetor
No preview (download only).
BLE Larson Scanner APK FileXML
Android App APK file
No preview (download only).

Schematics

Fritzing Schematic Larson Scanner
Fritzing Schematic Larson Scanner
ble_larson_scanner_1-1_WeU4Jensqp.fzz

Comments

Similar projects you might like

Arduino 101 BLE RGB Lamp

Project tutorial by Gustavo Reynaga

  • 2,381 views
  • 2 comments
  • 10 respects

Arduino 101 Home BLE System

Project tutorial by Alexis Santiago Allende

  • 2,424 views
  • 0 comments
  • 11 respects

Arduino/Genuino 101 BLE Scanner

Project tutorial by Nenad Cetic

  • 3,536 views
  • 2 comments
  • 11 respects

Arduino 101 BLE App

Project in progress by Alexis Santiago Allende

  • 10,795 views
  • 26 comments
  • 51 respects
Add projectSign up / Login