jpiat / arduino

113 stars 70 forks source link

Special characters #5

Open DimMrgrtpls opened 8 years ago

DimMrgrtpls commented 8 years ago

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

jpiat commented 8 years ago

What data re you sending ? Are you running the test code without modification ?

2016-03-01 16:12 GMT+01:00 DimMrgrtpls notifications@github.com:

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

[image: special characters] https://cloud.githubusercontent.com/assets/17572089/13431125/c91378ce-dfa6-11e5-87b0-1d9d9ce91570.png

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5.

DimMrgrtpls commented 8 years ago

I was trying fisrtly to send the "Hello world" by running the code without any modification.

I run one Arduino UNO on one computer, and another Arduino UNO on another computer.

jpiat commented 8 years ago

This is a bit weird since the receiver should print data to the terminal only if a correct frame is received. What kind of led do you use (color and pin its wired to) ?

2016-03-01 16:55 GMT+01:00 DimMrgrtpls notifications@github.com:

I was trying fisrtly to send the "Hello world" by running the code without any modification.

I run one Arduino UNO on one computer, and another Arduino UNO on another computer.

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-190781440.

DimMrgrtpls commented 8 years ago

I use red brillant LEDs for both emitter and receiver. On emitter, the LED is connected to pin13, and on receiver on Analog A3.

jpiat commented 8 years ago

On the receiver side, can you uncomment the line :

//#define DEBUG

to get debug output in the terminal ?

2016-03-01 17:57 GMT+01:00 DimMrgrtpls notifications@github.com:

I use red brillant LEDs for both emitter and receiver. On emitter, the LED is connected to pin13, and on receiver on Analog A3.

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-190811867.

DimMrgrtpls commented 8 years ago

In fact previously I was wrong : on the emitter side, the LED is connected to pin2 (Digital).

I've run the debugger on the receiver, and the results is attached to the message (and I guess it doesn't help)

capture d ecran 2016-03-01 a 14 17 10
jpiat commented 8 years ago

What is the distance beetween the two leds ? If too close the emitter can saturate the receiver. Le 1 mars 2016 18:26, "DimMrgrtpls" notifications@github.com a écrit :

In fact previously I was wrong : on the emitter side, the LED is connected to pin2 (Digital).

I've run the debugger on the receiver, and the results is attached to the message (and I guess it doesn't help)

[image: capture d ecran 2016-03-01 a 14 17 10] https://cloud.githubusercontent.com/assets/17572089/13435324/827107a8-dfb8-11e5-829a-be5aa510a88a.png

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-190820528.

DimMrgrtpls commented 8 years ago

We tried several distances : from 0cm to 25cm. And it gives each time the same special characters (but it seems to receive something even 25cm away)

DimMrgrtpls commented 8 years ago

Interesting phenomenon : we've run only the receiver (without any emitter) and in fact it prints the same special characters. So it's probably parasite signals. When you did your experiments, were you in the complete dark ?

We've also tried in a darker place and we managed to have one or two transmitted messages !

jpiat commented 8 years ago

Do you have the 1Mohm resistor in parallel with the receiver led ? Le 2 mars 2016 18:33, "DimMrgrtpls" notifications@github.com a écrit :

Interesting phenomenon : we've run only the receiver (without any emitter) and in fact it prints the same special characters. So it's probably parasite signals. When you did your experiments, were you in the complete dark ?

We've also tried in a darker place and we managed to have one or two transmitted messages !

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-191341091.

DimMrgrtpls commented 8 years ago

Yes we have it !

We did the experiment in a dark place, with a lower resistance for the emitter. And by changing the position of the emitter spot toward the receiver, we managed to find a position where the transmission goes well (there is still a little noise, but like 1 line over 10).

We have also tried with 3 receiver LEDs in parallel. For the moment, we can't really figure out if it works better or not.

The results are encouraging !

jpiat commented 8 years ago

I have been running this in plain daylight or in my office lit with halogen and got no problem. I suspect that the LED characteristic can affect the receiver. One other thing you can try to play with is the edge threshold in the receiver. Le 2 mars 2016 19:07, "DimMrgrtpls" notifications@github.com a écrit :

Yes we have it !

We did the experiment in a dark place, with a lower resistance for the emitter. And by changing the position of the emitter spot toward the receiver, we managed to find a position where the transmission goes well (there is still a little noise, but like 1 line over 10).

We have also tried with 3 receiver LEDs in parallel. For the moment, we can't really figure out if it works better or not.

The results are encouraging !

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-191353822.

jpiat commented 8 years ago

Try to modify EDGE_THRESHOLD to 8 or 15. This will affect distance but can help reject the noise. Le 2 mars 2016 19:10, "Jonathan Piat" piat.jonathan@gmail.com a écrit :

I have been running this in plain daylight or in my office lit with halogen and got no problem. I suspect that the LED characteristic can affect the receiver. One other thing you can try to play with is the edge threshold in the receiver. Le 2 mars 2016 19:07, "DimMrgrtpls" notifications@github.com a écrit :

Yes we have it !

We did the experiment in a dark place, with a lower resistance for the emitter. And by changing the position of the emitter spot toward the receiver, we managed to find a position where the transmission goes well (there is still a little noise, but like 1 line over 10).

We have also tried with 3 receiver LEDs in parallel. For the moment, we can't really figure out if it works better or not.

The results are encouraging !

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-191353822.

jpiat commented 8 years ago

Try to modify EDGE_THRESHOLD to 8 or 15. This will affect distance but can help reject the noise. Le 2 mars 2016 19:07, "DimMrgrtpls" notifications@github.com a écrit :

Yes we have it !

We did the experiment in a dark place, with a lower resistance for the emitter. And by changing the position of the emitter spot toward the receiver, we managed to find a position where the transmission goes well (there is still a little noise, but like 1 line over 10).

We have also tried with 3 receiver LEDs in parallel. For the moment, we can't really figure out if it works better or not.

The results are encouraging !

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-191353822.

albilamb commented 8 years ago

Hello jpiat,

I am working on the same project as DimMrgtpls.

We will probably change the LEDs we use when we find better ones. What are the characteristics of the ones you used ?

Concerning the noise, changing the EDGE_THRESHOLD value to 8 did not change so much from the original value of 4. The receiver displayed many messages even when the emitter was not plugged in.

When changing it to 15, the receiver seems not to be so affected by noise : if we turn the emitter off, it receive less information (less messages display). Until what value of EDGE_THRESHOLD should we go ?

Would you recommend using optical filters ?

Thank you a lot!

jpiat commented 8 years ago

You should first measure the max voltage generated by the receiving LED. If the voltage is greater than 1.1v you should configure the code to use the 5v reference for the ADC and not the 1.1v (comment #define INT_REF), and then play with the threshold again.

It would be great to implement an adaptative threshold, but it requires more work. Optical fiber would be great but then why using visible light ?

2016-03-04 14:59 GMT+01:00 albilamb notifications@github.com:

Hello jpiat,

I am working on the same project as DimMrgtpls.

We will probably change the LEDs we use when we find better ones. What are the characteristics of the ones you used ?

Concerning the noise, changing the EDGE_THRESHOLD value to 8 did not change so much from the original value of 4. The receiver displayed many messages even when the emitter was not plugged in.

When changing it to 15, the receiver seems not to be so affected by noise : if we turn the emitter off, it receive less information (less messages display). Until what value of EDGE_THRESHOLD should we go ?

Would you recommend using optical filters ?

Thank you a lot!

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-192293456.

jpiat commented 8 years ago

You need to keep the threshold lower than 128.

2016-03-04 15:03 GMT+01:00 Jonathan Piat piat.jonathan@gmail.com:

You should first measure the max voltage generated by the receiving LED. If the voltage is greater than 1.1v you should configure the code to use the 5v reference for the ADC and not the 1.1v (comment #define INT_REF), and then play with the threshold again.

It would be great to implement an adaptative threshold, but it requires more work. Optical fiber would be great but then why using visible light ?

2016-03-04 14:59 GMT+01:00 albilamb notifications@github.com:

Hello jpiat,

I am working on the same project as DimMrgtpls.

We will probably change the LEDs we use when we find better ones. What are the characteristics of the ones you used ?

Concerning the noise, changing the EDGE_THRESHOLD value to 8 did not change so much from the original value of 4. The receiver displayed many messages even when the emitter was not plugged in.

When changing it to 15, the receiver seems not to be so affected by noise : if we turn the emitter off, it receive less information (less messages display). Until what value of EDGE_THRESHOLD should we go ?

Would you recommend using optical filters ?

Thank you a lot!

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-192293456.

albilamb commented 8 years ago

The voltage received by the LED did not exceed 0.3 V so we did not have to use the 5V reference. What voltage did yours receive ? Just to understand if our LED is responsible for the problems we face.

Changing the Threshold (to 100) value made it possible to have a stable communication between the two devices for a distance communication of about 5 cm.

I talked about optical filters in order for our receiver only to "read" the correct wavelength.

We will keep you informed of our advancement.

Thank you for your help.

jpiat commented 8 years ago

0.3v seems very low ... can you capture the signal at the receiving led side with a scope ? Le 4 mars 2016 17:50, "albilamb" notifications@github.com a écrit :

The voltage received by the LED did not exceed 0.3 V so we did not have to use the 5V reference. What voltage did yours receive ? Just to understand if our LED is responsible for the problems we face.

Changing the Threshold (to 100) value made it possible to have a stable communication between the two devices for a distance communication of about 5 cm.

I talked about optical filters in order for our receiver only to "read" the correct wavelength.

We will keep you informed of our advancement.

Thank you for your help.

— Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-192354218.

albilamb commented 8 years ago

img_20160317_154153

Here is the signal received by the LED. Just a question: why do we have negative values for the tension across the receiving LED ? What voltage did you have ?

Thank you!

jpiat commented 8 years ago

Your scope must be configured in AC. Configure it in DC and run the capture again. Le 30 mars 2016 21:23, "albilamb" notifications@github.com a écrit :

[image: img_20160317_154153] https://cloud.githubusercontent.com/assets/17644476/14154519/29592fe6-f693-11e5-89bd-e400ee7699da.jpg

Here is the signal received by the LED. Just a question: why do we have negative values for the tension across the receiving LED ? What voltage did you have ?

Thank you!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-203594266

DimMrgrtpls commented 8 years ago

Our scope is configured in DC.

We are amplifying the signal by 2 with a basic amplifier non inverter and have 0,7 to 1,1V at the output

img_2986

However, measuring the voltage over the receiving LED, it doesn't reach 1mV. Even with a high threshold (127) and in a quite dark environment, there is still plenty of noise.

So we tried configuring the code to use the 5v reference for the ADC. And it works way much better. We are able to transmit the message !

jpiat commented 8 years ago

Nice ! This is something that really depends on the LED type (color). I'am not sure of how we could simplify the steps to get the user running with no need of a scope.

2016-04-01 15:35 GMT+02:00 DimMrgrtpls notifications@github.com:

Our scope is configured in DC.

We are amplifying the signal by 2 with a basic amplifier non inverter and have 0,7 to 1,1V at the output

[image: img_2986] https://cloud.githubusercontent.com/assets/17572089/14208285/03ad0408-f7f5-11e5-8f2c-bc04a215e9a7.jpg

However, measuring the voltage over the receiving LED, it doesn't reach 1mV. Even with a high threshold (127) and in a quite dark environment, there is still plenty of noise.

So we tried configuring the code to use the 5v reference for the ADC. And it works way much better. We are able to transmit the message !

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-204398073

albilamb commented 8 years ago

Hello jpiat,

Now we would like to work with an RGB LED in order to improve the throughput of our sertup. What did you use as a receiver to be able to "receive" from the different wavelengths ? We tried some phototransistors but unfortunately they were sensitive only to some colors.

Thank you!

jpiat commented 8 years ago

I used a red LED to receive red, a blue LED to receive blue and a green LED to receive green .... Le 11 avr. 2016 15:46, "albilamb" notifications@github.com a écrit :

Hello jpiat,

Now we would like to work with an RGB LED in order to improve the throughput of our sertup. What did you use as a receiver to be able to "receive" from the different wavelengths ? We tried some phototransistors but unfortunately they were sensitive only to some colors.

Thank you!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-208351750

albilamb commented 8 years ago

I was not very clear in my previous post. In your RGB setup, did you use the 5050 RGB LED for reception or three different LEDs ? The RGB LED works well on the emitting side but we are having some trouble making it work on the receiving side..

Moreover, do you have any photodetector reference that you would you recommend for an RGB reception ?

Thanks!

DimMrgrtpls commented 8 years ago

Hey !

I'm giving you some news. We now work with an RGB LED and a phototransistor (used as a switch and plugged between +5V and ANALOG INPUT PIN. So not the same setup as with a red LED). We have tested our phototransistor with an oscilloscope to know its sensitivity. And it's working perfectly ! I have seen that some people try to work with other receiver components than simple LEDs.

We have easily implemented a sending start in the code. We have also tried to transmit data entered in the serial monitor (by uncommenting #TRANSMIT_SERIAL on the emitter side). It works well too.

Also, on the receiver serial monitor, when the sent message is "Hello World", there is anumber appearing next to the message that allow us to know if the transmitting is good or not. However it does not appear with other messages. Where is this coded ?

Thank you !!

imayyami commented 7 years ago

What can i see hardware you make ? do you wear arduino uno ?

jpiat commented 7 years ago

For the sending using serial input, the buffer is transmitted only when there is enough data or when the newline character is received on the serial input. To achieve this with the arduino IDE serial console, you need to select the 'Newline' option is the list that is at the left of the baudrate setting of the terminal.

2016-05-12 16:56 GMT+02:00 DimMrgrtpls notifications@github.com:

Hey !

I'm giving you some news. We now work with an RGB LED and a phototransistor (used as a switch and plugged between +5V and ANALOG INPUT PIN. So not the same setup as with a red LED). We have tested our phototransistor with an oscilloscope to know its sensitivity. And it's working perfectly ! I have seen that some people try to work with other receiver components than simple LEDs.

We have easily implemented a sending start in the code. We have also tried to transmit data entered in the serial monitor (by uncommenting

TRANSMIT_SERIAL on the emitter side). However nothing happens for the

moment. Is the code sending continuously the entered string as it is sending "Hello World" continuously ?

Also, on the receiver monitor, when the sent message is "Hello World", there is anumber appearing next to the message that allow us to know if the transmitting is good or not. However it does not appear with other messages. Where is this coded ?

Thank you !!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/jpiat/arduino/issues/5#issuecomment-218783281

imayyami commented 7 years ago

How to circuit in arduino uno?