» Electronics » Arduino "Toy" Animal Names Morse Code "

Toy "Animal Names Morse Code"



Readers know scouts - analogues of our pioneers, but it turns out that there are also cubs - analogues of our October. Accepted in them from the age of five. The son of the author Instructsbles under the nickname mr_fid has already been adopted, and he will have to attend a major event for cabs and scouts, one of which will be Morse code. To further interest the child, the master gave him an unusual toy.



It is executed on Arduino Nano also generates 12 different words output to the beeper with a built-in generator (switchable by a mechanical switch) and an RGB LED. The cycle can be adjusted between 100 and 1100 milliseconds. To switch words, a tinker switch is provided. The design is powered by a 1000 mAh lithium-polymer battery. The charge controller is built-in. But here it is not yet:



Mr_fid thanks Simon Monk for the book Arduino Programming, which he bought several years ago. In drawing up the sketch, he relied on examples from this book.

Starting work on homemade, the master knew about Morse code only that there was an SOS signal. I had to learn the materiel and find out that the point is one measure, the dash is three, the interval between the characters in the letter is one measure, between the letters is three, between the words is seven.

When marking plastic mr_fid uses masking tape. Thanks to this, the marker trace is better seen if the plastic is dark. In addition, this adhesive tape is matte, and the drill does not slip when “aiming”.



It is necessary to estimate in advance where which of the components of the structure will be located, so that everything fits, and not one of the components touches the neighboring ones, including the protruding parts. Mr_fid has not forgotten anything but ... the battery. Well, the case is quite spacious, and then a place for it was found. In the meantime ...



Although the master has a small bench drill, even with it he used a step drill for convenience, it is also a “herringbone” or “carrot”.



When the knob switch shaft is rotated by the handle, the switch itself must remain stationary. For this, in addition to the shaft, in front of it is a small pin that requires an additional hole on the front panel.



Therefore, mr_fid first drilled a hole for the shaft, then glued the masking tape on the back, put the wrench switch in place and pressed it. The pin left a mark on the masking tape, it remains to drill a hole there.

The scheme without taking into account the battery, charge controller and converter looks like this:



On the front panel, where the biscuit switch and the variable resistor are located, the master combined those conclusions of these components that are connected to the same points of the circuit in the case (in this case, the plus and the common wire). This allowed only four wires to be drawn between the front panel and the housing.



The wrench switch is also turned into a kind of variable resistor, only a step one, for which 11 resistors per 1 kOhm are soldered to it, as shown in the photographs. Arduino determines its position by a stepwise changing voltage, for which one analog input is enough.



Larger:



To control the RGB LED, mr_fid chose the Arduino pins with numbers 9, 10 and 11. These are PWM outputs, which in the next firmware will make it possible to get more bits per color than three.

He connected a plus and a common wire in reverse polarity to a variable resistor, so that the minimum position corresponds to the cycle of maximum duration, that is, the minimum speed.

The example from Simon Monk’s textbook is simple and single-functional: it takes data coming in through the serial port and translates it into Morse code with a 200 millisecond cycle. Additional functions added by the wizard provide adjustment of the period depending on the voltage coming from the variable resistor engine, as well as the refusal of the serial port in favor of storing 12 fixed words selected by the dial switch. Also added routines for controlling the RGB-LED mode switching button, well, and with a tweeter with a built-in generator, the program could control initially.

When programming Arduino, mr_fid completely forgot that the toy needs to be fed from something, because the board has been powered from USB all this time. When he remembered, the first thought was to power it all from the “Krona” through the stabilizer. But it did not fit, and at first the master wanted to place it outside, but then decided to use a thin lithium-polymer battery with 3.7 V and 1000 mAh.



With a freshly charged battery, the voltage reaches 4.2 V, which is enough for all the crystals of the RGB LED, including blue. But as it discharges, it drops, and although 3.3 V is enough, the brightness of blue light can greatly decrease. I had to use a boost stabilizer with a stable five volts at the output. And in order not to remove the battery from the case when charging, the author added a charge controller and a two-pole reversing switch that connects the battery with both poles to either the Arduino or this controller. Now you can charge the toy from USB.



He connected all this together in such a way, not forgetting the polarity and the prevention of short-circuit:



By changing the position of the biscuit switch, you can select the Morse code for the following letter combinations: HHH (one dots), OOO (one dash), CAT (cat), DOG (dog), ANT (ant), FLY (fly), RAT (rat), OWL (owl), PIG (pig), HEN (chicken), FOX (fox) and EMU (emu). The button allows you to switch the operating modes of the RGB LED on the ring: constant colors - red, blue, green, blue-green, yellow, raspberry, white, as well as a red dot and a green dash, color change after each word, color change after each letter .

In Arduino, mr_fid uploaded such a sketch:


If you repeated after the master, now in your hands is the same toy with which you can interest your children in Morse code. And when they grow up, with a simple firmware alteration, you can get the basis for a standard automatic "fox", transmitting a choice of MOE, MOI, MOS, MOH or MO5, turning on for one minute every four minutes.

P.S. especially for boring people who find fault with headlines: animals are a collective name for animals, birds and insects.
9.8
10
10

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose
6 comments
Quote: tormozedison
remove bipolar reversing switch?
Yes, leave a single-pole switch between the battery and the Step-Up module.
Author
Clear. Such a module, therefore, would not only protect the battery from overdischarge,but would it allow to remove the bipolar reversing switch?

Now, if I repeated this thing, then in general I would simply attach the cord to the power bank, abandoning the internal battery. And I would also add RTC and the Morse clock function.
The one in the photo is intended only for chargers. Here you need to control not only the charge, but also the discharge. On the board, in addition to TP4056, you need an IC like DW01 and keys to it. And, accordingly, not 4 contacts for wiring, but 6. Maybe the boost module will protect the battery if it suddenly stops working at a voltage of 2.7 ... 2.8 V, but we don’t know anything about its parameters and count on " left "effects are wrong.
Author
Tell me, why is this type of charge controller bad, and which is better?
The ugly soldering of resistors on the biscuit and the wrong battery charge controller.
But only the title can be faulted? But the author does not have literacy?

We advise you to read:

Hand it for the smartphone ...