Sketches are Arduino programs. These sketches are for Freaklabs boards and can be customised for your application.
Please note: Some sketches require libraries. Check the #include for the required libraries.
BoomBox
All sketches are available on Github
We recommend testing BoomBox with sequential playback first, to become familiar with the system and how it works. For details assembling the device, code, how to test and deployment, please refer to the BoomBox Practical User Guide
Sketch Name | Description | Target Hardware | Github Repo |
---|---|---|---|
testBoomboxStandalone | Tests the BoomBox hardware and speakers are working via the command line or 'test' pushbutton on the BoomBox circuit board. Audio will play through the playlist sequentially. | BoomBox | BoomBox Sequential Github Repo |
testBoomboxTrailcam | Tests BoomBox and camera trap assembly is correct, and the full system is working. Tested via camera's PIR motion sensor in test mode. Audio will play through the playlist sequentially. | BoomBox | BoomBox Sequential Github Repo |
deploymentBoomboxMain | BoomBox deployment code for sequential playback. Parameters include: max_sounds - number of audio files delayTime - time in milliseconds trigger and audio playback durationTime - length of longest audio file offDelayTime - quiet time before next trigger event | BoomBox | BoomBox Sequential Github Repo |
testBoomboxStandaloneRandom | Tests the BoomBox hardware and speakers are working via the command line or 'test' pushbutton on the BoomBox circuit board. Audio will play through the playlist randomly. | BoomBox | BoomBox Random Github Repo |
testBoomboxTrailcamRandom | Tests BoomBox and camera trap assembly is correct, and the full system is working. Tested via camera's PIR motion sensor in test mode. Audio will play through the playlist randomly. | BoomBox | BoomBox Random Github Repo |
deploymentBoomboxMainRandom | BoomBox deployment code for random playback. Parameters include: max_sounds - number of audio files delayTime - time in milliseconds trigger and audio playback durationTime - length of longest audio file offDelayTime - quiet time before next trigger event | BoomBox | BoomBox Random Github Repo |
WildLogger
All sketches are available on Github
For explanations on the code, please refer to the relevant module page in the Build Your Own Data Logger (BYOD) course.
Sketch Name | Description | Target Hardware | Build Your Own Datalogger Module | Github Repo |
---|---|---|---|---|
Module 2-4: Blink an LED | A basic sketch for blinking an LED, and controlling the blinking speed. | WildLogger | Module 2 Page | BYOD - Module 2 |
Module 2-5: Hello World | This sketch will print out ‘hello world’ to the Arduino serial monitor. 'Hello World' is a common first program developers use to check their hardware can communicate and send text data to the computer via the serial port. | WildLogger | Module 2 Page | BYOD - Module 2 |
Module 3-1a: Arduino Command Line - Hello World | Introduces the Arduino command line library we wrote. We show you how to print out "hello" from the command line. | WildLogger | Module 3-1 Page | BYOD - Module 3-1 |
Module 3-1b: Arduino Command Line - List Arguments & Realtime Clock | Add arguments to the command line and list them out. Also adds a command to display the time from the realtime clock. | WildLogger | Module 3-1 Page | BYOD - Module 3-1 |
Module 3-1c: Arduino Command Line - Blink | Control the blinking frequency of an LED from the command line. | WildLogger | Module 3-1 Page | BYOD - Module 3-1 |
Module 3-2a: Temperature and Humidity Sensing | Read the temperature and humidity values from a DHT11 sensor | WildLogger | Module 3-2 Page | BYOD - Module 3-2 |
Module 3-2b: Command Line Temperature and Humidity Sensing | Create a command to read the temperature and humidity values from the WildLogger sensor interactively from the command line. | WildLogger | Module 3-2 Page | BYOD - Module 3-2 |
Module 3-2c: Creating a Temperature Warning Light | Use the temperature value from the DHT11 to turn on an LED above a critical temperature | WildLogger | Module 3-2 Page | BYOD - Module 3-2 |
Module 3-3a: Reading battery voltage | We use the analog to digital converter (ADC) to read the battery voltage of the WildLogger | WildLogger | Module 3-3 Page | BYOD - Module 3-3 |
Module 3-3b: Reading battery voltage from the command line | Create a command to read the battery voltage interactively from the command line | WildLogger | Module 3-3 Page | BYOD - Module 3-3 |
Module 3-4a: Set Time and Date | Set the time and date for the real time clock | WildLogger | Module 3-4 Page | BYOD - Module 3-4 |
Module 3-4b: Command Line Time and Date | Create commands to set and read the time and date interactively. | WildLogger | Module 3-4 Page | BYOD - Module 3-4 |
Module 3-5a: Writing and Reading the SD card | Introduces how to initialize the SD card. Then writes data to it and reads it back. | WildLogger | Module 3-5 Page | BYOD - Module 3-5 |
Module 3-5b: Command Line SD Card Write and Read | Create commands to write temperature and humidity data to the SD card. Create a command to read the contents of a file on the SD card. | WildLogger | Module 3-5 Page | BYOD - Module 3-5 |
Module 3-5c: Command Line Disk Operations | Add additional commands to list the files in the root directory and delete files from the SD card. | WildLogger | Module 3-5 Page | BYOD - Module 3-5 |
Module 3-6a: Interrupts - Pushbutton | Introduces interrupts and interrupt service routines (ISR). Initialize the pushbutton interrupt for WildLogger, debounce it, and create ISR to toggle an LED. | WildLogger | Module 3-6 Page | BYOD - Module 3-6 |
Module 3-6b: Interrupts - PIR Motion Sensor | Initialize an interrupt to trigger on the PIR motion sensor. Also read the PIR state and light an LED when the PIR is triggered. | WildLogger | Module 3-6 Page | BYOD - Module 3-6 |
Module 3-6c: Interrupts - RTC Alarm | Initialize the timer on the real time clock to generate an interrupt every minute. Create an ISR to handle the interrupt and print out the date and time on each interrupt. | WildLogger | Module 3-6 Page | BYOD - Module 3-6 |
Module 4a: Tying It All Together | Tie all the previous principles from Module 3 to create a functional datalogging application. | WildLogger | Module 4 Page | BYOD - Module 4 |
Module 4b: Safety Checks and Diagnostics | Add in safety checks and diagnostics into the application. Add error handing for system errors. | WildLogger | Module 4 Page | BYOD - Module 4 |
Module 5a: Power Management with the WildLogger | Add power management code to increase battery life. We put the system to sleep and wake up based on the interrupt from the realtime clock. This stretches out battery life to a few months. | WildLogger | Module 5 Page | BYOD - Module 5 |
Module 5b: Watchdog Timer Implementation | We implement the watchdog timer for WildLogger. This improves the system's field reliability by resetting the system if the watchdog timer isn't reset every 8 seconds. | WildLogger | Module 5 Page | BYOD - Module 5 |
Module 5c: The Grand Finale | This completes the software application for the WildLogger for this course. It ties together the datalogging, power management, and optimizations. Future bonus modules will extend functionality or add different sensors. | WildLogger | Module 5 Page | BYOD - Module 5 |
Module 5d: Bonus - Specify the time spent in command mode before switching into 'norma' mode. | We normally have 5 seconds after reset to check for a special character, ie: 'c'. If the character comes in, then we go into command mode and stay there until we type the 'normal' command which goes into normal / sleep mode. This sketch allows you to specify the time before moving into normal 'sleep' mode. nb: You can only switch between the two at the beginning of the program so you will need to reset the system before you type commands into it. This is a variation of Lab 5a. | WildLogger | Module 5 Page | BYOD - Module 5 |