From d700a2e92be52c08b0b468d3f5cd70053cfa5d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Fri, 28 Oct 2022 13:28:34 +0200 Subject: [PATCH] doc: document project --- README.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 722399e..315cc16 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This firmware template is designed for development boards based around [STM32 F4 series micro-controller](https://www.st.com/en/microcontrollers-microprocessors/stm32f4-series.html). +Firmware for the crown counter. project ======= @@ -6,12 +6,14 @@ project summary ------- -*describe project purpose* +The crow counter just counts how many (per day and in total) caps (e.g. crown cork) have entered the basket. technology ---------- -*described electronic details* +An infra-red LED and photo-detector create a light barrier, broken when crossed by caps. +An RTC keeps track of the days. +2 TM1637 7-segment displays show how many caps passed in total and today. board ===== @@ -26,11 +28,24 @@ This is required to map the user LED and button provided on the board connections =========== -Connect the peripherals the following way (STM32F4xx signal; STM32F4xx pin; peripheral pin; peripheral signal; comment): +Connect the peripherals the following way: -- *list board to peripheral pin connections* +- IR LED: connected across 3.3V with potentiometer to adjust brightness +- IR photo-detector: PB5 +- first TM1637 7-segment 4-digit display: CLK to PB6, DIO to PB7 +- second TM1637 7-segment 4-digit display: CLK to PB8, DIO to PB9 +- CR1220 to VBAT for the RTC -All pins are configured using `define`s in the corresponding source code. +note +---- + +at first I use a KY-032 infrared sensor detects when a cap passes through the basket. +this modules the infra-red LED (set to 38 kHz), and has an IR demodulator (at 38 kHz). +I though this would be less noise prone, particularly from external IR sources. +turns out it is a lot more. +I tested will the cap reflecting the IR, but this is sometimes to short, and the demodulator might not detect it. +I tested with the cap breaking the barrier, but the IR demodulator doesn't allow continuous IR burst detection and has a hard time detecting when it is broken and restarted. +in the end, a simple LED on and photo-detector to create a barrier is super simple and efficient. code ====