Prototype of Li-Fi technology to send data via light using Arduino and JavaScript.
Demo transmitting a Stripe Payment Link via light:
For more info, check out my blog post.
- 2 Arduino UNO
- A breadboard
- Jumper wires
- A 10k resistor
- A Neopixel Jewel (a standard LED will work too but you will need an extra resistor and the transmitter and receiver will have to be set up much closer as an LED is less bright than the Jewel).
- A phototransistor
Assembled following these schematics:
- Change directory to the ./js folder
- Run
npm install
- Open 2 terminal windows, one for the transmitter and one for the receiver.
- 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
- Run
- Upload Firmata on the receiver board
- Align the transmitter and receiver
- Run
node transmitter.js
in the trasnmitter terminal window and in the other one, runnode receiver.js
.
If everything is working fine, letters should start printing in the receiver terminal window.
- Change directory to the ./arduino folder
- Align the transmitter and receiver
- Upload the receiver sketch on the Arduino set up to the phohotransistor
- Upload the transmitter sketch on the Arduino set up to the NeoPixel Jewel
- Open the serial monitor and letters should start printing