Normally Arduino boards are reset by using additional DTR line of serial interface. This becomes a problem when USB-UART adapter doesn’t support DDR line. And you probably read many cases were one or another particular cable won’t work for programming, but can be used for simple serial data transfers. Ralph thought that there should be another solution that would allow using any serial cable for programming. He thought that TXD and RXD lines are always available since they are used for data receive and transmit. So why not to use one of those to reset microcontroller.
With three additional discretes he created a simple circuit that would stand between RXD data line and RST pin. This is simply an RC circuit that would discharge cap during some time. So when data line works in normal operation – RSTin isn’t affected due to slow cap discharge. But when RST signal is held down for longer time – cap is discharged and then RST signal is sent. Since he’s done modifications, he also had to do changes in AVRDude configs. That turned out to be fairly easy. Overall this is quit smart solution that could be considered as option on any Arduino board, so we wouldn’t need to hunt for specific serial adapter cables.
Sometimes we get caught in situations when we need direct solutions without figuring things out in more efficient manner. For instance microcontrollers and pin count. When we need more pins, we start looking for bigger MCU even if processing power is enough even if one additional pin would change the situation. So sometimes this is not effective to waste money and even design to get one or two additional I/Os. Some people may use I/O port expanders or shift registers to get more pins. But as Ralph shows we don’t always need head for obvious. There are tons of discrete electronics components around that may save the day. This time he suggests interfacing well known nrf24l01 RF module to small MCU like Attiny85 by using 3 pins instead of 5.
So here it is a discrete schematic which does the magic. First of all Rf module is 5V tolerant except VCC must be powered between 1.6V to 3.6V. So a simple LED reduces VCC to save range. CE is another pin that can be tied to high. CSN signal was constructed by using SCK line. Capacitor and resistor ensures correct timing of CSN being pulled low. Other pins like MOSI and MISO are used normally. In order this solution to work, Arduino library was a little modified which allows using multiplexed SCK and CSN lines.
Smaller microcontrollers like Attiny84 microcontrollers don’t have UART interface and in many cases you may not need it. But if you will want to have an USART option, you will need to user software USART library or write your own routines. You can find many great software USART libraries for that purpose. As a rule you will have to use two pins to establish communication. But if you are tight on I/Os then you can cheat a little and make it work from single pin. Ralph has been experimenting with simple but smart circuit which allows to perform half duplex UART communications with other systems.
The whole trick lies in a small schematic made of diode, transistor and resistor. Diode is only for making one way TX signal path from MCU to other device. Resistor is only for limiting base current. All is left a transistor which works as a key. We need to keep in mind, that when serial line is inactive- it stays in high state. So when microcontroller transmits data, TX on the right keeps transistor open. Thus if Tx from MCU is low, it pulls Rx low and viceversa. When serial adapter wants to transmit 0, it pulls AVR line down through diode, when adapter sends 1, it opens transistor ans since adapter Rx line is high since not used, it sets AVR Rx pin high. All simple and smart. If you wish to try this by yourself, there is an Arduino library available which takes as little as 62 bytes of flash. Takes no RAM for buffering and can work at baud rates from 460.8kbps to 16MHz.
Every electronics device needs a power supply. In many cases we just go with AA batteries, 9V + regulator, wall mounted adapter and LiPo cells. First ones are obvious enough – easy to obtain and pretty safe. Lithium technology batteries falls in to different category. These cells carry much more capacity than casual batteries, but also are more dangerous and sensitive to too much discharge and overcharge. This is why in almost all cases LiPo batteries come with small PCB attached to them. This circuit at least takes care of disconnecting battery in case of discharge bellow threshold (2.7V). In battery packs this situation is more complex. Proper circuit should monitor individual cells and disconnect whole pack if at least one cell reaches the threshold. But in reality cheap battery packs lack individual protection. So in case of failure of single cell, whole pack is condemned.
Karman suggests not to throw such battery packs away, but instead take them apart and check if there are any of individual cells alive. They can be reused in other projects. For instance he took Macbook Pro battery pack and found two of three cells working. Then he took individual cell protection circuit from dead picture frame and paired with one cell. This way he got decent power supply for same picture frame or any microcontroller project. Lithium cells are still pretty costly, so look around maybe there are few sources to scavenge them and reuse.