Katas focused on Embedded Software Developers

104 views
Skip to first unread message

Geoffrey Dunn

unread,
Jul 29, 2019, 1:23:56 AM7/29/19
to ArchitecturalKatas
Hi All,

I've been slowly building out a list of katas focused on Embedded Software development. The Web Services in the usual list gets a bit lost on people used to dealing with microprocessors and custom hardware. Even though they're often doing 4G comms to a RESTful server.

Anyway I'm sharing it here for anyone who may want something similar. I don't know if I would add it to anyone's generator as it's so different.


Coffee Machine
(inspired by a video by Uncle Bob on cleancoders.com)

The Mark IV Special makes up to 12 cups of coffee at a time. The user places a filter in the filter holder, fills the filter with coffee grounds, and slides the filter holder into its receptacle. The user then pours up to 12 cups of water into the water strainer and presses the Brew button. The water is heated until boiling. The pressure of the evolving steam forces the water to be sprayed over the coffee grounds, and coffee drips through the filter into the pot. The pot is kept warm for extended periods by a warmer plate, which only turns on if there is coffee in the pot. If the pot is removed from the warmer plate while water is being sprayed over the grounds, the flow of water is stopped so that brewed coffee does not spill on the warmer plate. The following hardware needs to be monitored or controlled:

  • The heating element for the boiler. It can be turned on or off.
  • The heating element for the warmer plate. It can be turned on or off.
  • The sensor for the warmer plate. It has three states: warmerEmpty, potEmpty, potNotEmpty .
  • A sensor for the boiler, which determines whether there is water present. It has two states: boilerEmpty or boilerNotEmpty .
  • The Brew button. This is a momentary button that starts the brewing cycle. It has an indicator that lights up when the brewing cycle is over and the coffee is ready.
  • A pressure-relief valve that opens to reduce the pressure in the boiler. The drop in pressure stops the flow of water to the filter. It can be opened or closed.

Fitness Wrist Device

The FitMan 9000 is a small battery powered device you wear on your wrist. It has Bluetooth LE connectivity, a small LCD screen that is very efficient on the battery. It also contains a pedometer and a pulse monitor. There is only a single physical button on the device. There are lots of functions we need to compete with other similar devices so you already have a huge backlog! Another team is helping out with the phone app but you’re going to have to do all the design work for the device.


Prioritised backlog:

  1. Show the current time
  2. Show the current steps taken today
  3. Show the current pulse
  4. Show the current date
  5. Pair with a phone app
  6. Show notifications from the phone app
  7. Report a low battery warning
  8. Flight mode
  9. See the steps progress toward a daily goal
  10. Show the current battery charge level
  11. Show if the battery is being recharged

The hardware level controls are:

  • There is an accurate clock giving ticks since epoch
  • Pedometer will send an interrupt whenever a step is detected
  • Pulse Monitor needs to be sent a tick every second and will report back a pulse rate
  • The button will send an interrupt for down and release
  • The Bluetooth control has a detailed API for pairing a device, a socket being connected, data received and data sent
  • The battery can report charge level as a percentage. It also can report if it’s discharging or charging
  • The screen is a 100x200 pixel black and white display
  • A small amount of flash storage (1k)
IOT Door Bell

The DingDong is a wifi connected door bell and camera. It enables people to be notified if someone is at their door on their phone even before someone has pressed the button. If they have a delivery and are not at home they can tell the delivery guy to just leave it at the door. It also adds security as you have a record of anyone snooping around your house 24/7. You’re going to have figure out the device software and the web services that link everything back to the phone app.


Prioritised backlog:

  1. Play a loud ring
  2. Run a WIFI host to receive a phone app connection that will send new wifi connection details and a password for changing those details
  3. Send a notification to the web service when the button is pushed
  4. Start a two way audio stream once the ring is acknowledged from a client
  5. Start a video stream once the ring is acknowledged from a client
  6. On button press switching from wifi client to wifi host to receive new connection details
  7. Allow changing the password over an established wifi connection
  8. Streaming video to a service to detect movement
  9. Notifying a client of detected movement
  10. Starting video and audio stream when detected movement is acknowledged from a client
  11. Recording video and audio of a detected movement
  12. Allowing a client to trigger a loud alarm


The hardware level controls are:

  • Wifi that can host an unsecure connection or connect to secure wifi host.
  • Video that can be streamed to a web service
  • Audio that can be two-way streamed to a web service
  • A button press interrupt
  • Some pre-defined ring sounds stored in rom
  • A small button that needs a needle to press
Vending Machine

The latest vending machine needs to compete with the wide range of features available in Japan. Your vending machine will need to be able to store cold or hot drinks. Have an interactive display. Multiple buttons to select drinks. A money return button. Off the shelf coin acceptor and bill acceptor. An “IC card” payment system (like Opal card). And any other features you can add to make your product stand out from others.


Prioritised backlog:

  1. Vend a cold drink when a button is pressed
  2. Vend a cold drink only if enough coins have been entered
  3. Vend a cold drink and give change if available
  4. Refund money if power is lost
  5. Store warm or cold drinks
  6. Warn if there are warm and cool slots mixed up (all hot should be on the left or right)
  7. Allow IC card payment – updating payment ledgers over Cell connection.
  8. Allow updating of the digital display from a remote service
  9. Report stock levels to a remote service
  10. Allow credit card payments

The hardware level controls are:

  • Display allows writing to a true colour back buffer 2560×1600 and a page flip command
  • Buttons report a “press” interrupt
  • Coin acceptor will send an interrupt and the coin type inputted.
  • Bill acceptor will send an interrupt and the coin type inputted.
  • A coin dispenser that can be queried for current coin levels and instructed to release coins by type
  • A 3G mobile connection
  • A NFC reader specific to IC cards
  • A NFC reader for Credit Cards
  • Drink stores can report the current inventory for each slot
  • There is a control to set cooling or heating (or off) for each slot
  • An interrupt that reports if the machine has been opened or closed (a key is required)
  • A power down notification is sent 30ms before all power is lost.



Enjoy,

Geoff


Theodore Neward

unread,
Aug 12, 2019, 11:58:26 AM8/12/19
to architect...@googlegroups.com
I love these, and I'll add them to the rotation with a caveat at the bottom that suggests they should be for "embedded systems use".

If anybody has a few more katas they've used and would love to see added to the mix, hit me up!

--
You received this message because you are subscribed to the Google Groups "ArchitecturalKatas" group.
To unsubscribe from this group and stop receiving emails from it, send an email to architecturalka...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/architecturalkatas/16a49bdf-7542-479a-84d6-48e917b9523d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages