Pimp My Handbag? - Page 1
Forum section: electronics / projects

author: yorkshire_drew
author_rank: Newbie
timestamp: February 04, 2018, 11:20:56 am
content: Hey folks, it's my girlfriend's birthday in a couple of weeks and I've found this awesome robot handbag that she's previously seen and loved. However, I feel like this bag needs a little "upgrading" and am looking for some suggestions for this little project. The bag structure is a pretty solid box, with the feet and arms being additional boxes glued on to the body that are partitioned off, so I feel like it's a prime opportunity to get some electronics in there. I think it'd be pretty easy to put some small switches or knobs on the backs of the arms, and it would be fairly easy to replace the eyes with LEDs, and there's plenty of room in the feet for a battery or two with space to space.My initial thought was to replace the eyes with LEDs, have a power switch and a knob to control flashing of the eyes (using a 555). But I feel like I'm not being imaginative enough and am fishing for ideas. Are there any kids' toys that have interesting electronics that I could poach and install in this bag? Something with lights and sound?I don't want the electronics running permanently, so want something that is powered with a switch and only draws power when turned on (so the battery/ies last and so it doesn't accidentally go off in the cinema or something). And I'd like it to work immediately on being turned on, so I think I'm ruling out anything programmable like a Pi or Arduino, since their boot times are far from instant.I've attached a straight-on front picture with this post (showing rough dimensions), but I've put up a load more athttps://imgur.com/a/ePomBAnyway, give me a shout if you've got any ideas!

author: mrflibble
author_rank: Super Contributor
timestamp: February 04, 2018, 12:11:48 pm
content: Quote from: yorkshire_drew on February 04, 2018, 11:20:56 amAgreed. Can't possibly go wrong with some glowing red eyes.In the led theme you could use a few RGB leds, use microcontroller with temp sensor, have the color indicate ambient temperature. Use an accelerometer, and when a fast circular motion is detected have the bag go"weeeeeeey!!!". When the bag detects it just has been unceremoniously dumped to the floor it could utter"Oi!". Or you could have it go full Marvin the Paranoid Android. When your geotagged-by-mobile-phone-proxy girlfriend gets too far away from the bag, have it go"Don't leave meeee! *pout* Everybody leaves me."in full Marvin melancholy drama style. (but maybe best not)

author: Rerouter
author_rank: Super Contributor
timestamp: February 04, 2018, 12:15:58 pm
content: how can you mess with perfectionmaybe a little mp3 chip and make one of the ears a button"Terminate!" for fun :p"Your male companion offered you his cardiovascular muscle, wont he need that?""I cannot dream of electric sheep, Nintendo copyrighted those"Or just dump a number of glados from portal quotes in, makes the sample pool much larger, maybe leave out the ones about being fat :p

author: cowana
author_rank: Frequent Contributor
timestamp: February 04, 2018, 12:18:58 pm
content: Quote from: yorkshire_drew on February 04, 2018, 11:20:56 amThat's true about the Pi, but an arduino's boot time is <0.1s, so should be fine for anything programmable that needs doing.The mouth looks like it would work well replaced by a line of tiny LEDs - that could either scroll side to side (knightrider style), or interface with an accelerometer to act as a digital 'spirit level', indicating if the bag is leaning to one side?

author: chris_leyson
author_rank: Super Contributor
timestamp: February 04, 2018, 12:31:14 pm
content: You could "bling" it up with lots of small white LEDs. Use a 3 axis accelerometer to detect movement and change the LED pattern as the bag moves, you could get a cool twinkle or sparkle effect that way. Not sure of the best way of driving the LEDs and the twinkle algorithm would be kind of interesting.

author: frozenfrogz
author_rank: Frequent Contributor
timestamp: February 04, 2018, 01:19:22 pm
content: Incorporate a persistence of vision display, so she can fling out messages by swinging the bag on the carrying strap!

author: mrflibble
author_rank: Super Contributor
timestamp: February 04, 2018, 01:48:48 pm
content: Quote from: frozenfrogz on February 04, 2018, 01:19:22 pmBest plan yet!

author: frozenfrogz
author_rank: Frequent Contributor
timestamp: February 04, 2018, 02:12:07 pm
content: Quote from: mrflibble on February 04, 2018, 01:48:48 pmTHXAlso: Good quality LED lighting of the interior is mandatory I think. The light should be switched by opening/closing the bag and have a nice fade to full brightness instead of bulky on/off action.Let me know if you need a simple Arduino sketch for fading PWM driven LEDs.

author: kalel
author_rank: Frequent Contributor
timestamp: February 04, 2018, 02:30:07 pm
content: It should also be considered how many LED/s need to be powered and controlled, to see if some kind of multiplexing is needed and what the smallest/simplest solution is for that so it can be integrated.Arduino should definitely be capable enough to do the job.

author: yorkshire_drew
author_rank: Newbie
timestamp: February 08, 2018, 05:16:19 pm
content: Thank you all for the great ideas. Time to actually sit down and get this thing planned out. If it works out, I'll post photos/videos. If not, you'll never hear from me again!

author: yorkshire_drew
author_rank: Newbie
timestamp: February 08, 2018, 05:25:04 pm
content: Quote from: cowana on February 04, 2018, 12:18:58 pmI've never used an Arduino, but had a Google before posting to see if it was an option or not. Good job you corrected me, since that opens up loads of possibilities!

author: yorkshire_drew
author_rank: Newbie
timestamp: February 08, 2018, 08:26:03 pm
content: Quote from: frozenfrogz on February 04, 2018, 02:12:07 pmYeah, if you've got one you're willing to share, please do! There looks like there's vast amounts of Arduino stuff online, but having a sketch to start from sounds like a huge benefit!

author: frozenfrogz
author_rank: Frequent Contributor
timestamp: February 09, 2018, 12:37:29 am
content: Here is a simple sketch that controls a PWM output pin via a push button. The button cycles through four brightness levels, but if you want simple on/off functionality you can just get rid of the switch cases and only use the tiny fade subroutine. It is nothing fancy and there are much more elegant ways to do this, but should be easy to understand what is going on for startersYou can power small LEDs directly from PWM pins but this should be strictly limited to 10-20mA - more current and you risk blowing that pin on the mcu.For switching larger loads you need to use a bipolar junction transistor or MOSFET and a current limiting resistor connecting the PWM pin to the base of the BJT / gate of the MOSFET.Code:/*Multi-press button sketch to PWM drive a MOSFET for constant voltage LED strip dimmingby: Frederik Brücknerdate: 2018-12-22license: MIT License - Feel free to use this code for any purpose.No restrictions. Just keep this license if you go on to use this code in your future endeavors! Reuse and share.Recommended MOSFET: IRL540*/volatile int count = 0;// Count button presses, initialize to zerovolatile int currentBrightness = 0;// Keep track of last brightness level, initialize to zerovolatile int setLevel = 0;// Set new target brightness, initialize to zeroconst int BUTTON = 2;// Input button on pin 2const int PWM = 5;// PWM pin to drive MOSFET on pin 5const int full = 255;// Configure brightness levelsconst int mid = 80;const int low = 10;const int fadeSpeed = 5;// Fade delay between brightness levelsvolatile boolean state = false;// Should the MOSFET be powered?unsigned long time;// Keep track of loop timeunsigned long lastFade;// Keep track of fading timevoid setup() {pinMode(BUTTON, INPUT_PULLUP);// Enable "button" as input pin, internal pull uppinMode(PWM, OUTPUT);// Enable "PWM" as output pinattachInterrupt(digitalPinToInterrupt(BUTTON), buttonPressed, FALLING);// Call interrupt routine on falling edgelastFade = 0;// Initialize to zeroanalogWrite(PWM, setLevel);// Set PWM output to zero} //end setupvoid loop() {time = millis();// Loop timekeepingswitch (count) {// Finite state machine to set brightness target levelscase 0:// OffsetLevel = 0;break;case 1:// Low onsetLevel = low;break;case 2:// Medium onsetLevel = mid;break;case 3:// Full onsetLevel = full;break;}fade(setLevel, time);} // end loopvoid buttonPressed() {static unsigned long lastInterrupt = 0;// Time since last interrupt occurredunsigned long interruptTime = millis();// Time when interrupt occurred// If interrupts come faster than 200ms, assume it's a bounce and ignoreif (interruptTime - lastInterrupt > 200) {// Count three button presses and roll overif (count >= 0 && count <3) {lastInterrupt = interruptTime;// Reset debounce timercount++;}else if (count == 3) {// If count exceeds 3, roll over to zerolastInterrupt = interruptTime;// Reset debounce timercount = 0;}}} // end buttonPressedvoid fade(int Target, unsigned long thisTime) {// Fade currentLevel to new valueif (thisTime - lastFade >= fadeSpeed) {if (currentBrightness + 1 <= Target) {currentBrightness += 1;// Increment currentBrightness}else if (currentBrightness > Target) {currentBrightness -= 1;// Decrement currentBrightness}analogWrite(PWM, currentBrightness);// Set new brightness levellastFade = thisTime;// Reset fade delay}} // end fade