Skip to content

charliegerard/lifi

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
js
 
 
 
 
 
 
 
 
 
 

Li-Fi

Prototype of Li-Fi technology to send data via light using Arduino and JavaScript.

Demo transmitting a Stripe Payment Link via light:

Demo transmitting a Stripe Payment Link via light

For more info, check out my blog post.

Material needed

Assembled following these schematics:

Schematics showing the 2 Arduinos set up

How to run

The JavaScript example

  1. Change directory to the ./js folder
  2. Run npm install
  3. Open 2 terminal windows, one for the transmitter and one for the receiver.
  4. In the transmitter window:
    • Run interchange install git+https://github.com/ajfisher/node-pixel -a uno --firmata to install the correct firmware on the Arduino.
    • Run node transmitter.js
  5. Upload Firmata on the receiver board
  6. Align the transmitter and receiver
  7. Run node transmitter.js in the trasnmitter terminal window and in the other one, run node receiver.js.

If everything is working fine, letters should start printing in the receiver terminal window.

The Arduino example

  1. Change directory to the ./arduino folder
  2. Align the transmitter and receiver
  3. Upload the receiver sketch on the Arduino set up to the phohotransistor
  4. Upload the transmitter sketch on the Arduino set up to the NeoPixel Jewel
  5. Open the serial monitor and letters should start printing