Beginner Question - Page 1
Forum section: electronics / beginners

author: kyleighterry
author_rank: Newbie
timestamp: September 20, 2024, 04:27:35 am
content: So this may be a silly simple question, but I’m new to the nitty gritty of electronics and would appreciate if someone pointed me in the right direction to get this project going.I’m looking to make a little art project in a picture frame. In the picture frame I want to attach a light action figure. I want to rig it to where when I press a button, a preprogrammed noise goes off and the toy moves up and down.Any help, suggestions, name of the electronics that will be needed to make this happen would be much appreciated!

author: Bryn
author_rank: Regular Contributor
timestamp: September 20, 2024, 06:34:41 am
content: For that, you will need the following:A microcontroller (such as a Raspberry Pi), which would serve as the "brain" of your project and can be programmed for the basic things you want for itA servo motor, where it is needed should you want the figure to move up and down especially if you want it move in these directions smoothly (and not slightly deviate from its path)A sound module, like the DFPlayer Mini, and can easily be interfaced with the microcontroller and also play audio files stored in a microSD card (so you'll need that also if you don't have one handy)Everything else such as a power supply, wired, breadboard and a simple push button for the magic to work once everything is assembled with these and other things aboveBy these, you should be able to start building your art project as long as you know what part connects with what, and also some programming skills for everything to work the way you want it to be.

author: brucehoult
author_rank: Super Contributor
timestamp: September 20, 2024, 10:23:01 am
content: Point of order! A Raspberry Pi isn't a microcontroller -- except the Pico, which would be at the same time good enough for this task, and also overkill.Depending on how hifi / long the sound is a $0.10 8 pin CH32V003 could be enough for this project. You can program it "bare metal" or there is an Arduino library implementation for it.- two pins for power and GND- a pin for the button- a pin for a PWM signal to a cheap (e.g. 5g) R/C servo (https://aliexpress.us/item/1005007335327107.htmlor many others)- a pin for the audio outThere are still 3 pins to spare!The limiting factor of the CH32V003 would be the 16k of flash, which might not be big enough to store the sound you want to play as well as the (very small!) program code.Here are some things people have done with that chip:Spending $2 or $3 or $4 on a higher end chip with more speed and RAM and flash might make things easier, but that's half the fun, right?Here's me getting digital audio out of 1 GPIO pin on a microcontroller back in early 2017. That one is running at 256 MHz and has a whopping 16 KB of RAM (vs 2 KB in the CH32V003, and 48 MHz) and a 16 MB external SPI flash which I used maybe half of for the rather long song.

author: EEVblog
author_rank: Unknown
timestamp: September 24, 2024, 06:30:30 am
content: Quote from: Bryn on September 20, 2024, 06:34:41 amWay too complicated.This could be hacked together with a simple hobby servo motor and armature system that moves the figure up and down.https://www.ebay.com.au/itm/355408250389Just connect a latching button to the motor.Then all you have to do is wire an SD card message playback generator in parallel to the motor. e.g.:https://www.ebay.com.au/itm/313451481615So it plays whatveer message you want when you press the button.No need for any programming here.

author: ledtester
author_rank: Super Contributor
timestamp: September 24, 2024, 08:55:44 am
content: Quote from: EEVblog on September 24, 2024, 06:30:30 amI think you still need some sort of controller to send a signal to the servo.You could pair up acontinuous rotationservo with a simple servo tester like one of these to avoid programming:https://www.amazon.com/HiLetgo-Consistency-Controller-Adjustment-Helicopter/dp/B07TQSKLBK/Update: Or are you suggesting opening up the servo and modifying it so that the motor always runs? I suppose that could work too. Relevant video:Converting Servo to Regular DC motor -- miliohmhttps://youtu.be/cxLo8qDG1Kg

author: EEVblog
author_rank: Unknown
timestamp: September 24, 2024, 10:36:14 am
content: Quote from: ledtester on September 24, 2024, 08:55:44 amYes, that's what I meant.Or a DC motor with inbuilt gear reduction, e.g.https://www.digikey.com.au/en/products/detail/seeed-technology-co.,-ltd/114090050/10385087

author: brucehoult
author_rank: Super Contributor
timestamp: September 24, 2024, 11:05:48 am
content: Quote from: EEVblog on September 24, 2024, 06:30:30 amNot sure what's supposed to be so hard about programming -- it's a lot easier than analogue electronics or making mechanical things. Something low performance like this is dead easy to do using e.g. Arduino libraries.

author: EEVblog
author_rank: Unknown
timestamp: September 24, 2024, 11:38:03 am
content: Quote from: brucehoult on September 24, 2024, 11:05:48 am"Beginner"No need for any "analog electronics" here. Just connect things up.As for mechnical, that's a given, you have to contruct some sort of mech interface to make the figure move up and down.

author: ledtester
author_rank: Super Contributor
timestamp: September 24, 2024, 04:08:54 pm
content: Quote from: brucehoult on September 24, 2024, 11:05:48 amIn fact, just google "code to sweep a servo" - it's an Arduino library example.

author: RJSV
author_rank: Super Contributor
timestamp: September 24, 2024, 05:22:53 pm
content: I have many of the skills mentioned so far here, including a couple years on bench technician repairing dense system pc boards. Might be satisfying to do a less complicated build, that does the sound and LED driving you need:Try purchase a couple of 'drug store' greeting cards (Happy Birthday, etc.), that has sound / lights & also maybe a moving portion (like a paper 'hand' waving.Similarly, I've purchased inexpensive toys that have interesting features; A little battery powered 'bird', that chirps and sings, triggered off of a light sensitive part (Cds photo resistor).With that 'bird', you can experiment with the photo sensor, for perhaps a hand wave in front of your frame....maybe the robot bird sitting on a piece of little tree branch, there in the frame.And even that frame could be done by converting some (cheap) picture frame, maybe obtained from a 'crafts store'.Battery operated things like this are fairly safe, for a beginner, and can be modified in experimental ways:Try, place a small speaker in series with an output originally intended to drive a small d.c. motor. Just for your curiosity, but many times a motor driver circuit has tone sounds and click noises (from circuitry originally for driving motor, or solenoid).You can also try out an LED in similar (experimental) but also place a resistor, around approx. 200 ohms, that will blink and flutter, according to the toy outputs intended for a motor.As to safety, those sorts of toys or electronics greeting cards often are seen to run on 3 battery cells...; like 3 AAA batteries, that sort of thing.I suppose you could label (my own) approach, to involve pre-built stuff, as 'gorrila technician', meaning use of ordinary parts, that had other intended uses.

author: RJSV
author_rank: Super Contributor
timestamp: September 24, 2024, 06:09:13 pm
content: Here, I've placed photo of a greeting card type circuit, that waves the tail of a dog, graphic on paper. The little pc board has the usual processor, (potted in black plastic), and in this case has 2 little solar cells, (no battery).So, when card is opened, the little paper 'tail' will oscillate, pendulum style, by way of a coil on the lower end, with fine wires to the circuit.Not exactly what you wanted, but an unusual circuit, that runs when in light, due to the solar cells.