Connecting your shiny new ESP8266 to WiFi can be as simple or as complicated as you please. Most people decide to manually add it. Some people find clever ways to make the bloody thing connect itself. [Eduardo Zola] transfers his WiFi password using the flashing light of a smartphone screen.
A simple photo-resistor and a bit of tinkering allows him to easily send credentials — or any data really — to his ESP8266, through the power of LiFi. Short for Light Fidelity, LiFi transmits data using light with on and off states representing digital values. It can use visible light, or reach into either the ultraviolet or infra-red radiation if need be. For the nitty-gritty details on the subject, check out our primer on LiFi.
A flashing LCD screen and a photo-resistor barely make the cut for a one-way LiFi system, but [Eduardo Zola] makes it work. The approach is to build a resitor divider and watch an input pin on the ESP for changes.
The trick is to keep ambient light out of the mix. The test sensor shown here places the LDR in a black cap, but [Eduardo] 3D-Printed a slick little enclosure for his reverse flashlight so it fits flush with the phone screen. One click and about half a minute of a flashing screen later, and the Wi-Fi credentials are transferred. This circuit could really be added onto any project, for short data transfers. With a bit more work on the sensor circuit, speed could be improved with the limiting factor being the timing on the phone screen itself.
Since the ESP8266 has its own WiFi connection, it’s likely you’ll use that for data transfer once the LiFi gets it onto the network. But any situation where you don’t have a full user input or a network connection could benefit from this. Pull out that old scrolling LED matrix project and add this as a way to push new messages to the device!
*cough* electric imp blinkup ;)
Phototransistors are also a bit more responsive than LDRs!
The Quirky Pivot Power Genius smart power strip also used this method. I believe that it is based on an Electric Imp. It was a b***h to get it working with my Android phone; I had to borrow an iPhone to get it to work.
I worked support for them. A nightmare.
The Porkfolio had a translucent (not transparent, translucent) window over the E-Imp sensor. Guess how well it worked.
The Eggminder was a wifi device you put in your metal, grounded refrigerator. Guess how well it worked.
Yeah, exactly. When somebody uses photoresistors for optical pulse detection you know they didn’t do the research and/or come from the Arduino crowd where nobody cares and uses ready-made modules. LDR’s can be *really* slow, like sub 1 kHz or worse.
In my experience, those LDRs are horribly slow. I was seeing close to 1/3rd second transition time lightdark.
True though I think you’re limited to 60 to 120hz update on the LCD anyway unless you bypass the android screen driver.
You probably could get higher data rates with audio though it would require a little more hardware on the 8266.
Thats how the Amazon Dash buttons do it. Yes, theres an I2S mic in there.
Came to say the same thing. The hysteresis on the LDR makes it bad choice. It will certainly limit the data rate, although that probably doesn’t matter in this application.
Timex Data Link anyone?
https://youtu.be/2VmtPaiOBwI?t=89
I had one of those..>!
I was thinking the same thing.
…and the lovely blinking CRT that used to start humming after long transfers to the phone.
…memories….ahh…
I had an oregon scientific organiser with data link but can’t find the model number for the life of me
+1 Yup
Why not use an LED as the photosensor? Is the esp8266 no sensitive enough, is it too complex? Almost all gadgets have an LED as an output signal already – make it dual purpose. That would be an elegant solution.
you can use an LED as well
http://www.paleotechnologist.net/?p=965
Could you use a really powerful laser point up at the sky and make a network with some people in your neighborhood? (assuming it doesn’t disturb air traffic….)
There are some open source implementations of Free space optical networks such as RONJA ( http://ronja.twibright.com/ ), but they are usually hard to align and point to point only.
I have a default esp8266 scheme that I use on most projects. It’ll initially boot as an encrypted AP and host a simple form for putting in the credentials for a nearby WiFi network. After that is submitted, the esp8266 reboots and uses the saved credentials. It’ll use that for connectivity until it’s rebooted while a certain pin is held high, in which case, it’ll do the initialization routine again.
This is exactly what this library does: https://github.com/tzapu/WiFiManager
Oh, the hours that you could have saved me!
Where’d the LiFi mention come from? The original project doesn’t claim it is LiFi. As mentioned by others, the Electric Imp and Timex watch use a similar system and they’re definitely not LiFi. Just because it uses pulsed light for communication doesn’t mean it is anything to do with LiFi ><
Didn’t there use to be TV shows that taught you to build a device like this and would blink you little programs for your Commodore 64, or something?
I can see it already has a blue and an orange led, that can be used as phototransistors with some modifications, when not outputting light. As these are not only faster but wavelength sensitive, I’m having a theory that the message could also be 2 bit color coded further doubling the transmission speed.
Or just use … WIFI (though probably less secure): https://www.google.com/search?q=esp+smart+config
QR code and a camera…barcode…Bluetooth transfer. Do we need to build yet another way to do this?
Did I2C with GIFs on a web page, pair of photodetectors to read it.
http://techref.massmind.org/techref/io/serial/i2c/withGIFs.html