Exercise bike # Self-isolation or how to calm a child in quarantine


The whole world is heroically fighting the “... coronavirus infection” ( Putin V.V.) Most countries close their borders, quarantine their citizens, and impose a curfew. So Russia was not spared by this muck.

In the current situation with the SARS-CoV-2 pandemic (COVID-19), all of us must now be in quarantine of self-isolation.

Therefore, the question of how to find active entertainment for children locked in four walls is more acute than ever. We must also try to ensure that these four walls remain, if possible, intact.

Justification


Sitting, calmly and drawing or assembling constructors all day is impossible, and active games are also necessary. All children love to ride greats, scooters, run and jump. To direct the "excessive" energy of children into a useful direction, the idea came to put a children's bike on the machine, but which child will sit and just pedal, looking at the wall? No! So the idea was born of creating a machine and combining it with a computer game.

First, the child can be carried away by joint manufacture, and as you do, then there is no limit to joy. Slot machine at your home!

Therefore, we make a bicycle machine with our own hands and from what is found in the bins on the balcony (Well, or take out a shelf or two from the cabinet, for example).

Mechanical part


In the first iteration, the bike was put on a makeshift machine assembled from chipboard. They unscrewed the additional wheels, measured the height from mounting the wheels to the floor + 20-30 mm ... We mark, saw, drill, glue, twist. Everything led on the machine:





Children pedal, parents are happy.

But! Just pedaling, which are all the more unloaded, the children got bored after two or three days ... We turn to the Be plan. How to make cycling more interesting? That's right, you need to add a competitive effect, some visual perception ... Therefore, we put the front wheel on the machine and make a joystick out of a bicycle!

Again we mark, saw, drill, glue, twist ... Again the children are busy for some time with the help in manufacturing:

From the same chipboard we make two disks: on one we put the wheel, on the other we put the rotation sensor. ± 45º is sufficient to turn the steering wheel. The sensor found rotates ~ 270º. Yes, you will have to make the gearbox 1: 3, but this will allow us to unload our sensor from loads, because putting the sensor on a disk with a bicycle wheel and using it as an axis is not the best solution. The drive for our gearbox will be any rope, rep cord, etc.

The diameters of the discs were chosen to be 240mm and 80 respectively. Using a screw, washers and nuts, we fix the disk into the screwdriver chuck and make a groove with a round file. The groove will allow the cord not to come off the disks. In the base platform, we drill discs at a distance of ~ 10 mm. As the axis for the steering column, we use a screw with washers and a self-locking nut. As an axis for a disk with a sensor, they took an M6 pin (there wasn’t such a long screw in the bins :)). Under the M6 ​​axis, drill a hole of 5 mm, countersink on both sides, screw the axis. The axis is additionally glued with a second glue and soda.

For a long time I was looking for solutions how to fix the cord to the disks. It is necessary to make sure that the cord does not slip and that the discs spin freely, and that the cord does not come off the discs during active taxiing. Therefore, I drilled a blind hole of 8 mm at the end in each disk. I threw a piece of the cord with an eight on the wheels. They drilled into the drilled holes along the furniture dowel along with the cord.

The ends of the cord were tucked into the stalk of the steering wheel (with a diameter of 240 mm) into this hole and then the dowel was hammered into it, thereby dowelling additionally pulled the dowel when driving.





The result is a reliable gearbox that is not demanding on disc manufacturing accuracy and eliminates slippage.

I connected the axis of the small disk with the sensor with such a coupling:



Here's what happened:





I did not hammer dowels to the end, so that I could remove them and replace the cord. They also act as excellent angle limiters.

Electrical part




We will use the old, Soviet variable resistor as a rudder position sensor (again, on the balcony, we found a 5.1k ohm resistor). We take the speed sensor from the Chinese bicycle computer (there is a regular reed switch there), but you can also come up with some kind of micro switch on the rear feathers of the bicycle and attach a screw to the knob, which will click on the mic when the wheel rotates. We put it on the rear wheel.



In addition, you will need a pair of buttons without fixing, three resistors (although they are not necessary) and Arduino Leonardo (or another Arduino board on the Atmega32u4 microcontroller). We connect all this by any available means according to the following scheme:


Software part


I didn’t sit on the firmware for a long time - I had to check the idea’s efficiency as soon as possible. The main firmware code is not mine. HID joystick library, I also took the finished. The links are below.

I attach the source code of the firmware (as is) . There is no time to optimize and clean up yet.

Flashing, plugging in (I don’t see the point in describing the standard compilation and firmware process in the Arduino IDE environment - the topic is pushed along and across).

In Windows 10, the Arduino Leonardo joystick appears in Printers and Other Devices. Right-click on the menu, select “Parameters of game control devices”, press the “Properties” button and, if everything is done correctly, on the “Test” tab, turning the resistor slider, we see the cross moving, we pedal, and we see the gas change. By pressing the buttons (microswitches), the red buttons on the screen should also change their state. Also on the adjacent tab “Parameters” you can calibrate the joystick.

Well, then we put any car simulator, NFS, for example, and go!

Work demonstration



findings


Everything works, the necessary goals are achieved. Everyone is happy. There are ideas about upgrading both the design and the electronic part. But it is later. The thing turned out to be fire. I regret that I can not put my bike, otherwise I would drive too. And to hear from the child: “You are the best daddy in the world!” worth a lot.

All Articles