下屁股计时器

2,212

27.

5.

简介:下车你的对手计时器

About: Petroleum Engineer working in Tulsa, OK. Started messing around with electronics in 2014 when I purchased an Arduino Uno. I think I'm hooked now, always trying to think of something else to build.

我们都读了它。“坐在新的吸烟”,“坐着杀了你”等等,无论学习和头条新闻表明你,我都认为这很容易坐在你的屁股上,整天都不健康。我们中的许多人每天有8个小时就完成了这一点。我的一天大部分时间都在电脑前工作,我知道我的背部开始疼痛,我的姿势吮吸,进入“区域”后等2-3小时的伸展。我一直在寻找一个借口来制作一些东西,并认为一个简单的提醒来起床和走路或站立,工作(在一个模块化的坐/立场工作站)是一件相当愉快的事情。

此外,我有1型糖尿病,这是一种自身免疫性疾病,其中我的身体决定攻击我的胰腺并杀死我的胰岛素产生β细胞。所以我服用胰岛素24/7/365只是为了保持活力并保持我的血糖范围。这与糖尿病的超重爷爷开发的糖尿病不同。我很善于管理我的血糖,但一件事肯定有助于起身移动!它有助于增加胰岛素敏感性,整体对你来说是一件好事。同样也可以在那里(更常见的糖尿病患者(更常见并且通常绑在饮食差和运动)中也可以说。如果您想更好地了解两种主要类型的糖尿病之间的差异this link并且不再是无知的!

我设置了设计框以包括指示灯,当我应该站起来时,另一个在我应该站起来和工作时告诉我。它有一个“确认”按钮,您在散步后按下,重置一个小时计时器。还有一个复位按钮,您在每天开头按下,以重置所有定时器。目标是使其简单,令人赏心悦目,便宜!跟随并查看构建。

If you like the project please vote for me in the Microcontroller Contest!只需单击此页面右上角的橙色投票按钮即可。

第1步:材料

I used the following materials and tools:

- (2) Normally Open Buttons

- (2) Clear/white LEDs

- ATtiny 45 Microcontroller

- 8针浸插座

- 0.200" Plywood

- 双面perf板

- (2)瓶盖

- Wood glue

- 磨砂窗膜

- (2)10KOHM电阻器

- (2) 200 Ohm Resistors

- Old USB cable (USB A connector on one end, doesn't matter on the other end)

- Scrap wire

- 废纸板

- 钢锯

- Hot glue gun

- 烙铁

- Solder

- Arduino Uno (to program the ATtiny)

Step 2: Design

设计盒子:

我用inkscape以及制造商案例设计盒子。走路符号是一个简单的迹象,来自“行人人行横道”标志的图像,箭头是一个简单的草图。我带着一个小小的4“x 3”x 2“盒子,不会占用多少桌面空间,但会使在电子安装中易于工作等等。我从我当地的家庭购物中心的0.200”厚厚的胶合板一起工作。我选择了这一点,因为他们有一些漂亮的饰面,因为它足以切割激光切割机。

削减盒子:

我属于我当地的Fablab并喜欢它。他们在那里有一个epilog激光切割机,可以快速地工作胶合板。如果要将我的设计剪切或将其编辑到您的应用程序,则在此处上传SVG和PDF文件。

第3步:设计电路

这里的想法是保持超级简单。我将触及以下几个亮点。

微控制器(MCU):I went with an ATtiny 45. This is a small (size of your fingernail) 8 pin DIP package microcontroller with 4kb of flash, up to 5 digital I/Os and up to 3 analog inputs. If you are familiar with the ATtiny 85 it is the roughly the same thing, just half the flash. It is programmable via the Arduino IDE so it is super simple to understand.

LEDs:These hook up to pins 6 & 7 (digital pins 1 & 2 respectively) via a current limiting resistor. I used 200 ohm resistors which are perfect for this LED and the application.

Buttons:Any normally open switch will work. I used simple breadboard compatible tactile switches for prototyping and panel mount switches for the finished product. These switches will be pulled high by our 10K resistors and when pressed will then be read as low by the microcontroller. One switch is connected to pin 1 which is the reset pin. When this is high the MCU keeps on chugging along. When low the MCU resets and the programs starts over. The other switch is connected to pin 2 (digital pin 3). We will touch on that in the coding section.

Power:通过USB提供支持。所以V ++ = 5V和GND = 0V。

我始于将所有东西放在面包板上作为原型。在将任何焊料放置之前,最好地获得错误的错误。这只需要5分钟才能设置并准备好在上传代码后进行测试。

第4步:编写代码

这里的代码很简单。代码评论大量评论,应该是自我解释的,因为您读过它。基础是下面。

启动,来回闪光,以确认程序的开始(方便确认按下重置按钮实际上是它所在的内容)。

计时器[Millis()]开始以自上次重置以来计算毫秒。

First bit of code once we enter the loop. Check if the button is being pressed, if so set "mark" equal to current value of millis().

第二位评估它是否已经按下了“活动”按钮以来是否已超过一小时。如果已经超过一小时照亮“走路”光线。如果没有,请转/离开步行灯点亮。

Third bit evaluates to see if the "stand" light should be lit. It evaluates this by comparing the current value of millis() to a pre-defined schedule. The schedule essentially has you stand from hours 1-2, 4-5, 7-8, 10-11, 13-14 and 16-17.

结束循环,重新开始!

Step 5: Upload Sketch to ATtiny

好的,这是我乐意指向其他来源的地方。这真的很简单,但不保证我重复一切。在阅读Danasf的帖子之后,我第一次和神奇的系列搞砸了“使用1美元的认识来驱动可寻址的RGB LED”。它为您提供了一个非常好的指南,以便如何为此目的编制您的认识。它基于高/低科技完成的工作,其中他们使用您的Arduino来编制了主题。还有其他解决方案,但我最喜欢这个。

在高/低科技页面上查找更多:

http://highlowtech.org/?p=1695

http://highlowtech.org/?P=1706

在选择8 MHz内部时钟后,这里的大事在此处务必在选择8 MHz内部时钟后加载引导加载程序。如果燃烧熔丝错误,它就不工作。加载Bootloader后,您只需上传所提供的代码,然后您的主题被编程并准备好您的项目!继续前进以在面包板上测试它。

第6步:在面包板上测试你的认真

通过弹出,提供5V和GND并观看代码运行,在您的面包板上进行测试。对于这一步,我只是从插入Arduino Uno的别针中拉动我的5V和GND。您可以使用5V的任何电源。

在上图中,我刚用过任何LED最接近我(红色/绿色)而不是挖掘我的抽屉。

Step 7: Build the Box

Put the box together using very small amounts of wood glue.

The three "frame" looking pieces (larger rectangle with two smaller rectangles cut out) will be what we use to space out and hold our fogged window film which will act to diffuse the light and keep it from just looking like a simple LED shining in your face. Us the frames as templates and trace the window film, cut down the middle of the traces. Place on one frame, apply small amount of wood glue to the outside perimeter and place another frame on top. Do this one more time you have two layer of diffusion.

现在剪掉两片小窗膜,以覆盖行走的家伙和箭头。磁带到位,所以它坐满,从成品上的前面坐下来教授专业的外观。将框架组件粘贴在此顶部。你现在应该有三层扩散。

Take your two LEDs and sand the outside of them (unless already diffused). This will scratch up the surface and aid in diffusing the light. Leaving more of a glow than a focused point of light. Take your soldering iron and melt a hole in the center of your bottle caps, immediately shove your LEDs in and allow the plastic to cool and solidify, locking the LEDs in place.

Cut out a small piece of cardboard with the same dimensions as the frame assembly. Take your bottle caps, trace around them and then cut out slightly smaller holes in the cardboard. Hot glue the bottle caps to the cardboard. Use wood glue to glue the cardboard to the back of the frame. Now your LEDs will be isolated and only light up the icon they are behind!

为按钮的盒子侧面板钻孔(我建议面板安装开关)。安装按钮。

在后面板上钻一个洞,足以让您的USB电源线适合。

除了后面,胶合盒的所有两侧!尽可能少的胶水。如果你知道你在激光刀具周围的方式,你的盒子甚至应该在胶水之前紧紧地相当。

Step 8: Transfer From the Breadboard to the Perf Board

现在是时候从面包板上带到了PERP板时了。为您了解的最佳方式。每个人都拥有自己的首选布线板和他们自己的首选布线/焊接风格。做什么适合你。我不得不把我的perf board削减到大小。

从旧电缆上切掉非USB结尾,并将其通过后面板中的孔。剥离绝缘并分离V ++和GND线(通常分别是红色和黑色)。修剪数据线(通常是绿色和白色)。在电缆中绑一个结以应变浮雕。焊料电源导通面包板,下降在您的学生MCU和功能测试!

第9步:关闭它,一切都完成了!

如果您对激光切割的密切公差并适当地占Kerf,您的后面板应拧紧,无需胶水。如果不是,可能需要粘在后面的面板上。只是确保首先测试一切!插入任何USB电源。矿井插入Monitor的USB集线器/港口,它可以坐在下面!

一旦完成这个小盒子很好地坐在我的德sk and lets me know when I need to get off my butt! It works great. Hopefully it will help me even more with blood sugar control, back pain and overall health.

几个笔记:

ATtiny - Although this think is using an internal oscillator and no tight timing control I have found it to be within 30 seconds at the one hour mark. Since this gets reset every day that is a margin of error that is very easy to live with. Using any type of additional timing control (external oscillator, RTC module, etc) would quickly add complexity and cost, no thanks.

你会看到我的桌子真的没有模块化的坐/立场。那是因为下周交付了!

If you like this project please vote for me in the Microcontroller contest. Just click that orange Vote button toward the upper right!

微控制器竞赛2017年

亚军
微控制器竞赛2017年

Lights Contest 2017

参加了这一点
Lights Contest 2017

是第一个分享

    建议书

    • Toys & Games Contest

      Toys & Games Contest
    • Big vs Small Challenge

      Big vs Small Challenge
    • Fix It Challenge

      Fix It Challenge

    5点评论

    0.

    哇,多么巧合。就在前几天,我的妈妈在谈论她是如何需要其中一个。我可能只为她制作一个!

    0.
    下雨

    4 years ago

    我制作一个贪睡的按钮,然后重新击中它!

    0.
    yonatan24

    4 years ago

    凉爽的!除了我会做一个,它需要一个泰瑟。我会学会快速忽略它......;)

    0.
    nqtronix.

    回复4 years ago

    哈哈哈,是的,确实:D

    真的很整洁!我一直希望有类似的东西(口袋大小)以获得不同的时序目的,因此我可能会从您的电路开始。我喜欢这个盒子和窗户的灯光:-)