Pages

Sunday 7 January 2024

Serial Data Transmission with RF - Overview

What follows is some background information to sending data via RF. I will fully expand on this in coming weeks.  This is working across the workbench but I have yet to explore the range that can be achieved.

I stumbled across Roman Black's article on using cheap RF modules for transmitting data. While the world has come a long way in the 10 years since Roman wrote about his findings those modules, and more modern ones at similar modest cost, are widely available. 

The concept had my hooked immediately.

  • It uses RF
  • It was really well written and comprehensive
  • Seemed like an ideal project that will enable other projects.
  • I get a thrill out of using STM8 eForth. You should try it too.

My broad goal was a burst transmission of one to three bytes of data with long off periods. This required some maths to understand the tradeoff between battery life, data speed and preamble length. At present I am using a "pedestrian" data rate, (uS shown is measured):

  • Start pulse is 3 units low, 2 units high. (560uS)
  • Zero is one unit low, one unit high,and (298uS)
  • One is two units low, one unit high       (410uS)

Each byte takes about 4ms to send and for testing I spaced them 500ms apart. In practice I expect I will send a packet of 1-3 bytes, repeated several times before going into a long sleep.

With some modules on the workbench and my digital scope set up it was no time before I had a transmitter sending  $AA or $55 for testing purposes.

Then the heartache started. One of my two receiver's didn't work. That was traced down to a through hole via not being connected. 

But with all the hardware working it was time to finesse the software. While it took me ages to work this out it was all down to hardware and software timing. And some weird seemingly random timing errors in the transmitter which took a really long time to track down. 

I will try to explain in coming articles, perhaps once per week, how I moved from concept to finished RF link, or indeed if I couldn't get it to work. This will definitely not be some superficial clap trap telling you to wire this pin to this, load this library and your done series of posts. I'll be sharing what I learned and hopefully inspire you to improve my code and hardware choices.

Plenty to talk about next time.

Conclusion

I wish more projects were written up to the standard of Roman Black's article. I gave up looking at other articles on these modules because it was clear they were factually wrong. From the solid foundation Roman's article gave me I expect I can send bursts of data with long battery life for the transmitter.

This now enables me to pursue some projects I had never progressed beyond being a possibility. Monitoring my workshop door will be the first real application. I can't see it from anywhere in the house meaning I have to walk up there to confirm I have locked it.

The github for this project will be open soon.

No comments:

Post a Comment