My brother is a keen and accomplished piano player (I'm keen too but rubbish at playing). He uses Forscore on his Apple iPad to keep all his music score sheets in one place. The app is very good but as with all sheet music, and especially music displayed on a tablet, turning to the next page can interrupt ones playing.
This project was designed to create a foot switch page turner linked to the iPad but without wires. Such page turners can be purchased commercially but what is the fun in that?
So the requirements were:
1) A robust foot switch
2) No power cables (implying battery powered)
3) No interface cables to the iPad (implying wireless signalling)
4) As compact as possible
5) Low cost!
Although designed for music score page turning on an iPad, there is no reason why this cannot be used for turning pages for book apps etc. on the tablet.
The switch could probably be adapted for people with disabilities too.
Hardware DesignI selected the Seeed Xiao nrRF-52840 for this project as this module is very compact, supports BLE (Bluetooth low energy), has low sleep currents and supports LIPO battery charging. This then minimised the rest of the circuit to the actual pedal switch, the LIPO battery and an on/off switch to isolate the battery.
A metal foot switch was chosen, available from Ebay, which was low cost and robust however being metal, I was concerned that his could potentially screen the bluetooth transmissions so I designed a 3D printed case to attach to the underside and back of the foot switch. The case is fixed to the underside of the foot switch using the screws holding the rubber feet. The case therefore 'floats' at the back of the foot switch but is firmly attached. The gap between the two allows for the slight rotation of the rear of the pedal when pressed.
The on/off switch fits into one side of the case. The Xiao nRF-52840's USB connection is also made available through the side of the case. This can be used to power the unit and recharge the battery.
Note: the on/off switch must be in the 'on' position to charge the battery.
Should the battery be completely omitted, then the unit can just be powered via 5v on the USB connector however this will of course require a permanent powered connection when in use.
The Xiao's on board LEDs are in a position where they are close to the USB connector and wouldn't be seen with the lid on so the lid has a 'collar' built into it to take a short length of light pipe down to the LEDs. This is a little complicated so an alternative would be to not fit the light pipe or make a hole through the side of the case to make the LEDs visible from the side.
The clip on lid also has 3 stand offs. 2 of these ensure the battery is held firmly in position via some thin rubber padding and the other stand off ensures the Xiao is held in place as there are no fixing holes on the Xiao PCB itself.
The internals of the case have been designed to support the Xiao off the floor of the case and supporting the back of the Xiao so that it doesn't move when a USB cable is plugged in yet is easily removable if needed. There is also a divider for the battery compartment to keep the battery in place in terms of side to side movement. The pillars on the lid keep the battery from moving up and down.
The lid and case are designed to clip together eliminating the need for additional screw fixings.
For anyone designing such cases in Fusion 360 I can recommend this YouTube video showing how to design a case with snap on lid.
It took me a while to get to grips with some aspects of the Xiao, particularly the coding of the 'key codes' for forwards/backwards to be sent over the Bluetooth.
Current drain was kept as low as possible (~4.6uA in deep sleep) in order to extend the battery life. If the pedal is not used for long periods of time, the switch should be put in the off position to stop any current drain however the unit will automatically go into sleep mode if battery powered (i.e. no USB power) and if the switch has not been used for 5 minutes (time can be configured in the software). The unit can be re-awakened by pressing the foot switch.
The OneButton library was used to handle the switch operation and eliminate switch debounce. This library will effectively interpret single quick press, long press and double presses.
The code uses a single press as 'page forwards' and a long press as 'page backwards' - a double press isn't used but could be added if needed.
The pedal pin on the Xiao is configured as an 'input with pull up' and as a wakeup from deep sleep (low level wakes the device).
If SERIAL_DEBUGGING is enabled, the battery voltage is displayed on the serial port about every 10 seconds although this can of course be altered in the code.
Overall battery life has not been tested but should last some considerable time even if the unit is not switched off after use given the low sleep current.
Make sure the required libraries are installed in the IDE before compiling.
I think I had to include Stefan Staub's TickTwo library in the project and make some minor changes in order for it to compile - I probably altered the include file as it didn't recognise the Xiao nRF52840 at the time of designing this project.
You should refer to this Seeed web page on setting up the IDE for the Xiao nRF52840.
How To UseOn first set up, power up the foot pedal.
On the iPAD (or equivalent bluetooth enabled device) turn on the bluetooth and search for and select the foot pedal (XIAO nRF52840V6). The pedal should now be connected to the iPAD.
Open the ForScore app and select the piece of music. The page turning in the app should be enabled by default along with the default codes for forwards/backwards.
Assuming there is more than one sheet, do a short press of the pedal. The app should bring up the next page. Pressing and holding the pedal down a bit longer and then releasing should make the app show the previous page.
If not used for 5 minutes, the pedal will go into battery saving sleep mode. To wake it, just press the pedal. It should auto-connect to the iPAD again if the iPAD is on and the bluetooth still enabled.
When finished using, set the switch to the 'OFF' position to save the battery.
After the initial set up, the pedal should auto-connect on each power up.
To recharge the battery, plug a USB charger into the USB-C socket on the side of the pedal and ensure the switch is in the 'ON' position or the battery will not charge.
If desired, the pedal can be used as normal with the USB charger plugged in. In this case, with the switch in the ON position, the battery will also be charging, in the OFF position, the unit is still operational but the battery will not be charged. Note: With a USB charger supply, the pedal will not go into sleep mode.
Comments
Please log in or sign up to comment.