Bluetooth Lamp; Android Raspberrypi Unicornhathd

by ThePardoxa in Circuits > Raspberry Pi

808 Views, 0 Favorites, 0 Comments

Bluetooth Lamp; Android Raspberrypi Unicornhathd

Unicornhathd - instructable android raspberry bluetooth

Intro:

We are going to make an remote controllable ambient light. You can see the result in the video. I am not a native english speaker, so bear with my language.

You should not be afraid of terminals, since we will not use the Desktop image for the Pi. I believe this instructable is doable with no prior experience with terminals, thou I suppose it would include quite a bit of googling and might be a bit frustrating...

What do you need:

  • Raspberrypi Zero W (Buy a Raspberry pi Zero WH if you do not want to solder anything)
  • Micro SD Card (for the Raspberry pi image. 8GB should be more than enough)
  • Power supply for Raspberry pi
  • Unicorn hat hd
  • Android smartphone (everything since 4.0.0 should work, though I only tested 7.1.1)
  • Monitor (only for initial setup - you will connect the pi to it. Note: You might also need adapter to connect your Pi to the Monitor)
  • Keyboard (only for initial setup - you will connect the pi to it. Note: You might also need adapter to connect your keyboard to the Pi)
  • A computer with Android Studio (free to download if you don't have it installed yet)
  • WLAN with internet access (only for initial setup of pi)

(If you want I can add the App to the playstore, so you can skip the android studio part)

Raspbian

Pins:

If you bought a Raspberry Pi Zero with separate pins: solder them to your Pi.

Image:

Download Raspian Stretch Light.

Flash it to your SD card. For example with BalenaEtcher.

Starting:

Insert the Sd in the Raspberry. Connect the monitor and Keyboard to the pi. Connect your power supply. The pi should boot.

Default username: "pi"

Default password: "raspberry"

Note: The default Keyboard layout is US. You can change that after you logged in to your pi using raspi-config.

Raspberry Setup

Follow the instructions of the README on my GitHub Repository. It explains everything Step by Step.

Android Part

ScreenshotGitHub.png
Screenshot from 2019-03-10 17-24-28.png
Run.png

You should have a running Pi now.

Install Android Studio.

Clone the GitHub Repository for the Android part using git (or just download the zipped code if you have no experience with git and do not want to learn it).

Open Android Studio and use that to open the Project. Connect your Android via USB with your computer.

Click on import existing Android Studio Project. Select the folder Lampe2. If it asks you to add a file to git: select cancel/no.

Click on "Run->Run 'app'". Select your device from the selected devices and click "ok".

You might need to install missing stuff. If you get a red error message with a blue highlighted word, click on the blue word and it should install automatically.

If you have any problems, don't hesitate to ask.

The App

Screenshot_20190310-161821.png
Screenshot_20190310-161836.png
Screenshot_20190310-161800.png
Screenshot_20190310-161750.png
Screenshot_20190310-161916.png
Screenshot_20190310-161846.png
Screenshot_20190310-161848.png
Screenshot_20190310-161814.png
Screenshot_20190310-161852.png

You should have the App installed now. And your android should be paired with the pi.

Activate Bluetooth on your Smartphone.

Select your Pi from the list of paired devices.

Select a Command and Click on send.

Sometimes the connection has some problems. In this cases: Wait until you see the message "Lamp not found" and try again.

HAVE FUN