I like exploring human-human interactions through technology. You may remember my earlier Bluetooth-pairing project to encourage strangers to interact in friendly ways. This project aims to help mothers keep their children by their side.
My mother told me a story about a time I played a prank on her. I was 3 years old. She took me out shopping. While she was browsing some clothes, I disappeared. She was devastated. She looked for me everywhere and had the store broadcast my name. It might have been a couple of hours of searching in vain until she noticed a pair of tiny feet underneath a giant coat on a mannequin - I was hiding inside the coat the whole time, sweating and giggling. It was funny for me but a nightmare for my mom.
There are always stories about kids go missing due to various reasons. Parents shouldn't be overprotective but in public areas they need to keep kids in sight. Tracking devices exist. But can we create some interactive behaviors that can be more effective?
I had this idea for a long time (over a year? Two years?), finally got some time to implement it. It's a result of various inspirations coming together.
1. Demographic preferencesI was wearing a dress with removable light patches when I went out with some friends and their daughter. The lights turn on when you shake them. The daughter was fascinated. She liked to take them off from my dress, put them on her clothes, and constantly shake the patches to keep the lights on.
So I thought for this project a brooch for the kid, that only lights up when they are close to their mother.
For the mother, she'll like something decorative but subtle. She'll want to know if the pairing is working and get notified before the child goes too far. I thought ~2 meter would be a good distance in public space. Therefore, her brooch should light up to indicate that the device is on, both brooches light up when pairing is successful. The best way to notify her would be to turn off the lights (which she won't immediately see) while starting a vibration mode (so she can immediately feel).
Meanwhile, when the kid sees their lights get turned off, they'll be upset and will try to get back to mommy.
2. DesignI had leftover fabrics from my Flowers dress. Thinking along the same line of making custom patterns according to the painting on the fabric, I carved out two flowers and sewed them into pockets.
It's these two particular flowers because these are the fabrics left for prototyping. If I were to productize them, I would use these two specific graphics.
The schematics of the circuits and the code are uploaded at the bottom of the tutorial. Before we construct them, we need to always test the code and we can use simpler circuits. I used conductive tapes to connect the components on a piece of fabric. The Central Beetle board has three output pins used, D2, D3 and D4. When it's powered on, D2 turns on. When Peripheral gets paired close by, D2 turns off, D3 turns on. When Peripheral moves >2m away, D3 turns off, D4 turns on. The Peripheral board uses one pin, D5. When it's paired with Central, D5 turns on. When it is >2m separated from Central, D5 turns off.
At first I used only one 3.7 V battery per board. But Bluno Beetle uses 5V so I used the USB for testing and later added one more battery to each.
It would be nice to use the conductive tapes for the actual brooches since that'll make the circuits flexible and thin, but the connections are not very stable. I had to change to soldering. Decide where to place the components relative to the graphics. Then solder everything.
Sew the flowers into two pockets. Put the circuits inside. Also add safety pins to the pockets so they become wearable.
They work but seem to be quite power hungry. For the next generation, I should make custom PCBs and optimize the power consumption. I'm also thinking maybe just make PCB brooches directly into flower shapes. Let me know if you'd like to collaborate on this.
4. CodeDistance between Bluetooth devices is not directly measured. We use the intensity of the signal, RSSI (Received Signal Strength Indication), to infer the distance. There is an existing program by tiojoca on DFRobot Forum about using RSSI to determine if two Blunos are connected:
https://www.dfrobot.com/forum/viewtopic.php?f=2&t=1368#p7188
I modified on their code to achieve the effects described above. Thanks to Pearl from DFRobot for helping debug and editing the code.
You need to use AT command to set up the two Bluno Beetle boards. You can start reading about Beetle boards here, which will direct you to how to use AT commands to defined Central and Peripheral boards and pairing them via "Wireless Programming via BLE". AT commands are input through Serial Monitor. You may also need to follow their instructions to update the firmware. Note do not use v1.9 firmware. Use v1.8 for this project.
For pairing, we also want to let Peripheral only pair with the specified Central board, in case there are more than one Bluetooth devices nearby, which will always be the case.
AT+MAC=? //query Central MAC address
AT+CMODE=UNIQUE //tell Peripheral to pair with unique Central
AT+BIND=0x0017ea9397e1 //make Peripheral pair with Central
//MAC address in this case
//is 0x0017ea9397e1
In the code you will find that we use RSSI= - 70 when two boards are separated by ~2m apart. This is an empirical value. You can use AT command on either Central or Peripheral to find out what the case is for your boards and fine tune it.
AT+RSSI = ?
Everything works as expected but it's not optimized: the responses of the boards are a little slow and batteries use up quickly. Some improvements in both the code and hardware need to be made. Perhaps one day I'll make these into products and sell on my little shop. For now, enjoy the open-source DIY :)
Comments