📜 ⬆️ ⬇️

How we won the hackathon in New York

victory
24 hours later


A couple of months ago, colleagues from my new job offered to join them and take part in a large hackathon in New York. At first I wondered why fly so far, but having studied the topic a little, I realized that the truly large hackathons are not so frequent, and the May TechChrunch Disrupt is one of the most respected and major among similar events. By that time, the guys already had several victories in other hackathons, and I also wanted to prove myself, so without thinking twice, I checked in, bought tickets and waited with impatience on May 12th ...



Hackathon rules


Before participation, I only remotely imagined what a hackathon is. In short, the basic rules are as follows:



There are no particular restrictions on the idea of ​​the project. In the course of the hackathon, I furtively watched what other teams were doing (there were almost 90 of them): someone programmed drones, made 3D models of neighboring streets, wrote software to recognize checks, and much more.


Each team is provided with a table, 6 chairs, one pilot, unlimited stakes, coffee and energy, and also from time to time offer a variety of food.


tables
workplace hacker


Idea


Among the many options we settled on the idea of ​​making a parking club for cyclists. To join a club, you need to buy a lock designed for two bicycles: one section always belongs to the owner, the second is available to any other member of the club. Bicycle is a very popular option for a commute (commuting - moving from home to work and back) where I live now, and parking is great becoming an actual problem, because wherever you go, you always have to carry a lock with you (often quite heavy) to secure your property.


idea
lock for two bikes


From a technical point of view, a hastily made prototype is a construction made of snot and sticks from plastic water pipes, into which the Arduino is built, able to open and close the lock. It is connected to the cloud and is awaiting management commands. The user controls the lock by sending SMS or via the mobile application. This application is also able to find the nearest free parking and build a bicycle route to it.


design


As a lock for the prototype, the choice fell on a linear actuator. Usually they are used for agricultural machinery, industrial automation and smart home.


actuator


Ours had a power reserve of 5 centimeters, and this was just enough to fix the bicycle wheel between the pipes. “Making friends” with Arduino turned out to be easy: the corresponding scheme was easily found on the Internet:


scheme


Rejected features


On the one hand, 24 hours is not such a long time, on the other hand, only a minute is given to the performance, so it is important to focus on the main features and discard minor ones. From the unrealized, we wanted to “teach” our castle to notify the owner of the parked bicycle about the approaching rain, and also to add a message to the mobile application so that you can quickly find out when another club member will release the parking you are interested in.


Problems


There was no person in our team who would be professionally engaged in glands, or at least had a tendency towards this. To make a good design is not a question, to write code for any platform and in any programming language with pleasure, but to solder or at least have a remote idea how to assemble electronic circuits is not about us. Of course, we are faced with a lot of problems with hardware, and the list below is far from complete.


GPRS modem


In the original scheme, it was planned to connect the Arduino to a GPRS modem to exchange data with the cloud. This way we would kill two birds with one stone: we would hide all the chips and wires in the pipes, which would make our design visually much better, and could not use local WiFi, which often fails at such events. However, when we laid out the chips, we almost immediately realized that it might take more than 24 hours to simply connect them to each other and make them work without any guarantees of success. This is an example of a “good” problem, when it is immediately obvious that nothing good will come of it and there is no temptation to waste precious time in vain.


Arduino and WiFi


As a replacement for the GRPS, we would gladly use the Arudino WiFi Shield extension if we could quickly find and buy it, but alas. However, there was another board - WEMOS D1. In short, this is the Arduino with wifi on board. It took me no more than half an hour to make the first successful HTTPS request using it, but the joy did not last long - after several hours of unsuccessful attempts to “teach” WeMOS to operate the lock, it turned out that this board not only differs in the order of inputs and outputs the original Arduino (matching on the Internet was found in a couple of minutes), but due to the WiFi support, the set of interfaces available to the developer was cut off, and either we were doomed from the very beginning, or I was too curved. In other words, nothing happened here either.


Arduino and Arduino


Well: since we have an Arduino that knows how to control the lock, and WEMOS, who knows how to surf the Internet, literally begs the decision to make friends with them. For several unsuccessful attempts, another 30 minutes were spent. In the first seven hours of the hackathon, only a designer could boast of success, who managed to develop and publish a landing page, draw mobile application screens and prepare a description of our project on the Disrapta website. The desire of engineers to do everything beautifully and elegantly gave way to the desire to make "at least somehow, so long as it is finally working."


Arduino and MacBook


As a result, we returned to the simplest and most inelegant option: a MacBook is flashing a cloud service and sending Arduino control commands via USB. It would seem that it could be simpler, but even then they caught the rake: through the Arduino IDE, the teams were sent, but not by the script. Fortunately, the bug came to be found and corrected quickly enough when I guessed to open the Arduino IDE sources on the githaba and find the corresponding code snippet. Hooray! For 8 hours we collected a working prototype!


Fragility


The circuit consisted of 11 wires, and each of them could become a point of failure. Generally speaking, we have enough points of failure, taking into account the use of a third-party cloud, Hakaton WiFi and a mobile application written on the knee in a couple of hours. We tried our best to strengthen the structure, so the next 3 hours were soldered, insulated and glued. We thought that we would manage 30 minutes, but greatly underestimated our “abilities”.


process
process


Soft


Work with the "iron" with grief in half we finished by one o'clock. Although there was still a lot of work ahead of us, we felt a tremendous relief. Both engineers of our team professionally develop software for more than 10 years, so over the next 3 hours we developed and secured the necessary web services to the cloud and developed a mobile application, one can say, without regaining consciousness. After several successful end-to-end tests, I still went to bed at 4 in the morning, and a colleague decided to engage in grinding the application "to the end".


Demonstration


I woke up a little before 9 in the morning. The morning turned out to be very chaotic: as always, roughness appeared in the application, plus something urgently needed to be filled up somewhere, plus they gave quite a bit of time to collect things and empty the table. Behind all this routine time flew by very quickly, and it was time for demonstrations.


Hall
30 minutes before the start


Although we got the 33rd number, it didn't give extra time: the teams lined up in blocks of 20 pieces and moved briskly towards the stage. On the stage itself, there were 5 teams at once: each had a minute to speak, and when one was finished, the other immediately began. For this minute you need to introduce yourself, tell and show your product. During the speech, you can use the camera, which projects the image from your phone or tablet on the big screen. From a technical point of view, the organization of the show was above all praise, and I can not remember a single example when any team had a problem with the demonstration through the fault of the organizers.


Although the teams followed each other quite cheerfully, the way to the stage seemed like an eternity - on the way I tried my best to protect our prototype so that God forbid no one accidentally touched it and broke it - we would not have time to fix it. A minute before our performance, I put the structure on the stage: the lock is closer to the edge, the laptop is about two meters away, at the feet of the presenter, so that it is not so noticeable. In the demonstration itself, I did not directly participate, so I just had to wait behind the scenes. Generally speaking, the actuator is a very noisy thing, and I thought I would hear if it was working or not. It was the most important moment in these 24 hours: if everything works out - we have very good chances to win, if not - you can go home immediately. Dreamers have no chance of winning such contests. I never heard anything: too much noise and sounds were around the stage. Not expecting anything good, I returned to the scene exactly a minute later to help remove the structure, where I found the last moments of the opening lock - the main evidence of our success!



We did not have time to leave the stage, when a journalist approached us and asked for an interview - a good sign, it means that we are at least on the short list!


Victory


The next hour we spent in the auditorium, watched the work of other teams, corresponded with friends. Finally, the time has come to sum up the results of the competition and award ceremony, where we learned that our project won the nomination “For the development of local and regional communities”.


It was a terrific experience, and I hope someday it will be possible to repeat it!


Take aways



Repository: https://github.com/yury-dymov/disrupt


Article about the project: https://techcrunch.com/2017/05/14/bikeparking-club-brings-connects-a-social-network-to-bike-locks-in-a-city/


Ps As always, I will be glad to receive a personal message with errors and typos.


')

Source: https://habr.com/ru/post/329500/


All Articles