Challenge 1 Challenge 2 Challenge 3 Evaluation Homework Tasks Achievements

The Programming boxes

Contextual Challenge (the problem that needs solving)

Microcontrollers need a program to monitor input components and control output components. You will need to research and learn microcontroller flowchart programming in order to program your own microcontroller.

Specification

Must Should  Could
Be able to identify and use a digital input flowchart symbol. Be able to create a toggle switch circuit. Be able to play a tune using a piezo transducer.
Be able to identify and use an analogue input flowchart symbol. Be able to create a loop to constantly monitor a digital input. Use other flowchart blocks to create programs of your choice.

Be able to control an output.

Be able to create a loop to constantly monitor a analogue input.  

Be able to write a time delay into a program.

Be able to download programs to the program boxes.  

 

1 PIC Programming

  • One of the most useful process components you will use in Design engineering is a PIC chip. This are small silicon chips which you can write programs for, which will in turn allow you to take control of how your circuit behaves.
  • Using our pre-built programming boxes, you can see how a circuit can be re-purposed to perform an task you want. Hardware hackers take everyday objects, and add electronics to them to create new original products from scrap materials - this is a great way to create innovative new products, and teaches you an enormous amount about Design Engineering at the same time.
  • Your task is to produce a series of increasingly difficult programs to make the inputs and outputs in the programming boxes perform different jobs.
  • You can download the Circuit Wizard file which contains the circuit that is inside the program box from here. It also has an example PIC program to get you started; well worth a read!

The programming boxes

There are 12 different programming challenges, each a little harder than the one before it. You're not expected to complete them all (although if you can, you should take GCSE Design Engineering!).

The below video is an introduction to Circuit Wizard and flowchart programming - it does not go through the programming challenges.

a: Bike light. Make a program that causes the LED lights to alternate on and off once a second when the unit is turned on.

b: Momentary LED torch. Make a program where holding down the button causes the LEDs to illuminate, and releasing it turns them off.

c: Toggle switched LED torch. Change the program so that the LEDs come on when the button is pushed once, and are turned off when pushed a second time.

d: Morse code transmitter. Make a program that will cause the piezo siren to beep (and the LEDs illuminate) when the button is pushed, to allow act as a Morse code transmitter. Bonus marks if you can make it transmit SOS when the button is pushed once.

e: Night light. Write a program for the box that causes the LEDs to illuminate when it gets dark.

f: Night light Mk II. Modify your program so that your night light can also be turned on and off by the PTM switch.

g: Music box. When the button is pushed, Happy birthday plays and the red LED is illuminated. When pushed while the LDR is covered, a different tune is played, and the green LED comes on.

h: Music box Mk II. The piezo plays a tone which goes up and down in response to the current light level. Even better, if the button has to be held down at the same time.

i: Personal alarm. Write a program that will make the piezo siren beep, and the LEDs flash on and off when the button is held down for 3 seconds.

j: Book alarm. The user places an object on top of the program box (so the LDR is in the dark). When the object is removed, the piezeo siren sounds and the LEDs to flash.

k: Free choice. Write your own program to utilise all the inputs and outputs, and write a short description of what it does.

Final challenge: Write a program to control an alarm which (when armed) sits inside a cupboard or drawer, and goes off when it detects the drawer has been opened. It should work as follows:

  • 1. Green LED comes on
  • 2. When the button is pushed and held for 3 seconds, the green LED should blink on and off once a second and the piezo should beep at the same time for 5 seconds.
  • 3. After 5 seconds, the green LED should go off, and the red LED should be turned on.
  • 4. The current light level should be stored in a variable called "C".
  • 5. The value of C should be increased by 5.
  • 6. Once a second, the current light level should be compared to the stored in "C".
    • 6a. IF the current light level goes above the value of C, then…
    • 6b. The red and green LEDs should flash one after another, while the piezo siren beeps.
  • 7. Repeat step 6.
  • For additional credit, add instructions to disarm the alarm without setting it off by holding down the button.

Badge It Silver

  • Download the Word document and upload your screenshots.
  • If you rename the START box to the letter of the task you are working you do not need to label it.
  • Only upload the the document once you have completed the first four tasks.
  • Use the 'Snipping Tool' to take a picture of your flowchart. Upload the challenges 'A to D' for the Silver Badge.

Badge It Gold

  • Upload Challenges 'E to G' flowcharts.

Badge It Platinum

  • Upload all of the flowchart challenges(H to K), including the Final challenge. K will need an explanation of what your flowchart does.

 

 

Stuck with coding?

If you're struggling with the programming, you can get help with: Challenge A, Challenge B, Challenge C, Challenge D, Challenge E and Challenge F

NOTE: The audio and video are about 5s out of sync in the challenge E video - it does show you a solution, though!