Combining Arduino Bit with Wireless Bits

Hi,

I have a working Arduino project where I a rain sensor connect to the LittleBits ProtoBit which in turn is connected to the Arduino Bit at a0 and i have a littleBits Button Bit connected to a1. When I read the analog signal in my Arduino code, i am getting 255 for the rain sensor (it is dry) and 0 for the Button. When I wet the rain sensor analog value goes to ~250 and when I press the button the analog value goes to 255. I am then setting the analog and digital output value and sending this out on d5 and d9 respectively with output sensors attached so i can see them turn on or off. All of this is working fine.

Then I attempted to introduce a wireless transmitter and receiver into the picture so I could separate the components and have the rain sensor outside and the button acting as a door bell for example. I have a wireless transmitter after the protobit for the rain sensor and i have a wireless transmitter after the button. I then have the wireless receiver and the arduino bit connected to it. When i run the same code, i get different analog values than if all is connected directly. If I press the button i get a value of ~160 and the rain sensor similarly. It can seem to fluctuate. Its like when i use the wireless bits that the analogue value is different than when i dont use.

if anyone has any advice i would appreciate it.

Thanks

Ger.

Hi, @ger_mcmahon :). It might help to replace the rain sensor with a dimmer while you troubleshoot. Also, seeing a display on the circuit sometimes makes troubleshooting go faster. Do you have a number Bit or a bargraph you can use?

If you’re still stuck, some pictures or a short video demonstration will help us help you. Also, a wiring diagram for your rain sensor…

Looking forward to hearing more. :umbrella:

Hi @JackANDJude thanks for the reply. I tried an i5 sliding dimmer bit as the input control.

When slider dimmer bit is directly connected to the ardunio bit I get the following values.

  • When the slider is to the left (off) then i see an analog input value of Zero (expected)
  • When the slider is to the rigth(on) then i see an analog input value of 1023 (expected)
  • If I slide the dimmer from left to right, I can see the analog input value increasing in value from 0 nto 1023 (expected)

When slider dimmer bit is connected to a wireless transmitter bit and then i have a wireless receiver bit connected to the ardunio bit I get the following values.

  • When the slider is to the left (off) then i see an analog input value of Zero (expected)
  • When the slider is to the rigth(on) then i see an analog input value of ~878(not expected)
  • If I slide the dimmer from left to right, I can see the analog input value increasing in value from 0 to ~878 (expected)
    Note: It is not always 878 and the value can fluctuate by a small margin
    It seems that the analog value coming into the arduino bit is different if the input littlebits bit is directly connected versus using wireless transmitter and receiver.

Please see the attached photos of the setup.

1 Like

Thanks for the details and photos @ger_mcmahon. I’m testing on my end with the Number Bit instead of the Arduino. I think fresh batteries might give you different results.

Thanks @JackANDJude. I will try with USB power to see if i get different results. Were your results consistent using wireless and not.

With 2 well used batteries and p1 powers, at first I got 99, and after a couple seconds the number started dropping until I stopped it around the 80s. I traded the two batteries, thinking maybe only one was low power, and that gave me a steady 99.

Later I tried swapping out usb for both sides ( one side had usb or the other had battery) and I got a reliable 99. If I gave it some thought, I’m sure I could figure out which battery is lower. :wink: