Valid XHTML 1.0 Transitional

Other Arduino projects

Hand made tone

tone by hand

Here is a simple system to produce different tones. In the implementation of the picture on the right there is an ultra-sonic sensor connected to the ports 9 and 10 of the Arduino Uno and a small load speaker to the port 12. With the sensor we measure the distance to the object (e.g. hand) and generate a tone whose frequence depends on the distance. If the distance is too short (< 5 cm) or too long (> 66 cm) no tone is generated. The distance is measured frequently enough, e.g. once every 0,1 seconds. The program can be found here: Hand made tone

Electronic dice

electronic diceIn this picture there is Arduino Uno and seven leds connected to ports 2-8 and a switch (button) connected to port 9. When the user push the button a random number between 1-6 is generated and the corresponding leds are turned on. Here is the Arduino program for that: Electronic dice. And the circuit diagram can be found here: Circuit diagram. R1 = about 150 Ohm, R2 = about 10 kOhm, values are not quite critical.

More ports

Most Arduinos support 14 digital input/output ports. When more ports are needed a special module can be used (e.g. Arduino Mega). Or shift registers can be used to control with few Arduino's ports many output ports. In this section that possibility is considered. See also e.g. Arduino and shift register.

A serial-to-parallel shift reqister (like 74HC595) can be controlled by three ports of Arduino. One 74HC595 has 8 output ports, and it is possible to connect them one after another to get 16, 24, 32 etc. ports. And they all controlled just with three Arduino's ports. The circuit diagram on the right shows the solution to connect two 74HC595 circuits to Arduino. All the pins of 74HC595 are listed in detail in the previous link, but the general definitions are also here:

  • pin 15 output port A
  • pins 1-7 output ports B-H
  • pin 8 ground
  • pin 16 +5V
  • pin 14 serial input
  • pin 11 shift
  • pin 12 copy
  • pin 13 connect to ground
  • pin 10 connect to +5V
  • pin 9 value of port H (before copy), or serial output

When several 74HC595s are connected one after another the pin 9 of the first one is connected to the serial input pin of the second one, pin 9 of the second one to the serial input pin of the third one and so on. Shift pins are connected together and so also copy pins. And serial input, shift and copy pins are then connected to Arduino. When the shift pin goes from LOW to HIGH the values of the shift registers are moved one step ahead and the value of serial input is stored in the first shift register. When copy pin goes from LOW to HIGH the values of the shift registers are copied to the output ports A-H.

arduino and shift registers Arduino uses command " shiftOut(dataPin, clockPin, MSBFIRST/LSBFIRST, value) " to put one byte (=8 bits) into the first 74HC595, and at the same time the previous value (byte) is moved to the second 74HC595. It takes about 100 microseconds to store one byte (200 us to change all the outputs of both 74HC595s, i.e. two bytes), so a new values to the output ports can be done so fast that e.g. motors cannot see any delay because of that serial-to-parallel operation. R1 = about 150 Ohm, value not critical.

Most useless ?

most_useless Here is perhaps the most useless device ever, but it's fun. When You turn the black switch a lever arm arises from the box and turns the switch back to its initial position. The state of the switch is monitored by Arduino, which controls also the red led ant the servo-motor, which turns the lever arm.

Here is the program for Arduino: Most useless device - the program.

The electronic circuit is here: Circuit diagram. R1 = 150 Ohm, R2 = 10 kOhm, values are not critical.

Finally here is a short video which shows how it works (about n. 18 MB): Most useless - the video

to be continued ...