by Clive Maby G4NAQ
Following a talk at the club and some interest from members this page shows details of the talk along with code (sketches) relating to the four demonstrations. The presentation slides cover the following topics: –
- What is a microcontroller?
- What is an Arduino?
- Current Models of Arduino
- Sensors / Shields
- Arduino Development Environment
- Programming the Arduino
- Compiling Sketches
- Demonstration Projects
- A Club Project
- Amateur Radio and the Arduino
- Useful Books & Links
The demonstration projects are written to highlight how you work with simple code to make useful projects either radio related or for in the home. The presentation is available as a PDF file and INO files if you want to use it with the Arduino IDE or other editor. No guarantees are provided with this code and feel free to modify it or advise me of coding issues!
All the files and the material referenced can be downloaded using links on this page.
Project 1 – Temperature & Humidity Sensor
This is the basis of what could be used as a weather station using 1 dual function sensor. To complete this project you would need to add additional sensors which typically are all part of the kits available today and add a display to make it self contained.
The demonstration uses an Arduino Nano which is one of the smaller boards but still has sufficient capacity to support this type of project.
Project 2 – House Alarm PIR Sensor
This project demonstrates the 3 components typically found in a house alarm movement sensor and uses a PIR to detect the presence of an object, an LED to show the detection has taken place and also ultrasonic sensors which measures the proximity. This was the first Arduino I purchased and it never had the useful header pins which can be seen on the newer models so an I/O shield is connected to provide the connections.
This demonstration was built around an Arduino UNO R3 but again would function on a Nano or other models.
Project 3 – Morse Code Tutor
The project mimics a Morse tutor similar to those developed by Datong around 20 years ago. The four position switch enables the choice of the alphabet, numbers, mixed alphabet and numbers or punctuation characters to be sent. A small interface board consisting of header pins and 10k resistors is required between the I/O pins and the switch to “pull down” the pins down otherwise they will generate random results (see https://www.arduino.cc/en/Tutorial/DigitalPins).
The sketch is configured to generate 5 character groups of Morse and the audio output frequency to the speaker has been preset. Both of these can easily be changed and it would only take a few lines of code to connect a further 10k pot to control the audio frequency. The code has been developed as a series of functions which makes it easier to maintain and to understand.
The characters are written out to the serial interface along with a message when a change is made to the Morse option (switch). This project was the most time consuming as I head to teach myself C at the same time and can probably be optimised. The next change being to convert the huge section of code used to send the characters into an array.
Project 4 – Morse Code Decoder
This project was written to prove the previous project actually works in that it decodes the morse being generated. It will flash the LED to show the characters being decoded as well as writing the characters out to the terminal interface in the form of “.” and “-” to show the characters. The microphone can be placed next to the receiver speaker for basic testing and improved by using a small interface to enable direction to a receiver. The majority of the code was found on another website and modified to show how an LCD display module can be integrated.
All the code can be download in the following zip file SARC_Arduino
If you find there are any problems or have suggestions for the code I have released please drop me an email – firstname.lastname@example.org.
Have fun experimenting with the Arduino.