Week 2- Coding and CSC Prototype Demo

Coding and Setting Up Electrical Circuit:

Post building a prototype for the WashBoard, I began to compile the code for the series of commands the WashBoard should follow.

I used the “SOS” function we created earlier in the semester as a guide to connecting the backlights in the circuit and getting them to light up during specific time intervals.

When connecting the backlights into the breadboard, it was important to take note that the positive and negative ends of the light don’t touch one another, as to prevent the backlights from fusing. Additionally, a resistor of 270 ohms or 330 ohms must be connected in series with the backlights within the circuit. I chose to use the 270-ohm resistors. Their lower resistance allows the backlights to illuminate more brightly and will, thus, help in better brightening the panel.

As a start, I wanted to make each instruction last 5 seconds and connect two backlights and LEDs in series. My aim was to have a LED and backlight illuminate as a set for 5 seconds, followed by the illumination of a successive LED and backlight for an additional 5 seconds. At any given moment, only one panel/set of backlights and LEDs will be illuminated for 5 seconds.

Because I didn’t have an IR Beam Sensor to connect in series with the circuit, at the time, I incorporated a switch/button as a device of feedback and control. Therefore, when the button is pressed the following actions will ensue:

  • Button is turned on
  • Panel 1 illuminates- LED 1 and Backlight 1 turn on for 5 seconds
  • Panel 1 turns off
  • Simultaneously, panel 2 turns illuminates- LED 2 and Backlight 2 turn on for 5 seconds

To begin compiling the code for the above actions, I first defined all devices attached to their respective pins in the scope (i.e.: button, backlights and LEDs). After which, in ‘void set’ up I made sure voltages was outputted through required pins. The majority of the above commands were then defined within the loop and a five-second delay was added. An ‘if ’ statement was used to carry out all commands once the button was pressed.

The figure below shows the code I compiled and explains the function of each line.

 

Post CSC Prototype Demonstration:

I demonstrated the above code to Prof. Gleason from the CSC. My goal for the demonstration was to provide Prof. Gleason with an idea of how the WashBoard would operate and the main principle behind the code.

Having demonstrated the WashBoard prototype, I was able to get a better understanding of the elements I need to add/work on.

Using Prof. Gleason’s advice, I will have to add a delay to the entire system as to prevent children from opening and closing the tap to see the WashBoard light up and then switch off. The addition of a delay would prevent children from consistently turning the tap on and off, by making them wait 10 seconds if the tap is turned on more than once in a given period of time.

Additionally, we discussed using a sufficient number of steps as to not overwhelm the children with instructions, but still get them to effectively wash their hands. To make sure to use an optimal number of steps, I will be basing each panel of the current “hand washing” posters in their classrooms as a guide. We also discussed the durations of each step. Prof. Gleason mentioned how often the children get distracted between turning on the tap and beginning to wash their hands. Therefore, the delay of the first panel must take this into account.

The duration of each panel’s function will vary. To gain a better scope for how long each step should last, I will be visiting the CSC over the next week to observe the children and compose an average time delay for each step, which will then be integrated into the code.

 

Reflection:

Over this week I have gained a better understanding of the needs of my device. I did come across struggles coding and getting the panels to light up one after the other; however, through reading up on various Arduino functions online, I was able to overcome challenges I came across. Overall, I have gained a deeper comprehension for Arduino functions and have learnt more about circuitry and the operation of breadboards.

Print Friendly, PDF & Email
One Comment

Leave a Reply