Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Visible Light Communication using RasPi and a Smartphone

Tue Jun 02, 2015 3:35 pm

Hi everyone,

I am new to Raspberry Pi programming and I have a quite difficult school project. I need to create a VLC (visible light communication) emitter using a Raspberry Pi 1 model B and one (or multiple) LED(s). The receiver is a smartphone, I need to receive and decode some data on it.

I have found that the camera of the smartphone can take pictures every 40 ms. This gives a very low data rate, since I have to transmit files of about 10 to 100 Kilo-Octets.

I have no choice regarding the emitter, it must be a Raspberry Pi with LEDs, however I chose to use a smartphone because my solution needs to have the smallest amount of hardware (meaning : I have a smartphone at my disposal for this project, but I do not have any additionnal Raspberry.)

I have, of course, tried to find solutions on Google and in this forum but couldn’t find anything useful.
Any help would be greatly appreciated.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Visible Light Communication using RasPi and a Smartphone

Tue Jun 02, 2015 6:22 pm

How many LEDs can you use? you can vastly increase your data transmission rateby adding more.
Doug.
Building Management Systems Engineer.

scotty101
Posts: 3723
Joined: Fri Jun 08, 2012 6:03 pm

Re: Visible Light Communication using RasPi and a Smartphone

Tue Jun 02, 2015 8:39 pm

What kind of school do you go to!! Most University Graduates would struggle to get that working with any accuracy.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

drgeoff
Posts: 9824
Joined: Wed Jan 25, 2012 6:39 pm

Re: Visible Light Communication using RasPi and a Smartphone

Tue Jun 02, 2015 9:10 pm

scotty101 wrote:What kind of school do you go to!! Most University Graduates would struggle to get that working with any accuracy.
I left school in 1968. Before that I had transmitted analogue speech the length of an optical bench. Optical emitter was a torch bulb and the sensor was a glass encapsulated transistor (OC71) which had the paint scraped off and then put in a centrifuge to move the opaque internal goo away from the workings. Yes, the speech was a bit muffled as the bulb's inertia curtailed the overall frequency response!

User avatar
procount
Posts: 1746
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Visible Light Communication using RasPi and a Smartphone

Tue Jun 02, 2015 10:06 pm

Search for LiFi on google or wikipedia for more info.

I have seen a demonstration of a small chinese accessory that plugs into the microphone socket of a smartphone that detects such visible light frequency communication and converts it to sound so that the smartphone can decode it. This might be a way to up your communication rate. I think they were quite cheap, but I don't have a source reference unfortunately.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Tue Jun 02, 2015 10:28 pm

Thank you all for your replies. I have made a lot of research about LiFi but I have mostly found articles that explain this technology but doesn't go much into detail. And most of the time, people use an Arduino or Raspberry as emitter and as receiver. VLC communication between a RasPi and a Smartphone has not been done very often. I've only found very vague articles about it. If you ever find again that article made by the Chinese Students, could you please give me the link ?

As for the number of LEDs, it does improve the data rate, but I've calculated that with 32 LEDs blinking together, it would take no less than 10 seconds to transmit 1 Ko. So, having multiple LEDs increases my data rate, but it is not enough, I would need to do something along with it.

I will try to see if it is possible to make a component for the smartphone.

User avatar
procount
Posts: 1746
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Visible Light Communication using RasPi and a Smartphone

Tue Jun 02, 2015 11:47 pm

PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 7:58 am

Thanks for the link.
I also forgot to mention that my "product" has to work on any OS (Android, Windows, iOS). So if I built a receiver hardware to plug into a smartphone/tablet, that works with an app that I created, would it still be possible to have a cross-platform "plug and play" device ? Because I believe there could be some compatibility issues with Apple..

ghans
Posts: 7874
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 8:12 am

I know of similiar approaches where the device connects to the headset/earphone port. A software modem contained inside the app
can do the heavy work , making the actual hardware cheaper. Apple might still block your app from entering their store - their hardware ,
their rules (Thanks DMCA).

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 8:31 am

How Flexible are the definitions of "must be LEDs"?

If you have a LED display would this count? (that would push your data rate well up).

Technically the Pi is passing a signal to the LEDs which are outputting a visible light signal that the phone receives.
Doug.
Building Management Systems Engineer.

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 8:38 am

Unfortunately a LED display is not possible. I have to transmit data by blinking a LED (or multiple LEDs).

User avatar
DougieLawson
Posts: 36179
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 8:44 am

Kohime wrote:Unfortunately a LED display is not possible. I have to transmit data by blinking a LED (or multiple LEDs).
[The other] Doug meant "Does it have to be a visible LED or would using an IR LED be possible?"
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 8:55 am

My project was to design a VLC system using a Raspberry. So, infrared LEDs are not really an option, either.

User avatar
DougieLawson
Posts: 36179
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 9:15 am

Kohime wrote:My project was to design a VLC system using a Raspberry. So, infrared LEDs are not really an option, either.
The trouble you'll have in the visible spectrum is that the sensor can't discriminate between your light source and ambient light unless you use something like a fibre optic to ensure that the receiver only sees the source. You'll need one LED and one sensor at each end, modulate the sending LED with a serial protocol signal, decode it from the sensor.

IR is easier because IR sensors are common and modulated IR signals are all around us.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 11:51 am

DougieLawson wrote:
Kohime wrote:Unfortunately a LED display is not possible. I have to transmit data by blinking a LED (or multiple LEDs).
[The other] Doug meant "Does it have to be a visible LED or would using an IR LED be possible?"
Nope, I was asking if he could cheat by using a large array of LED's something like an 8x8 matrix or a 4 digit 7 segment display would increase his data transmission rate enormously.
DougieLawson wrote:
Kohime wrote:My project was to design a VLC system using a Raspberry. So, infrared LEDs are not really an option, either.
The trouble you'll have in the visible spectrum is that the sensor can't discriminate between your light source and ambient light unless you use something like a fibre optic to ensure that the receiver only sees the source. You'll need one LED and one sensor at each end, modulate the sending LED with a serial protocol signal, decode it from the sensor.

IR is easier because IR sensors are common and modulated IR signals are all around us.
how about obstructing the visible light between the LED and the smartphone camera, perhaps a short cardboard tube?
Doug.
Building Management Systems Engineer.

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 12:04 pm

I was indeed thinking of using something like a piece of cardboard to avoid "interferences" from ambient light.

And regarding the 8x8 matrix or the 7segment display, I have not really considered it. The solution I have been working on is really about sending binary code by blinking a led.

drgeoff
Posts: 9824
Joined: Wed Jan 25, 2012 6:39 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 12:11 pm

Why do I get the impression that the intention of whoever set you this project was to make you encounter all the problems rather than to get a useful solution? :)

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 12:21 pm

What my teachers said to me was to use a Raspi and LEDs to transmit some data, and using as little hardware as possible. My solution also has to be "cheap" for a user. So I chose the smartphone (since most of us have one today), this is where I have some problems, the camera being "too slow" for this technology :?

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 2:23 pm

If I were to create a receiver to plug into a phone/tablet, for example with a jack plug, could you please indicate me what kinds of components I might need ? Would you advise a photodiode for example, or a photoresistor ?

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 3:45 pm

Kohime wrote:If I were to create a receiver to plug into a phone/tablet, for example with a jack plug, could you please indicate me what kinds of components I might need ? Would you advise a photodiode for example, or a photoresistor ?
you will need some kind of micro-controller to receive the signal and interpret it for the phone/tablet.

I would suggest one of these connected to one of these and either a photo diode or photo resistor.

and skip using anything else.
Doug.
Building Management Systems Engineer.

User avatar
Douglas6
Posts: 4770
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 4:06 pm

My phone has a photoresistor (or some such), to automatically adjust the screen brightness. I've no idea how accessible or suitable it would be for this project.

paulie
Posts: 263
Joined: Thu Jan 19, 2012 6:51 pm

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 6:13 pm

Not sure if this is too complicated for your needs:

http://www.g4jnt.com/OpticalComms/OpticalComms.htm


Radio Amateurs have been doing this for some time, so there are more webpages than just that one...
It has been my custom to use Xeyes

User avatar
B.Goode
Posts: 8617
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Visible Light Communication using RasPi and a Smartphone

Wed Jun 03, 2015 6:32 pm

Kohime wrote:What my teachers said to me was to use a Raspi and LEDs to transmit some data, and using as little hardware as possible.
It might be helpful to know the full brief of your project. I can fulfill that simple requirement very easily and cheaply. (Because there is no matching requirement to receive and process or display the data.)


Where does all the other stuff about 100ko, smartphones, multiple Operating Systems etc come from?

(And of curiosity: what does 'school' mean where you live? In the UK it is usually taken to mean the end of compulsory state education, hence up to no more than 18 years of age.)

Kohime
Posts: 11
Joined: Tue Jun 02, 2015 3:07 pm

Re: Visible Light Communication using RasPi and a Smartphone

Thu Jun 04, 2015 7:51 am

B.Goode wrote:
Kohime wrote:What my teachers said to me was to use a Raspi and LEDs to transmit some data, and using as little hardware as possible.
It might be helpful to know the full brief of your project. I can fulfill that simple requirement very easily and cheaply. (Because there is no matching requirement to receive and process or display the data.)


Where does all the other stuff about 100ko, smartphones, multiple Operating Systems etc come from?

(And of curiosity: what does 'school' mean where you live? In the UK it is usually taken to mean the end of compulsory state education, hence up to no more than 18 years of age.)
What I meant by school is engineering school. We often have some projects like that, where we are challenged to make some technologies. I have told you all of my requirements, that is all there is to this project. Making a VLC communication system.

User avatar
procount
Posts: 1746
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Visible Light Communication using RasPi and a Smartphone

Thu Jun 04, 2015 2:50 pm

So, the Smartphone VLC to sound accessory I referred to earlier is available from Satori Electric Co, Japan.

Part No ID-RXS
Description: Optical receiver of visible light communication
Approx cost is 4,000 JPY, ~21 GBP, ~32 USD, shipping is probably extra.

I couldn't find the part on their website, so if you are interested in it, maybe you should email them for more info.
http://www.satori.co.jp/english/inquiry.html
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “Beginners”