Code Monkey home page Code Monkey logo

arduino's People

Contributors

jpiat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino's Issues

VLC on Android Phone

Do you have plan to implement VLC in Andorid Phone for receiver using Camera ( transmitter using Screen or Flash) ?

Uu

Hi. Please help. I really like what you posted and wanted to make my project out of that. But I’m having issues with the arduino vlc. I have two arduino uno, two leds, and two phototransistors. The program compiles fine, and I can receive the raw data with the phototransistor. However, the raw data is not interpreted, and nothing shows up on the serial monitor besides the “start of receiver program.” So I guess it’s something with the code, but I’m using original code. I stayed up all night trying to figure out what’s going on, but failed. Please respond! Thank you!

util/atomic.h library not available

hello

I was trying to go through this code, then i realized that this "util/atomic.h library is not available in arduino.
Can anyone help me in this? Where to find i and what does this library do?

Receiver Logic Flow

Hi,
Would it be possible to provide some description about the receiver side logic flow?
Or more comments about those a few lines.

if(edge_val == 0 || edge_val == old_edge_val || (edge_val != old_edge_val && steady_count < 2))
{
if( steady_count < (4 * SAMPLE_PER_SYMBOL)){
steady_count ++ ;
}
}else{
new_word = insert_edge(&shift_reg, edge_val, steady_count, &(dist_last_sync), &detected_word);
if(dist_last_sync > (8*SAMPLE_PER_SYMBOL)){ // limit dist_last_sync to avoid overflow problems
dist_last_sync = 32 ;
}
//if(new_word >= 0){
steady_count = 0 ;
//}
}
old_edge_val = edge_val ;

From my understanding is like every edge is the half bit of manchester code, i don't understand why need to do so. Then if no change in the edge, we need to insert the edge??

transfer video

can send video using this device? what code should be changed or what devices should be added. thanks

the number of characters received

hai sir @jpiat, i I have received the data "hello world" correctly.
but, when I send data that amounts more than 11 characters it will disappear other. where is there a change of code in transmitter and receiver ?

pin connection in transmitter

Hi jpiat,
had a quick question
The instructions in a demo say that the led must be connected to pin 2
but i think you've used pin 13 in the code
which one of them is right?

Hello

I run your receiver project but always made this error
LiFiReceiver.ino:47:86: error: use of enum 'receiver_state' without previous declaration

what is that

Thank you

Connecting the components.

Can we kindly get an image of how the connections are done on both the the breadboard and the arduino board. I am using an Arduino UNO.

Which LED ?

This code is very interesting for me.
I tested with the red and the blue LEDs of the official Genuino starter kit.
I think my LEDs have not enough power because I must put the LED at about 1 mm.
Could you give me a reference of usable LEDs for this project, please?
Thanks in advance.
Sorry for my very bad English... I prefer writing in French...

Need a little more detailed guide on how to run this code

I tried running the code using recommended hardware and connections.
On the transmitting side I used an Arduino mega 2560 and on the receiving side I used an arduino UNO.
I uploaded the code and ran it. I saw the output on the serial monitor of the receiver side.
The only thing I got was:

"Start of receiver program"

The program did not execute further.

Could you please post a little more comprehensive guide to run this project?

What steps to undertake on the transmitting side?
What steps to undertake on the receiving side?
A circuit diagram maybe or a video explaining the execution?

Any help is appreciated.

Thank You!

Emitter and Receiver in one file as Transceiver?

I have tried making a transceiver using both the emitter and receiver codes in one file but it didn't work as expected. I have tried using two interrupts using timer1 and timer3 for sample_edge and bit_emit_half but the received data was kind of scrambled. Do you have any advice in making a transceiver using the codes?

variety words transmission

Dear Jpiat
Your code could run properly but we tried to transfer variety of words instead of hello world. We erase // before #define TRANSMIT_SERIAL and because of the sentence if(com_buffer_nb_bytes >= 32 || c == '\n'), if we press Enter on the keyboard the inputted sentence should be transferred. But the situation now is we could only transfer data if we input more than 32 words.

code of program

unsigned char frame_buffer [38] ; //buffer for frame
char frame_index = -1; // index in frame
char frame_size = -1 ; // size of the frame to be sent

//state variables of the manchester encoder
unsigned char bit_counter = 0 ;
unsigned short data_word = 0 ; //8bit data + start + stop
unsigned char half_bit = 0 ;
unsigned long int manchester_data ;

hy sir @jpiat , i don't understand the code above.
can you tell me please?

some question

Hi,
I have some question about the receiver side .
You use the LED to receive.
Why do you use the photodetector or photodiode?

I am not good at English ,so please forgive my poor english.

Possibility of transmission in greater reach?

Hello guys

I would like to mount the transmission system for longer distances, could I use the same code and adjust the power part, or besides setting a power part would I have to change something in the codes?
Somebody set up something for larger transmission distances

Thank you

arduino uno

@jpiat sir, i have any problem with the program in emitter. i use arduino uno for the transmit data.
whether the program is not suitable for use in arduino uno ?

ARDUINO UNO, LED, PHOTODIODA

I tried source code you for use in arduino uno but why fitting uploaded transmitter not send data to receiver ?

Modifying Emitter and Receiver

Hi jpiat! Thanks for the demo on VLC using arduino! I am trying to implement VLC using high power LEDs which are normally used for lighting instead of the regular ones. Unfortunately, the drivers for these LEDs are fixed and are not programmable. Could you guide me how I can replace the emitter with these high power LEDs as I see that you have also used a similar emitter? Did you used MOSFETs to drive the high power LED? P.S : As a receiver I will be using my camera phone to detect the light and hence the need for high powered LED. Any help will be greatly appreciated! Thanks

image

Extract value of 1 and 0 at receiver

Hi, I used your code to get communications between an LED and a photodiode. I am now trying to implement a positioning algorithm and I need to be able to find the sensor reading that corresponds to receiving a 1 and a 0 for distance estimation purposes. Do you know if it will be possible to do this with this code?
Thank you

Circuit Diagram

Can anyone please elaborate or upload jpeg file of the circuit diagram?

not able to send new data

hi jpiat
your code is too good
it is working right
but the problem is i am not able to transit new data
i.e i have the output
Hello World2
Hello world3
.....
and so on
i am not able to transmit new data from the serial monitor
i have not uncommented the line // Transmit_Serial. because i am not getting any output after that
do you have any suggestions ??

What is your 1 Watt RGB led bulb

Thanks for your sharing.
Could you please kindly tell us the information about your 1 Watt RGB led bulb ?
Where to buy, what's the specification, how to control your bulb (Relay or Mosfet) ?

Multiple Transmitter

i want to transmit the data not in all three at a time

  • 1 if i'm in under the 1st transmitter the data should only transmit in 1
  • 2 if i'm in under the 2nd transmitter the data should only transmit in 2
    i'm declaring like this
    ///
    #define OUT_LED0() DDRD = ((1 << 2))
    #define OUT_LED1() DDRD = ((1 << 3))
    #define OUT_LED2() DDRD = ((1 << 4))
    ////
    IN void setup()
    {
    OUT_LED0() DDRD = ((1 << 2))/// if i declare like this all three will start to transmit

OUT_LED1() DDRD = ((1 << 3))

OUT_LED2() DDRD = ((1 << 4))

So any one can help me in this.....

Increase the number of characters

Dear jpiat "
Hope you are doing well.
thanks for your great code it is very helpful.
i was wondering of there is any way to increase the number of characters send every time.
thanks in advance

Combine modulation with Manchester?

Hi, I've tried out your code, works fine with x9 LEDs to photodiode at other side.
Since Arduino UNO can't run the code in parallel. Is it possible to combine ASK into it without modifying the circuit at few hundreds Hz or kHz and then demodulate again?

use led bulb

hei sir @jpiat, if i want to use led bulb in my transmitter. which parts will change in emitter code?
please help me sir

not receiving

Hi!

First of all congrats on this project and thank you for sharing!
I am using the original code with no modifications and .cc IDE (although the new .h file solve that, just in case)

As in hardware:

2 arduino nano 328
2 5mm clear red LED
1 Mohm (Rx)
120 ohm (Tx)

emitter is in D13 and always on as espected but receiver in A0 is getting nothing no matter what distance (0-50cm) or light conditions I try I only get "Start of receiver program"

I have turn the debug if that is any help

Thanks!

captura de pantalla 189

Contact

Hello, would you have time to chat about a the emitter code and the Manchester coding

Thanks, Josh Gist. I can be reached through [email protected]

code issue

Dear jpiat
i have problem in modify your code to fit my needs(in my graduation project as i mention before) so i would to ask you about the difference between (&frame_index) and (&frame_size).and when you write
Serial.println(&(frame_buffer[1])); here (1) refer to (&frame_index) or (&frame_size). thanks in advance

Not able to dump the code to arduino nano

This is the error that i got

Arduino: 1.6.9 (Windows 10), Board: "Arduino Nano, ATmega328"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Harsha Sridhar\Documents\Arduino\libraries" -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10609 -build-path "C:\Users\HARSHA1\AppData\Local\Temp\buildd1c11d4a9e9f6d0154e39f1e4521038a.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Harsha Sridhar\Documents\ArduinoPrograms\LifiReceiver\LifiReceiver.ino"
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Harsha Sridhar\Documents\Arduino\libraries" -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10609 -build-path "C:\Users\HARSHA
1\AppData\Local\Temp\buildd1c11d4a9e9f6d0154e39f1e4521038a.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Harsha Sridhar\Documents\ArduinoPrograms\LifiReceiver\LifiReceiver.ino"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "C:\Users\HARSHA1\AppData\Local\Temp\buildd1c11d4a9e9f6d0154e39f1e4521038a.tmp\sketch\LifiReceiver.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\Harsha Sridhar\Documents\Arduino\libraries\TimerOne-r11" "C:\Users\HARSHA
1\AppData\Local\Temp\buildd1c11d4a9e9f6d0154e39f1e4521038a.tmp\sketch\LifiReceiver.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Users\Harsha Sridhar\Documents\Arduino\libraries\TimerOne-r11" "C:\Users\HARSHA1\AppData\Local\Temp\buildd1c11d4a9e9f6d0154e39f1e4521038a.tmp\sketch\LifiReceiver.ino.cpp" -o "C:\Users\HARSHA1\AppData\Local\Temp\buildd1c11d4a9e9f6d0154e39f1e4521038a.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
C:\Users\Harsha Sridhar\Documents\ArduinoPrograms\LifiReceiver\LifiReceiver.ino:2:28: fatal error: receiver_types.h: No such file or directory

#include "receiver_types.h"

                        ^

compilation terminated.

Using library TimerOne-r11 in folder: C:\Users\Harsha Sridhar\Documents\Arduino\libraries\TimerOne-r11 (legacy)
exit status 1
Error compiling for board Arduino Nano.

Mega 2560

Hi,
I would like to ask if i use Mega 2560 instead of mini pro any modification i need to make? Besides hardware connection issue and change the timer1 function to timer5. I assume since mega 2560 have a more powerful microprocessor than pro mini, will it make sense that it can somehow achieve transmission speed than pro mini?

Emitter LED

Dear Jpiat,

How did you connect wires to the emitter LED and how many arduino mini is need in emitter circuit? I am using the same emitter LED like you but i can't figure out how to connect to the arduino. Actually, I cant see any pin on emitter LED.

Adding parity

Hi,
I added a parity bit to the sent data, between the 8bit data and STOP and made the word length 11 instead of 10. (START - 8bit data - 1bit parity- STOP) I know the data is sent correctly, but i have trouble receiving it. I tried modifying is_a_word(), but I can't seem to separate the parity bit. Also, the STX probably isn't received, as you can see in the picture.
p
Could you show me how to modify the receiver code to separate the parity bit?
Thanks a lot for your reply...

Unable to get receive anything; transmitter only flashes during reset, then goes into "off" state

Hello,

I've been attempting to get this particular project working off and on for a few weeks now.

I built both emitter and transmitter circuits using pro minis (5V 16mHz). Both have better undergone recreation attempts using crystal (clear) LEDs of the following varieties:
UV-vis (Bright blue light; primarily emits in UV)
IR (Nonvisible)
Visible blue (complete visible spectrum emission)

I have several questions I believe will aid me in troubleshooting.

Transmitter:

  1. My transmitter performs the standard "restart" flashes for an LED. Afterwords, it goes into a constant "off" state. (Confirmed with a multi-meter and oscilloscope; voltage never exceeds "background" 10mv, 200us timescale.) I have uncommented the following line:

`#define OUT_LED() DDRB |= (1 << 5);

define SET_LED() PORTB |= (1 << 5)

define CLR_LED() PORTB &= ~(1 << 5)`

Receiver:

  1. My receiver, even when exposed to a constant emission source (i.e. the same LED in a constant "on" state) does not read an increase in voltage. I'm always iffy with the direction of LEDs, but especially so in this case. (This is a seemingly silly question, I know) but is the LED supposed to have the (+) end on the ADC pin even if it's receiving. It's been awhile since my semiconductors class, but I have this silly feeling that if it's receiving, the voltage that's being interrogated (by the ADC) should is applied in the reverse polarity of a normal LED. But in your schematic you say:

' |----1Mohm-----|
A0 ------|--- +led- ----|-------GND '

So I just wanted to confirm the Anode is, indeed, the side connected to A0.

Lastly, I receive this warning when compiling the receiver:

'LiFiReceiver.ino:98:59: note: in expansion of macro 'START_STOP_MASK'

         if(((*manchester_word) & START_STOP_MASK) == (START_STOP_MASK)){ // testing first position '

and this error

'LiFiEmitter.ino:169:14: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

char * msg = "Hello World" ;'

when compiling the transmitter.

I just wanted to see if you had encounter them before, and if they were meaningful.

Thanks a lot for you time (and project) it's very promising.

Error when compiling on Arduino Uno using IDE 1.6.8

I've been trying to compile your codes on my Uno but I've been having problem with LiFi Receiver part. Every time I tried to compile,warnings and errors pop up.Actually a warning pop up for the emitter too but when I tried changing the char* msg to constant char* msg , it stops popping up(does this change anything though?).However,I don't know what to do on the receiver.Below is the message that pop up.I'm using a Red Led on both Arduino though as I don't have a 120ohm resistor,I'm using 100ohm instead.

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino: In function 'int is_a_word(long int_, int, unsigned int_)':

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:94:43: warning: left shift count >= width of type [enabled by default]

#define START_STOP_MASK ((STOP_SYMBOL << 20) | (START_SYMBOL << 18) | STOP_SYMBOL) //STOP/START/16bits/STOP

                                       ^

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:98:38: note: in expansion of macro 'START_STOP_MASK'

         if(((*manchester_word) & START_STOP_MASK) == (START_STOP_MASK)){ // testing first position 

                                  ^

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:94:66: warning: left shift count >= width of type [enabled by default]

#define START_STOP_MASK ((STOP_SYMBOL << 20) | (START_SYMBOL << 18) | STOP_SYMBOL) //STOP/START/16bits/STOP

                                                              ^

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:98:38: note: in expansion of macro 'START_STOP_MASK'

         if(((*manchester_word) & START_STOP_MASK) == (START_STOP_MASK)){ // testing first position 

                                  ^

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:94:43: warning: left shift count >= width of type [enabled by default]

#define START_STOP_MASK ((STOP_SYMBOL << 20) | (START_SYMBOL << 18) | STOP_SYMBOL) //STOP/START/16bits/STOP

                                       ^

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:98:59: note: in expansion of macro 'START_STOP_MASK'

         if(((*manchester_word) & START_STOP_MASK) == (START_STOP_MASK)){ // testing first position 

                                                       ^

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:94:66: warning: left shift count >= width of type [enabled by default]

#define START_STOP_MASK ((STOP_SYMBOL << 20) | (START_SYMBOL << 18) | STOP_SYMBOL) //STOP/START/16bits/STOP

                                                              ^

C:\Users\User\Downloads\Arduino-master\Arduino-master\LiFiReceiver\LiFiReceiver.ino:98:59: note: in expansion of macro 'START_STOP_MASK'

         if(((*manchester_word) & START_STOP_MASK) == (START_STOP_MASK)){ // testing first position 

                                                       ^

Special characters

Hello Jpiat !

Firstly, thank you a lot for this tutorial and the code.

I've built your system with two Arduino UNO. I've managed to transmit something. However, on the receiver serial monitor, there are only special characters (as shown on the attached file)

Have you ever experienced this problem ?

Thank you a lot

special characters

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.