Wind the potentiometer on the sound sensor module fully clockwise; this is the highest gain and thus sensitivity setting. Referring to Fig.1, wire it up to the breadboard and Leonardo, but don’t connect the transmitter module. This will allow us to check the operation of the clap sensor.
Connect the Leonardo to a computer and upload the Clap_Light sketch (available from siliconchip.au/Shop/6/418). If you open the serial plotter, you should see something like Scope 2. If the ‘L’ LED on the Leonardo flashes when you are not clapping, turn the sound sensor module pot anti-clockwise until it settles down.
If there is no response to claps, you can turn it clockwise. Find a level such that the LED flashes when you clap but not other times. There is also one LED on the sound sensor module that shows when it is powered, so if it isn’t on, there might be a problem. Other AVR main boards like the Uno, Nano, and Mega should work, although we haven’t tested them.
With that working, connect the transmitter module as per Fig.1. Note that one end of the ANT wire for the transmitter module plugs into an empty row on the breadboard, so the antenna wire doesn’t float around.
Using the Jaycar MS6148 (or similar) wireless outlet requires a pairing step; you can also refer to the instruction manual. Power on the outlet and activate the ON function while its LED is flashing. The default sketch lets you do that using the ‘3’ command on the serial monitor. Then use ‘3’ and ‘4’ to check that the outlet switches on and off as expected.
Finally, test the clap response while watching the serial plotter to confirm proper operation. The remote control for the MS6148 can control four separate outlets; the rfPowerPoint.h file shows the #defines you can use to emulate these different controls. You can also refer to the doThreeClaps() function in our sketch; the ppSendRF() function is designed to work with these outlets.
The ‘Brilliant’ fan and light controllers are typically hardwired by an electrician and have a remote control that looks like the one shown in Photo 2. Photo 3 shows the coding DIP switches inside the battery enclosure.
You can see that this one is set to binary 0b1001 or 9, which is the channel number used in the sendCommand() function called by the doTwoClaps() function. If your remote control has a different coding, change the function to use that number instead of 9.
Other functions of the Brilliant remote control are listed in the rfFan.h file. There don’t appear to be distinct off or on functions for the light, but there is a code that will turn both the fan and light off together.