abecedarian 330 Posted April 17, 2014 Share Posted April 17, 2014 Okay... yet another project from me. But this one is close to being real. Basically, it's a toothbrush timer for my nephew. The intent is that he can press a button when he's getting ready to brush his teeth, and the unit will do some LED dances that eventually turn into an LED blinking seconds, and 3 LED's light up based on how far along he is into the brushing ritual Blue LED is the 'second' indicator. Red LED indicates he's in the first minute of brushing. Yellow LED indicates he's in the second minute of brushing. Green LED indicates he's in the third, and final, minute of brushing. Once complete, the unit blinks LED's and such.... *edit- maybe not so close to complete now that other things are being brought in. Quote Link to post Share on other sites
bluehash 1,581 Posted April 17, 2014 Share Posted April 17, 2014 How is it powered? Will an adafruit neopixel be a good idea for this project? For the dancing LEDs? or you can get a WS2812 and flash different colors with one LED unit. abecedarian 1 Quote Link to post Share on other sites
abecedarian 330 Posted April 17, 2014 Author Share Posted April 17, 2014 Haven't decided what to power it from yet but I do want the thing to be somewhat smallish. And I suppose an RGB LED of some sort would suffice. I'll have to buy some to try. Quote Link to post Share on other sites
gwdeveloper 275 Posted April 17, 2014 Share Posted April 17, 2014 Cool. Are you involving him in the project? Also, have you thought about adding a parental alert system? Something simple that sounds an alarm when, for example, said nephew is actually planking between the tub and sink with the toothbrush hanging idly from his mouth instead of brushing. Or maybe that's only my kid... abecedarian 1 Quote Link to post Share on other sites
bluehash 1,581 Posted April 17, 2014 Share Posted April 17, 2014 hehe... abecedarian 1 Quote Link to post Share on other sites
abecedarian 330 Posted April 17, 2014 Author Share Posted April 17, 2014 He's involved in as much as I've told him what I want to make and have asked him his opinion of it and various things I should do with it to help him use it properly and efficiently. I have an LP with G2452 doing the timing and light show and he seems to think it's pretty cool. I'm contemplating putting LED digits on it so it can display the time of day as well as switch to a countdown timer when he's brushing his teeth but that'll require a proper RTC instead of the rough countdown counter I'm using now- I mean, the rough counter might be incorrect by minutes over several hours but all I am doing requires simple ball-parking time so a few seconds over a few minutes is not worth quibbling over, although he might complain that 3 extra seconds of brushing is too much. Also, might have some sort of light detector that turns the display on / off based on the bathroom light status. I thought about a wireless indicator so my wife or I am aware of when he's brushing. I might do something where he pushes a button to start, then pushes a button when he's done and the start/stop times are logged for later review. That might be a decent purpose for the two spirilis' n4f24 boards and the Connected Tiva board- it could process and email the stats on his brushing. Might need an accelerometer on the toothbrush to detect he's actually using it properly. Quote Link to post Share on other sites
abecedarian 330 Posted April 17, 2014 Author Share Posted April 17, 2014 Now "feature creep" is slowing this down. Quote Link to post Share on other sites
abecedarian 330 Posted April 17, 2014 Author Share Posted April 17, 2014 In other news... this caused me to finally solder the LED's and resistors spririlis' nrf24 needs. I only have 2.5X reading glasses and a 30W RS soldering iron at my disposal; no tweezers. Sorry, no pictures- my camera is missing its battery charger, but the DVM says the LED's are in properly and I got the resistors in without bridging the pads. I used 0805 components and I suppose it could've gone worse. spirilis 1 Quote Link to post Share on other sites
spirilis 1,265 Posted April 17, 2014 Share Posted April 17, 2014 Good work, I just did a bunch of 0603 crap today and it wasn't until the 0.8mm pitch resistor arrays + 0.65mm pitch MSP430F5172 that I busted out the magnifier visor . I guess that is bragging though. SMD iz phun! Sent from my Galaxy Note II with Tapatalk 4 abecedarian 1 Quote Link to post Share on other sites
abecedarian 330 Posted April 18, 2014 Author Share Posted April 18, 2014 Well, code started out like the following... Energia based: /* Toothbrush minder. Performs a light show with 4 LED's when started then blinks an LED to represent 'seconds' passing with three other LED's to represent 'minutes' passing. The first LED is RED signifying brushing is in the first minute, followed by AMBER signifying the second minute, and concluding with GREEN, indicating the final minute is in play. When done, another light show happens. This code is made available into the public domain without any restrictions regarding attribution or such. It also carries no warranty with regards to fitness for purpose and use of this code is done so at the end user's risk. */ #define RED 11 #define GREEN 12 #define AMBER 13 #define BLUE 14 void setup() { pinMode(RED, OUTPUT); pinMode(AMBER, OUTPUT); pinMode(GREEN, OUTPUT); pinMode(BLUE, OUTPUT); } void loop() { randomLED(25); for (int i = 0; i <= 20; i++) { delay(250); cycleUp(i * 5); delay(250); cycleDown(i * 5); } for (int i = 0; i < 20; i++) { delay(100); allOn(); delay(100); allOff(); } for (int minute = 3; minute > 0; minute--) { for (int second = 60; second > 0; second--) { if (minute <= 3) digitalWrite(RED, HIGH); if (minute <= 2) digitalWrite(AMBER, HIGH); if (minute <= 1) digitalWrite(GREEN, HIGH); digitalWrite(BLUE, HIGH); delay(495); digitalWrite(BLUE, LOW); delay(495); } } randomLED(25); while (1) { }; } void cycleUp(int D) { digitalWrite(BLUE, HIGH); delay(D); digitalWrite(BLUE,LOW); digitalWrite(RED, HIGH); delay(D); digitalWrite(RED,LOW); digitalWrite(AMBER, HIGH); delay(D); digitalWrite(AMBER,LOW); digitalWrite(GREEN, HIGH); delay(D); digitalWrite(GREEN,LOW); } void cycleDown(int D) { digitalWrite(GREEN, HIGH); delay(D); digitalWrite(GREEN,LOW); digitalWrite(AMBER, HIGH); delay(D); digitalWrite(AMBER,LOW); digitalWrite(RED, HIGH); delay(D); digitalWrite(RED,LOW); digitalWrite(BLUE, HIGH); delay(D); digitalWrite(BLUE,LOW); } void allOn() { digitalWrite(RED, HIGH); digitalWrite(AMBER, HIGH); digitalWrite(GREEN, HIGH); digitalWrite(BLUE, HIGH); } void allOff() { digitalWrite(RED, LOW); digitalWrite(AMBER, LOW); digitalWrite(GREEN, LOW); digitalWrite(BLUE, LOW); } void randomLED(int D) { for (int i = 0; i <= 255 ; i++) { digitalWrite(random(11,15), HIGH); digitalWrite(random(11,15), LOW); delay(D); } allOff(); } Quote Link to post Share on other sites
abecedarian 330 Posted April 20, 2014 Author Share Posted April 20, 2014 Okay, simple question. Not considering the future LPM capabilities being developed for Energia, and that I'm not particularly concerned about LPM at the moment, what's a decent way to have the unit battery powered? My thought was that it should be possible to have a button press apply power to the MSP from batteries and the MSP would latch the power on, via a transistor and GPIO. Once the brushing cycle was complete, the MSP would turn the GPIO off and thus the transistor which would power the unit down. Suggestions about powering the unit, as in battery type and capacity and possible charging solutions, using lower clockrate than the default 16MHz and other suggestions are welcomed. Thanks, Kirk Quote Link to post Share on other sites
igor 163 Posted April 20, 2014 Share Posted April 20, 2014 I was sure there was a similar project discussed either here or on stellarisiti a while back, but I can't seem to find it. So at the risk of repeating myself, feature I have thought would be cool would be a hand-wash timer. Hand washing is one of the major factors in public health, but many people do not wash long enough (doctors are notorious for skimping on hand wash). While singing "Happy birthday" used to be advocated as a way to get people to wash long enough, turns out people can run through that too fast. Seems singing the ABCs twice(?) is supposed to be about right. For the toothbrush function - could it be switched on by picking up the brush or the toothpaste? If you have a mirror cabinet, removing a bit of mirror backing and putting the display behind the mirror might make it less obtrusive. (Though more involved.) Quote Link to post Share on other sites
bluehash 1,581 Posted April 20, 2014 Share Posted April 20, 2014 I was sure there was a similar project discussed either here or on stellarisiti a while back, but I can't seem to find it. So at the risk of repeating myself, feature I have thought would be cool would be a hand-wash timer. Hand washing is one of the major factors in public health, but many people do not wash long enough (doctors are notorious for skimping on hand wash). While singing "Happy birthday" used to be advocated as a way to get people to wash long enough, turns out people can run through that too fast. Seems singing the ABCs twice(?) is supposed to be about right. For the toothbrush function - could it be switched on by picking up the brush or the toothpaste? If you have a mirror cabinet, removing a bit of mirror backing and putting the display behind the mirror might make it less obtrusive. (Though more involved.) @@igor This one? http://forum.43oh.com/topic/4005-led-matrix-timer-display-brush-your-teeth-for-two-minutes-kids/ igor 1 Quote Link to post Share on other sites
abecedarian 330 Posted April 20, 2014 Author Share Posted April 20, 2014 @@bluehash I think that was the one. I even commented in it about an accelerometer in the brush. But that one was using a matrix display and I'm looking at doing something a little different. I think I'm going to do two columns with 7 LED's where one LED on each column is a 'carry' so that the LED's do 1-6, and light the 7'th to indicate 7-12. That's not too far divorced from the analog 1-12 concept on typical clocks. And we think it'll give him some idea and pause for thought about alternative number systems while hopefully avoiding cavities on his adult teeth. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.