# How do I properly transmit PWM data over Xbee 802.15.4 S1

**URL:** <https://forums.digi.com/t/how-do-i-properly-transmit-pwm-data-over-xbee-802-15-4-s1/18354>\
**Category:** XBee - 802.15.4\
**Tags:** pwm, line-passing, series1, xbee\
**Created:** [May 15, 2017, 2:51pm UTC](https://forums.digi.com/t/how-do-i-properly-transmit-pwm-data-over-xbee-802-15-4-s1/18354 "2017-05-15T14:51:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlbertIsland](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@AlbertIsland](https://forums.digi.com/u/AlbertIsland)\
**Post date:** [May 15, 2017, 2:51pm UTC](https://forums.digi.com/t/how-do-i-properly-transmit-pwm-data-over-xbee-802-15-4-s1/18354/1 "2017-05-15T14:51:35Z")

</div>

I’m having trouble properly driving a lilypad vibe board using PWM over Xbees. The signal is successfully received by the Base Xbee, however, it produces an erratic drive pattern on the Vibe Board.

In this project I am attempting to detect a user’s heartbeat and transmit the heartbeat to another user where each beat is felt as a pulse from a vibe motor. The pulse from the vibe motor should be a consistent vibration 300ms in length each time a heartbeat is detected. Instead it’s choppy and not in time with the user’s heartbeat.

I have tested the signal by removing PWM from the code (replaced with DigitalWrite), driving an LED over digital line passing and it is working correctly. I believe it is a sample rate issue.

Device #1 detects a user’s heartbeat, converts it to PWM and transmits it over Xbee (connected to Lilypad Xbee).  
Device #2 receives the signal from device #1 and drives a vibe motor connected directly to Lilypad Xbee pin.

2 Xbee 802.15.4 S1 in line passing mode with the Remote DIO1 set to ADC and Base PWM1 set to PWM Out. Notable Xbee configuration points are:

Remote  
D1= 2  
IC = 2  
IT = 1  
IR = 5

Base  
P1 = 2  
IU = 1

Help would be greatly appreciated.

-John

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [May 15, 2017, 3:54pm UTC](https://forums.digi.com/t/how-do-i-properly-transmit-pwm-data-over-xbee-802-15-4-s1/18354/2 "2017-05-15T15:54:22Z")

</div>

Don’t use both a Sample rate and change detect. Just use the sample rate (IR).
