I'm new to Arduino, electronics, and coding, but I'm required to make an interactive 'lantern' for a university assignment. I want to do something similar to this: 2 4G Transceiver nRF24L01 Module - YouTube but imagine 1 as a lamp and the other as a wearable pin/badge on your shirt. How do I alter it so that...
the circuit for the badge is battery powered
the lights in the LAMP are activated by the touch sensor in the BADGE while...
the lights in the BADGE are activated by a motion/gesture sensor in the LAMP (i.e. when someone waves 'hello' to the lamp, the badge's light activates)
Here's a link to my concept sketch in case of any confusion: sketch
Also, if you have any guidance for how to code this, that would be even better.
It seems to me you are pretty well on your way. Your idea and your pick of components seem realistic to me. Think about how you will power the badge / what battery you will use. A whole ring of neopixels can be power-hungry if you turn up the brightness on them.
I'd say, get yourself the components, hook them up, try your hand at writing the code. Them report back with any issues.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.
A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.
TimMJN:
It seems to me you are pretty well on your way. Your idea and your pick of components seem realistic to me. Think about how you will power the badge / what battery you will use. A whole ring of neopixels can be power-hungry if you turn up the brightness on them.
I'd say, get yourself the components, hook them up, try your hand at writing the code. Them report back with any issues.
Good luck, looks like a fun project!
I'm buying the components tomorrow so hopefully I get more of an understanding of how everything will work together once I have those in hand.
About the neopixel ring, I think I won't need them to be at full brightness (or even use all the LEDs on the ring) to get my concept across...so I hope the power-hungry issue won't be too much of a problem. I actually decided to use a Duinotech RGB LED Circular Board instead since that's what's readily available in my local electronics store. Whether that changes anything, I don't know, but we'll see!
I'll get on to learning coding and report back if any issues arise. Thank you for the reply!
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.
A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.
...R
Just had a look at your tutorial. Once I buy all my components, I'll definitely follow it throughout my process! For the meantime, is it possible to simulate your examples online (like the Tinkercad simulation tool) so I can visualise how it works? Or maybe a video demonstrating similar functions so I can better understand what's happening? I think I get the gist of the elements in your tutorial, but as a visual learner, I learn better through watching other people do it.
Thank you very much for this reply! I was stressing about the many components I need to get working at once, but your comment on getting the wireless part working first gave me an idea as to how this project will flow along.
Robin2:
I have never used a simulation tool. It certainly could not simulate the wireless transmission which is the complex bit.
...R
Oh sorry, I should have clarified that by simulate I meant showing the circuit and how all the electronic components are set up. It doesn't need to be functional But I've watched some RF transceiver tutorials for two-way communication and found a variety of set ups I can try!
Robin2:
Start by getting the first example to work
...R
Finally got to try your examples. The 1st one worked, the 2nd one too I think...'Acknowledge but no data" does comes up in the serial monitor, so SOMETHING is happening which is better than before when it kept going "Data Sent Message 0 Tx failed".
If that is how it works, how would I then alter your code to have an LED on/off function with a push button?
I found this example but both demonstrations did not work at all. I'm hoping that perhaps utilising your code somehow will do the trick.
Thank you again for the help & directing me to your tutorial! And apologies if the LED/push button question is asking for too much...
versacji:
If that is how it works, how would I then alter your code to have an LED on/off function with a push button?
[...]
I'm hoping that perhaps utilising your code somehow will do the trick.
That code should be treated as a resource, not a template to build your code on. You will learn more, and have better code at the end, if you design your own program. It is probably better from the point of view of the purpose of the exercise.
You should just build test programs to exercise each individual hardware element that you use, then put it all together when you have all that working well. When you get to that stage, you may wonder why you were worried about it.
versacji:
Finally got to try your examples. The 1st one worked, the 2nd one too I think...'Acknowledge but no data" does comes up in the serial monitor, so SOMETHING is happening which is better than before when it kept going "Data Sent Message 0 Tx failed".
If my examples don't work perfectly then there is a problem that must be sorted out before you try anything more complex.