Electronics

Updated Feb 7, 2021


On this page, I will post electronics items relating to speech, navigation, lights, etc. Generally speaking, I plan to use microcontrollers to control everything so that I don't have to deal with outdated computers or dependency on software packages. It will be self contained and (hopefully) will work just as as well when fired up 20 years from now. Of course, that also means writing a lot of code which I'm fairly sloppy at, but can do when necessary. I worked as an electronic technician for 20 years.

 


For audio, I plan on using the DFPlayer Mini (Also sold as Flyron FN-M16P).

It is very small, only 0.8 x 0.8 inches (21.5 x 21.5 mm). It plays MP3 and WAV files from a micro SD card or flash drive. It can be controlled by switches/relays or through a serial port.

 

Links (let me know if any links are broken):

DF Robot

Banggood

Flyron

These 2 videos were supposed to be one. They show my work to make the robot talk. I am initially working with a clock IC but will extend it to making environmental reports.

 

The microcontroller reads various sensors (clock, temperature, etc) using a 2-wire I2C bus. Then it chooses the appropriate spoken words & phrases to play. It then uses a serial bus to send commands to the DFPlayer Mini to make it play the audio files. In this case I also have an LCD display in case I need it for debugging.


For the belly light pushbutton detection & decoding, there are some issues to be dealt with to make it free from contact bounce and to not waste lots of processing scanning the buttons at high speed. I also only want to use 1 small microcontroller for the entire chest, so I can't have a connection to it from each button and each light.

 

In the circuit below, each button switch connects to a CD4044 latch, so contact bounce is eliminated. Then the triple input 4075 AND gates monitor the latch outputs and send the micro a signal if any button is pressed. The micro then does a quick scan using the CD4067 analog MUX to determine which of the buttons was (were) pressed. It can take its sweet time doing it and when done it clears the latches so it is ready for more keypresses. It looks complicated but the main issue is that it is a pain in the butt to lay out on a circuit board.

To blink the lights as well as flash them to respond to keypresses, the lights are controlled using a bunch of 74HC595 shift registers. With only a couple of connections, the same micro used above can serially send out a string of ones and zeros and then latch that information to the lines that control the LEDs (not shown). I purposely wrote the code and did the hardware so that it could be used to connect to other chips using the SPI interface standard. But in this case, the "chip select" line is connected to the latch control on the shift registers.


The same serial scheme that controls the LEDs can also be used to control an LCD character display. When I'm writing code I like to have one hooked up so I can display values & results so that I know things are working correctly.



I designed the schematic below for a club member who wanted to build a Jupiter 2 themed bar with the scrolling light pattern. This is a very simple circuit that will drive LEDs to create that effect. It can also be used to drive solid-state relays. Click to enlarge.