I am using a Arduino Due. I am doing a project on Visible Light Communication. I need to convert a binary data into a PWM Signal. Can anyone suggest me a method of generating that PWM Signal based on the binary data given?
Thank You.
I am using a Arduino Due. I am doing a project on Visible Light Communication. I need to convert a binary data into a PWM Signal. Can anyone suggest me a method of generating that PWM Signal based on the binary data given? Thank You. |
||||
|
Count the amount of time a signal is high over a certain period, and use the ratio of on time to period as the duty cycle for the PWM signal. |
|||
|
So, if you simplu has to convert the binary data to PWM signal there are few things you need to cover:
Here's the linear Example:
Doing this, y will receive a value from 0 to 255. You just need to first do a simple serial program that prints you through arduino serial window the binary data and see if the data increases or decreases conform your light project.
Tell me more about the source of data, how this data is and how is the behavior of the data so i can help you a lot more. Thanks |
|||
|
Rather than completely build everything from scratch, perhaps you can use some already tested and debugged Arduino library designed for free-space optical communication, such as
Practically all of these systems convert expand arbitrary binary data to structured "frames" or "packets" of information including some sort of checksum. Each packet is repeated several times; hopefully the receiver catches at least one of them. Each bit of the packet is expanded to either the "pattern representing a 0 bit" (typically turning the LED off for the full bit time) or the "pattern representing a 1 bit" (typically blinking the LED at 38 KHz for the full bit time, typically using a PWM). To make the hardware and the software simpler and cheaper, most of these systems transmit only a few dozen bits per second. A few free-space optical communication systems are designed to run much faster, such as RONJA. |
|||
|