Using a Piezo to trigger lights?

Hey all. What I am trying to construct is some kind of circuit that will trigger an LED when a piezo is tapped. The reason I would like to create this apparatus is to trigger lights using acoustic drums for my band's live show. I would like a light to go off every time a drum is hit and I figured that using a piezo would be the best way to do this. Any help that anyone could offer in this would be greatly appreciated. Thanks again. P.S. I found this diagram for a piezo switch but I am unsure as how i could use this or even how to make it in the first place. I am very new to electronics.

Topic by cimz 

What is piezo?

I want to build my own drum kit,and I need a piezo.Do someone know what is this?

Question by cyan_shadow   |  last reply

can i plug drum trigger pads directly into an audio interface and translate those signal to midi internally? Answered

Instead of buying a trigger to midi converter?   i can translate most signals (like that of a piezo mic) into a midi signal within ableton live, but im just not sure itll work with drum pads.

Question by flosin   |  last reply

Piezo Triggered LED lighting with a twist!

Hi There are already a few threads and topics on this site explaining how to hook up a piezo triggered light strip, however I'm looking to build a custom drum kit with particular lighting system and i can't find the info I need to build it. Inside the drums I want a constant, static colour of my choice on the led strip (e.g. blue) and then the piezo trigger triggers that LED strip to to different colour (e.g. red) for a quick flash and then back to blue. I would also like to have control over which colour combinations I use, so if i want yellow drums with green flashes, i would hopefully be able change that with a remote. Is there a circuit or a mod of an existing circuit that will handle my needs? Cheers, Owen

Topic by oesheppard   |  last reply

Piezo trigger Switch for a Virtual DrumKit

Can anyone help me to make a piezo trigger switch to use with a keybaord to trigger the samples from my pc? I got the idea from here (see step 6) Thanks.

Topic by joeyjerry 

Piezo trigger Switch for a Virtual DrumKit

Can anyone help me to make a piezo trigger switch to use with a keybaord to trigger the samples from my pc? I got the idea from here (see step 6) Thanks.

Topic by joeyjerry   |  last reply

Piezo trigger Switch for a Virtual DrumKit

Can anyone help me to make a piezo trigger switch to use with a keybaord to trigger the samples from my pc? I got the idea from here (see step 6) Thanks.

Topic by joeyjerry   |  last reply

How to make a piezo sensor gradually light up an LED strip by tapping on the sensor repeatedly?

Hi there, I want to be able to gradually light up an LED strip by tapping on a piezo sensor trigger drum repeatedly. The aim is to have 2 separate LED strips, and a sensor for each, as it will be a game to see who can light their LED strip the whole way up the first. I have a 1m WS2812B 60 LED RGB LED Strip and a piezo sensor trigger drum. Thank you in advanced.

Question by ejbarr77   |  last reply

Does anyone know how to make piezo triggered Kick drum light?

Does anyone know how to make piezo triggered Kick drum light? One that lights up the inside of the drum when hit? I want to make one for my drummer. I plan to use the flexible strings of LEDs I've seen available to line the inside of the front kick drum head. Then some how wire up a piezo (either mounted in the shell or on the drum head itself) trigger so it flashes when he uses the kick pedal. There are some vents to feed wires through so if an exterior power source is necessary, thats not a problem. I know it will need power of some sort ha, but batteries are preferable. If anyone could help me with a circuit and/or a list of components that would be great! Thanks in advance!

Question by jetbones   |  last reply

Piezo triggered LED Strip with multiple static and flashing colour? Answered

Hi There are already a few threads and topics on this site explaining how to hook up a piezo triggered light strip, however I'm looking to build a custom drum kit with particular lighting system and i can't find the info I need to build it.  Inside the drums I want a constant, static colour of my choice on the led strip (e.g. blue) and then the piezo trigger triggers that LED strip to to different colour (e.g. red) for a quick flash and then back to blue. I would also like to have control over which colour combinations I use, so if i want yellow drums with green flashes, i would hopefully be able change that with a remote.  Is there a circuit or a mod of an existing circuit that will handle my needs?  Cheers,  Owen

Question by oesheppard   |  last reply

Piezo triggered power socket for rope lights or led strip?

I'm an electronics beginner. I generally know what components I need for my ideas, but I don't know what specs or how to put them together. I would like to create a socket similar to the one pictured that is triggered by a kick drum, so that I can have rope lights strung around the drum riser flash whenever the drum is hit. I know I will need a piezo element and a transistor/relay. I have read that transistors are more instantaneous. Is this feasible, or would it be more practical to use an led strip? A list of components and advise on how to put it together or links to tutorials would be greatly appreciated.

Question by pacello   |  last reply

How to make piezo trigger lights?

Hi, I wanted to make a piezo trigger that everytime it hits, it lights up a 2 meters led strip. I found a schematic, but have no idea how to read it. What would I need to get it to light up a 2 meters led strip, running on batteries. I also want it so everytime the piezo is hit, the light flashes a different color. thanks.

Question by lyoth   |  last reply

Arduino drum kit combined with piezo triggered led lights?

Being a broke person combined with massive curiousity, i've started taking interest in diy electronics. What i've been wanting to make is actually a drumset with tons of pads and cymbals and is not only a midi, but has its own sound. But, while there are many tutorials about it, there aren't any that match exactly what i wanna make. (I'm not even sure how many midi inputs can be made using an arduino) Sooo, being a newbie who's 100% confident she won't be able to make something as advanced as that without clear instructions (yet), i wanna start off by making a drum pad like yamaha dtx multi 12. I should be able to make something like that since i wouldn't have to worry about something like hihat controller. And i thought it would be awesome if i can attach led triggered lights! But i have zero idea what i have to do :/ which arduino do i use? Where do i wire them to? There's an instructable here about it but his drum is an acoustic drum so he's using the piezo entirely for led. I want my piezo to act both as midi trigger and led trigger. Anybody got an idea? Actually, i want to make 2 LEDs for each pads. The first LED lights up only when hit, the second one will continue to light but change colour when the kick pad is hit. But i'm not sure if this is doable

Question by Stelladevania 

Are there any alternatives to piezo transducers when building an electronic drum?? Answered

I'm trying to build an electronic drum, but piezo transducers seem to be rare in my country !!!! so I'm wondering if there's an alternative to them.

Question by M.Medhat   |  last reply

MIDI Drum set using keyboard?

Im wondering if I could make some piezo drum triggers, run them through and Arduino or other device, and then send MIDI signals from the Arduino to a Casio keyboard I have.  The keyboard would play the drum sounds.  So basically the triggers send a signal to the arduino and the arduino sends a signal to the keyboard.  Is this possible?

Question by crocboy   |  last reply

How to properly setup an undefined numbers of piezos for drumming ?

Hello everybody ! I'm currently into a really cool project which gives me quite hard times. To begin, I'm a big noob in electronics, but I'm decent in programming. So i'm able to understand, learn or correct myself easily when it's about code, but I'm really in the dark for everything concerning electronics despite the fact that I read so much about it recently... My projet ------------ My goal is to make my own MIDI drum kit. Not a new idea, but the difference is that I want to use lot of pads. I bought some WII, XBOX and PS drum kits that I disassembled to get just de pads. Then I bought an Arduino Uno, not a mega because I'm a beginner and I can totally start with a small amount of pads, also I wanted the perfect solution in terms of compatibility etc. STEP ONE : 1 pad -------------------- So, I first made a prototype with 1 pad, which was very easy to do, since there is billion of officials and unofficials tutorials about how to connect a piezo to the Arduino. So basically, on my breadboard its like that (except im on A0 not A2) : So I connected my pad to the Arduino with a 1 Mohm resistor in parallel and I made a program which function very very well. You can read it the : The only challenge here was to set proper threshold and delay so the signal is clean when I hit the pad with a drumstick, to integrate the MIDI library and finally to find a software that makes the informations i send available in any of my favourites music softwares (Ableton Live, Maschine, ...), this software is Hairless Serial to MIDI, btw. STEP TWO : X pads --------------------------- It's when I'm getting troubles. At first I believed that all I needed to do was to reproduce the same schematic but "duplicate it" x times. So I tried with 4 pads. I used the same strategy on my breadboard : each pad is connected in parallel with a 1 M ohm resistor, but all are connected to ground. You can see it there : The code, take the old one, but just loop on the 4 pins : So here are the 2 issues : - The pad on the left is OK, like with my 1st program, the second one is still ok, the third one I have to hit a bit hard, the fourth one I have to hit VERY hard. - When I hit a pad, it seems it send electricity in others pins, I say that because when i connect the Arduino to a music software, hiting a pad = having multiples notes at the same time. For the hitting force issue, I'vre tried to play with resistances, puting higher or lower values and I got totally lost with that : nothing seemed to be better. About that "leaking" issue, I thought it could be useful to put some diodes, as i heard diodes are usefull when you want to make the current going in one way only, but when i watch some others schematics, i see no diodes and only 1 Mohms resistors everywhere, so I really don't know what is wrong and what to do. Here is the MIDI xylophone someone made and posted on instructables : I have no idea why this is working and why there is ground directly linked to these analog pins, and many other things i cannot understand. Any help would be really appreciated ! :)

Question by AnthonyJ7   |  last reply

Would arduino be good for a piezo triggering a servo motor?

I want to create a project that uses Piezo's to trigger the position of a Servo motor, would Arduino be a good controller for this? I have an idea for a musical instrument but i'm a bit of a beginner when it comes to electronics etc. Cheers!

Question by offtandiscord   |  last reply

How to interface piezo electronic drum to the computer without using drum module?

I used arduino uno to make edrum using piezo plates. Also, hireless serial to midi converter to convert arduino signals. With that, i installed loopbe1 internal midi port. I used addictive edrum kit along with the reaper by using loopbe output as input to the reaper. But still i didnt get any sound, whether i missed anything?

Question by Hemnath mohan   |  last reply

Outdoor electronic log drums.

We would like to make some outdoor drums made from logs that when hit trigger a relay which turns on a light. It it is proving to be very tricky to get a reliable system. We have tried using microphones with a small circuit to detect when triggered, these have worked the best but we get many false triggers and other times not triggering at all, we have tried adding pre amps to these microphones to try to boost the signal.  We have also tried to use capacitive touch sensors on top of the logs but again, many false triggers. The set up is installed outdoors for over a month and can sometimes be made to work but then the temperature and humidity will change and this causes them to false trigger or to not trigger at all, we are currently toying with the idea of hall effect or reed sensors, many of set into each log with a neodymium magnet in the end of the drum stick. If anybody has any ideas of how we can make a reliable system for installation outdoors that works through all the temperature and humidity changes please let me know. 

Question by mrhoopdogg   |  last reply

DIY MIDI converter for drum signals?

Hello, I am trying to build a Electric drum set, I have an acoustic kit right now, And piezo buzzers. I would like to know how to convert the voltage coming out of the piezos to a MIDI signal, To run into a synth with drum sets on board. Is there any DIY way or cheap little box to convert it to any selected channel? So, if you have any experience or knowledge on this subject? If so please answer!! Thank you!!!            

Question by ski4jesus   |  last reply

How do I use drum triggers on my computer without a drum module and how would I set them up?

I've been pretty focused on finding information on how to do this, but it's hard to come by. I don't feel like buying an expensive drum module but I still want to use drum triggers on my computer. I'm not sure how to connect the triggers to my computer in a way that they would function, and I'm having a hard time finding a program that would let me produce drum sounds or other samples in real time.

Question by goatambush   |  last reply

can anyone know the way to make an electric piezzo drum set using game pad ? -gaurav solanki

I have made the piezzo drum triggers .but the problem now is that how to connectit to the computer.i want to use it with fruty loops.. and don't want to use the drum module...?

Question by gauravsolanki   |  last reply

Light Up Snare

Would it be possible to assemble a circuit using a piezo sensor and a string of LEDs so that a snare lights up when hit? My knowledge of stuff like this is extremely limited (read: non-existent) so any help would be appreciated! Also, if my idea is useless, it'd be great if other ways of doing this were discussed. Thanks!

Topic by clairey   |  last reply

Detecting Very Slight Tendon Movements In Wrist

I've always had an intense fascination for lucid dreaming. Finding ways to communicate or control outside devices based off the slight body movements that are possible despite the natural paralysis during sleep is a topic of great interest to me. I have several LDs (lucid dreams) each night and through much experimentation have found that with a bit of concentration, I could move my fingers enough to trigger very sensitive buttons (if placed perfectly before falling asleep) or to grip myself (if my hand is placed say, near my neck before intentionally entering a dream from waking) such that the sensation of my fingers reaching my neck would wake me. These experiments were proof enough that if I perhaps had some sort of glove or wrist mounted piezo sensors that are able to detect the individual tendon/finger movements with high enough sensitivity, combined with software that can parse patterns and reliably filter out minor unintentional simultaneous movements for the fingers that are prone to movement when others nearby are moved, it would be possible to establish one way communication with outside devices, the Internet, etc. Input could be in the form of different patterns or even text (tap code, morse code, or through a hybrid allowing use of each digit of the hands) or musical notes (each finger representing a note of a scale with a finger or two used to change octave or to toggle sustain.) As a musician who "writes" his best music within his dreams, this could be quite handy for getting melodies down before they vanish from memory on waking. For example, to activate input, you could perform a simple pattern that is unlikely to be triggered unintentionally. It could be as easy as left thumb flex, right thumb flex repeated in that order several times. From this point, you could use another pattern to choose to trigger an alarm (sound, vibration or electrical shock), or to initiate musical or text recording. There are many different uses that could be explored, and it might even be possible that 2 way communication could be established if a reliable method of transmitting to the dreamer without waking them could be created. This is however beyond the scope of my intentions. I have suffered from sleep paralysis on a nightly basis for over a decade now which can be extremely frightening and last up to several minutes, and during this time I am able to move my fingers as well as shake my head back and forth (which I need to do to break out otherwise the paralysis will persist until I'm pulled into a nightmare.) My solution to these terrifying experiences was wearing a heart rate monitor with an alarm that goes off past a certain BPM, which only happens when I am frightened. Now that I am so used to these experiences, my heart rate does not increase enough that I can reliably use it as a trigger without also waking myself out of exciting dreams that I'd rather not have prematurely terminated. I am fairly confident that a device such as this could help with breaking out of my paralysis at will and PERHAPS even be sold commercially to other sufferers of this condition, however niche the market. Giving me control over my sleep paralysis alone would be a highly satisfactory result with significant quality of life improvements and be worth the effort of building this. Waking up partners in bed with my head thrashing is less than ideal! As an avid software programmer, I do not think that the code involved would be terribly difficult. However, I have very little electrical knowledge and building this without existing plans would be tough and time consuming. It would be enough to have a pressure/flex voltage for each digit transmitted to a Raspberry Pi or via Bluetooth to a computer and the rest could be done through software. My questions are.. Does a commercial device exist that would be suitable for my purposes and not be terribly expensive? Perhaps a glove? Is a wrist strap with piezo sensors over each tendon that control the fingers a realistic possibility to achieve my goals? I do not need to know the position of the fingers or whether it is pushing against something. Just that movement is being attempted. Do existing plans exist to create a similar device? Thank you!

Question by Ril900   |  last reply

Circuit Bend a Yamaha DD-7 : How to trigger more samples than pads ?

Hi, I have a Yamaha DD-7 tabletop drumset. It has 4 pads & 51 sounds (samples). My goal is to hook up 7 or 8 external piezo triggers to trigger 7 or 8 different samples. I can easily see how to hook up 4 external triggers to the 4 existing pad input connections on the PC board, but how would one be able to trigger more sounds without switching them at the unit ?  Thanx.

Question by thfox7   |  last reply

Arduino Gas Sensors

We are making an arduino-based gas detector that uses a combination of LED lights and a beeping piezo element to alert users to different levels of carbon monoxide in the air. We are having some difficulty in coding to have all the elements work together properly. What are some examples of arduino coding that can have a gas sensor chip, LEDs, and a piezo working together with a set of triggers, like the different concentrations of gas?

Topic by hthnc-student   |  last reply

DIY Drum Pad that Controls MIDI Device (Korg nanopad)

Hi all, I'm working on a project which involves a pipe like structure with something like a DIY electronic drum pad on top. (like a stand alone drum) When the pad is hit it, triggers a key on a MIDI device such as the KORG nanopad under the actual drum itself. This nanopad acts as a remote control for tracks created using music software on my laptop. So when the pad is hit, it starts a track. Problem is, I have no idea how I will make the connection from the pad to the MIDI device. I was thinking about using a Peizo signal but am lost as to how to wire it up or if thats possible. If I use this instructable should I be able to simply solder the Peizo wires into the nano keypad relatively easily?  Long shot but if anyone has even the slightest idea what I'm getting at here, any help would be greatly appreciated. Thanks!

Topic by Bass Cadet 

How to put LED lights into a drum kit and on cymbal stands.

My boyfriend is wanting to put blue LEDS into his drums and under his cymbals. For right now I think he just wants them on steady. But eventually I'm thinking he'll want the ones inside his drums to come on when he hits the drum, so a way to trigger those to do that would also be good. Right now I was looking at the single light LEDs that they actually have to put on your car, these of course run off your car battery, so would also need a way to convert them to run on regular AC from house outlet. Any advice on this would be great. Any ideas and tips would be welcome. I'm a power novice so any detailed information ie(brands, stores, etc) would be welcome also. I'm so glad I found this forum. If anyone is interested you can find my guys band on MySpace, their name is Desidero. Thanks for any help in advance.

Topic by Swordman5000sWoman   |  last reply

Which Processor?

Hello everyone. I'm new here and I have a quick question about processors. I'm working on a project that requires a device to take inputs piezo buzzer elements and trigger an LED. The catch is I need a programmable chip so I can have pre-set outputs on the LEDs. I'd need something that can be rewritten (like an EEPROM) I've been thinking abuot using a PIC or a BASIC Stamp but I'd though I'd do a bit of research first.

Topic by mrpaps   |  last reply

Wooden Necktie, Build a Mongolian Yurt, Racing Mower

Wooden Necktie Build a Mongolian Yurt Racing Mower Portal Cake is a Lie Make Beer Guitar Tube Amp Double Helix Lantern Wood-Fired Hot Tub Steampunk Bonsai Lamp DIY Solar Setup Shopping Cart Bike Honey Bee Habitat Trigger Green Lights Fluorescent Floor Lamp Build a Cajon Drum

Topic by randofo 

How to tune a bell ?

I'm building a doorbell-operated carillon of bells, which will play the "Westminster Chimes" on a set of real brass bells (the sort with a wooden handle that you would normally shake). They will be hammered either by solenoid mechanisms, or by mechanical triggers, driven from a pinned rotating drum. My question is - Is it possible to change the pitch of a bell, either by removing metal, or adding metal (with a weld), without ruining the resonance or the tone of the bell ? - And upon what part of the bell would you perform this action ?

Question by and7barton   |  last reply

plzzzzzzzzzzzzzz(good builders)

Plzz any of you good builders i want a thompson smg without the drum clip i want the strait clip and removable if not oh well.And plzzzzz a p90 with removable clip not an rbg if not removable then dont attempt. so if you will accept this plz once you are done do the folowing:post a picture and if you could instructable or send intructions to metell me range type of ammo and plzzzzzz a videoand finally the guns must be true trigger. thanks!no need for p90

Topic by combatknex   |  last reply

Video Switcher Mod

Hello, I'm working on a light/video setup for my friends' band. One component is a video switcher I want to trigger by the snare drum; contact mic into one of these amplifiers into the select button on the switcher below. My question is about the easiest way to modify or replace the switch so that it operates on the signal from the amp instead of the mechanical pushbutton. I don't expect that to be simple... another option is to wire up a small motor that simply pushes the button from the outside. The other component of the project, anyway, involves more contact mics to amps to light organs, to visualize the drums. That part is a little less worrisome, although after investing in a lot of parts I made the mistake of seeing what the same money could've gotten me at guitar center... oh, man...This is my first post. Thanks a lot for any and all ideas!

Topic by cameraeyes 

What Code Should I Use to Create a Single Pulse Wave on my Arduino Uno? Answered

Hello,  I am in need of some code for my Arduino Uno. I searched around online for code that can perform pulse width modulation, but nothing I have found completely suits my needs. What kind of code should I use to generate a short blip of voltage which will quickly subside? More details, including what I am using the Arduino for, are shown below. Upon the press of a tact switch, I need the arduino to emit a single pulse wave with an extremely low pulse width. I am using this as a trigger for a DIY audio project. Specifically, I am using this to trigger an anaolg drum machine circuit I found online. After much experimentation, I have found that triggering the drum circuit with an ordinary square/pulse wave really results in two different sounds: one which is created when voltage is applied and one which is generated when it is taken away. The sound I need is the one created when voltage is taken away, therefore I need a very fast voltage spike which will quickly return to zero voltage. This way, the other unwanted sound is less apparent.  Most of that last paragraph was extra info, but I figured that I should supply all of the information I have. Any help will be greatly appreciated, as I am totally new to the Arduino and am not sure where to begin in terms of coding.  Thanks!

Question by rah187   |  last reply

Contest results!!!

Well, the results are in and im pretty happy with my decisons.I am kinda satisfied with how many entrees there were, but i was expectig more,soo on to the results, drum roll please............1ST place and the patch,spycam,and stickers goes to Wicky's gigantic crossbow!! for being so gigantic and haveing a true trigger, and getting a pretty damn good distance2nd place with a patch and stickers(yyaayayay) goes to Gamer 5's pump action with magazine gun for that pump action fun and a large magazine,plus it also has a uniqe desine.And third place with patches and stickers goes to all50's knex hybrid crossbowfor a rare knex crossbow,and it looks like a cool rifle.I didnt have any other honerable mentions, but all of you did good.

Topic by knex hater hater   |  last reply


I wanted to do a little thing on to see which gun is better AR4-v3 or the ZKAR? AR4-v3 advantages: The AR4 is a good gun, so I'll point out the advantages of it. This gun is jam free, has very good range (52 feet), has some good looks, easy to load, no cut parts, powerful, doesn't use that much pieces, nicely designed, good for sniping, comfortable, would be great for a war, and is very light to carry. AR4-v3 disadvantages: Every knex gun isn't perfect so I'll point out some disadvantages of this gun. The sights are not accurate and has a original trigger system. i couldn't think of any other disadvantages, point out any more out to me if you can. ZKAR v2 advantages: This gun is light to carry, has awesome range (40-50), good for a knex war, fast loading, accurate sights, powerful, uses few pieces, no cut parts, jam free, comfortable, good trigger system, and very well designed. ZKAR v2 disadvantages: of course again, not all knex guns are perfect not that new of a trigger design, and has cut parts. overall both guns are really good for the ar4 better for sniping, for the zkar better for closer range. The gun I would have for a war is *drum roll starts playing* the.........................ZKAR!!!!!!!!!!!!!!!!! congratulations that gun just won one million dollars (not really). also the reason why i chose this gun is because it holds more ammo than the ar4, this gun also has a nice design, very neat on how it works, and is one of the best guns for a war is what i think REMEMBER TO COMMENT, RATE, AND SUBSCRIBE

Topic by Raz1r Knex Bull3t   |  last reply

Hydrophobic music, dubstep windchimes, Smash Smash Revolution and etc @ Knox Makers Build Night w/ MaKey MaKey!

Wow, what a month at Knox Makers! We were absolutely invaded by MaKey MaKeys at our hackerspace all throughout January. To start us off, we released a freebie project a little early to help out members and guests get some ideas, to drum up local support for our events, and to offer a fun + easy starter project for the other spaces participating: Oversized Music Chest This ended up getting featured in Electronics! It leaves a lot of room to add extra components and tote the MaKey MaKey around, and we turned ours into a musical advertisement for our first Build Night, a mystery hack night about music. Mystery Hack Night: Music! What a blast! Talk about a weird time.. One family brought a theremin and a circuit bending kit for kids; another group brought an amp and speakers, a suitcase of effect pedals and circuit bent instruments, and a 4 channel mixer; we had a random component table for open hacking; an acoustic and broken ukulele was converted into an electronic instrument; we had painters painting music instrument for the MaKey MaKey with conductive paint; there was a table with our hydrophobic drum pad, bananas, an eggplant, flowers, and a grappling hook all controlling a set of browser based drums through the MaKey MaKey; we had members hooking up tactile buttons and levers to MaKey MaKeys; and we closed with the weirdest jam session this side of Alpha Centauri with all the things playing all the sounds at the same time. Mystery Hack Night: Video Game Controllers! This was a fun night, and we had a few new people show up. We tinkered with a platformer adventure game called Fancy Pants Adventure, where we assigned each person one button. At one point, the whole table was controlling the game's protagonist. Somehow, we made it pretty far into the game, considering. A few people commented that this type of exercise seemed like a really useful team building exercise, so we might look at creating some tutorials with this in mind. We also had individuals and small groups testing out their own inventions and games, again revisiting concepts like conductive ink or simple conductive objects. A two person team tinkered around with some simple fighting games that only use one button for each player, there were people playing Tetris and other games with their inventions, and we again offered a random hack table with an assortment of items and components to rummage through. MaKey MaKey Build Night I: When MaKeys Attack.. We had a nice turnout for this event. This was an introduction to the basic concept behind MaKey MaKey, how to remap the beta v1.2 boards using the web remapper, different applications that make a MaKey MaKey naturally awesome to use, and a few sample projects. We opened up the floor to open hacking, and that day our Adafruit group buy had just come in. We were able to add to the random hack table some awesome components, such as: male/male and female/female jumper wires, various diffused LEDs, slow and fast cycling LEDs, conductive thread, flat LED panels, sewable LEDs, tactile buttons, and other items. We wrapped up and one of our newest members stayed late to craft a thin copper wire into a flat copper instrument using a mallet. He ended up using a breadboard with the MaKey MaKey and Wolfram software to write his own music program. As with our other Build Night events this month, we also had people working on side projects in the background which added to the creative energy of the room. For this event, one of our members tested out a Gocupi that managed to draw Rear Admiral Grace Hopper and Albert Einstein on the whiteboard in dry erase marker using continuous lines. MaKey MaKey Build Night II: Big Projects! We had a decent turnout for this event, but mostly the attendees were there for their own big projects unrelated to MaKey MaKey. We got a few MaKey MaKey projects in around good company, though. We had members working on a large geodesic Airolite boat, someone showed up to work on their 3D printer and print out their first scale model of a scanned person, our Facilities Director was able to get some critical inventory done, a couple members mounted new shelves that had been donated that day, and one member's daughter wanted to play around with hydrophobics. We also were able to get electronic musical wind chimes made that work very nicely with the MaKey MaKey, and the same member who tinkered with Wolfram software at the prior event made more progress on some of his own MaKey MaKey ideas. MaKey MaKey Build Night III: Advanced Reprogramming! This was one of the build nights I was most excited about, and we had a nice turnout. We walked members through reprogramming the older MaKey MaKeys using the MaKey MaKey sketch for Arduino IDE. We bested Windows and its infernal resistance to unsigned 3rd party drivers, and we advanced onward. We looked at basic reprogramming of the settings.h key bindings, and we also looked at other Arduino programming such as delay, Keyboard.print,, Keyboard.release, and some other concepts. A father team duo that are also involved in a local high school robotics club showed up and schooled us a little on Arduino with some tricks they had up their sleeves, another father son duo showed up to experience the MaKey MaKey for the first time together and it seemed to blow their minds, and we talked about the new web remapping tool for the beta v1.2 boards. Mad Science Bingo For one of our educational outreach events, we attended hijacked bingo night at a local senior citizen community center. We let everyone have their bingo fun without interruption, but as bingo concluded we invaded with a MaKey MaKey, our hydrophobic drum pad, fruits and veggies, and some flowers. The senior citizens loved it and have invited us back. At one point, we had three participants record themselves singing into a Scratch program that we mapped to the flowers. The room erupted with laughter when the community center manager went to touch the flowers and they sang at her in her patrons' voices. She even lent her voice to be recorded, which sent the room into mad howls. We also made a chain of about dozen people between ground and the triggers. We didn't really invent anything unique here, but it was a fun bonus event for the community center patrons. We ended up tinkering around a little with hydrophobics and electronics. So far after all our events, we ended up with a few more Build Night projects: Hydrophobic Drum Pad (featured in Science and then Homepaged!) annoy friends with this party game: Wonky Pong Smash Smash Revolution ... black acrylic, conductive paint, and conductive thread Electronic Windchimes sewable Cardboard Feet DDR (featured in Video Games!) We've also set out our MaKey MaKey kits for space use now that our January Build Nights are over with. We have a few members with projects they are still working on at the space, a few projects that are still being documented to upload to Instructables, and a few people batting around their own ideas. If we come up with anything else, we'll be sure and update. A couple "lessons learned" here: Random hack tables are awesome. But.. if they are too chaotic and without the right presentation, these can be intimidating to beginners that may want more direction. Multiple Build Nights rule! But.. it is probably best not to hijack every Saturday of a shared workspace like a hackerspace. This could have been orchestrated a little better (my fault). Overall, this was a blast to participate in. Thanks to Joylabz and Instructables! PS.. with two features and one homepage, that gave us 1 and a half years of Pro. One got used, but we're giving away the remaining year of Pro and 3 months of Pro. The bounty: quick connect projects for MaKey MaKey. Ends 3/1 EST. You know what to do..

Topic by smalltortoise 

Arduino yellow drummer robot?

I was looking at building a yellow drummer robot that I saw in Make 25. I don't have a Picaxe, the problem is that I have seen pictuures and videos of people that have used arduino but no detailed instructions. Can anyone give me a link to instructions or  give me tips. The best help I have had so far is the code. But how do I connect it up? (I have a arduino deumonlatave, but it should still work). // Yellow Drum Machine Program for Arduino Uno // setup pins and variables for SRF05 sonar device int echoPin = 12;                               // SRF05 echo pin (digital 12) int initPin = 13;                               // SRF05 trigger pin (digital 13) unsigned long pulseTime = 0;                    // stores the pulse in Micro Seconds unsigned long distance = 0;                     // variable for storing the distance (cm) // setup pins for drivetrain motors int DCMotor1Drive = 10;                         // DCMotor1 Drive Pin (PWM 3) int DCMotor1Reverse = 3;                        // DCMotor1 Reverse Pin (PWM 10)       int DCMotor2Drive = 9;                          // DCMotor2 Drive Pin (PWM 6) int DCMotor2Reverse = 6;                        // DCMotor2 Reverse Pin (PWM 9) // setup pins for sonar pivot pager int SensorPagerRight = 11;                        // SensorPager rotate right Pin (digital #) int SensorPagerLeft = 5;                         // SensorPager rotate left Pin (digital #) // setup pins for drumstick pagers int Pager1 = 8;                           // Pager1 rotate forward Pin (digital #) int Pager2 = 2;                         // Pager1 rotate reverse Pin (digital #) int Pager3 = 1; int speed = 0; int averageDistance = 0;                        // stores the average distance value int mode = 0; // Function for sonar reader int readsonar() {   // variables to take x number of readings and then average them   // to remove the jitter/noise from the SRF05 sonar readings   const int numOfReadings = 10;                   // number of readings to take/ items in the array   int total = 0;                                  // stores the cumlative total     // create array loop to iterate over every item in the array   for (int i = 0; i < numOfReadings; i++) {        // Trigger sonar to take reading     digitalWrite(initPin, HIGH);                    // send 10 microsecond pulse     delayMicroseconds(10);                          // wait 10 microseconds before turning off     digitalWrite(initPin, LOW);                     // stop sending the pulse         // Read sonar distance     pulseTime = pulseIn(echoPin, HIGH);             // Look for a return pulse, it should be high as the pulse goes low-high-low     distance = pulseTime/58;                        // Distance = pulse time / 58 to convert to cm.     total= total + distance;                        // add the reading to the total   } return total / numOfReadings; } // Drivetrain movement command functions   /* Drivetrain Forward */   int goforward(int speed) {      analogWrite(DCMotor1Reverse, 0);     analogWrite(DCMotor1Drive, speed);     analogWrite(DCMotor2Reverse, 0);     analogWrite(DCMotor2Drive, speed);   }   /* Drivetrain Reverse */   int goreverse(int speed) {     analogWrite(DCMotor1Reverse, speed);     analogWrite(DCMotor1Drive, 0);     analogWrite(DCMotor2Reverse, speed);     analogWrite(DCMotor2Drive, 0);   }           /* Drivetrain Turn Right */   int goright(int speed) {     analogWrite(DCMotor1Reverse, 0);     analogWrite(DCMotor1Drive, speed);     analogWrite(DCMotor2Reverse, 0);     analogWrite(DCMotor2Drive, 0);   }   /* Drivetrain Turn Left full speed*/   int goleft(int speed) {   analogWrite(DCMotor1Reverse, 0);   analogWrite(DCMotor1Drive, 0);   analogWrite(DCMotor2Reverse, 0);   analogWrite(DCMotor2Drive, speed);    }     /*Drivetrain turn around*/   int turnaround(int speed) {      analogWrite(DCMotor1Reverse, 0);      analogWrite(DCMotor1Drive, 255);      analogWrite(DCMotor2Reverse, 255);      analogWrite(DCMotor2Drive, 0);   }     /* Pager Pulse functions */   int rightstick() {     digitalWrite(Pager1, 0);     delay(200);     digitalWrite(Pager1, 1);   }     int leftstick() {     digitalWrite(Pager2, 1);     delay(200);     digitalWrite(Pager2, 0);   }     int tailstick() {     digitalWrite(Pager3, 1);     delay(200);     digitalWrite(Pager3, 0);   }      //Operational Modes   //Target Seeking Mode  int findtarget() {    int Center = readsonar();    if (Center > 50)       goforward(255); //Go forward!    else      mode = 1; //  }     //Fine-Tune Targeting Mode  int lockontarget() {     // Reading and moving the sonar     int Center = readsonar();     digitalWrite (SensorPagerLeft, 1);     digitalWrite (SensorPagerRight, 0);     delay (500);     int Left = readsonar();     digitalWrite (SensorPagerLeft, 0);     digitalWrite (SensorPagerRight, 1);     delay (500);     int Right = readsonar();     digitalWrite (SensorPagerLeft, 0);     digitalWrite (SensorPagerRight, 0);     delay (500);         //Speed and Direction Control      if ((Center < Right) && (Center < Left)) {         if (Center > 50)           goforward(255); //Go forward!        else if (Center > 7)          goforward(128); //        else          mode = 2;      }      else if ((Right < Center) && (Right < Left)) {        if (Right > 50)           goright(255); //Go forward!        else if (Right > 7)          goright(128); //        else          mode = 2;      }      else if ((Left < Center) && (Left < Right)) {        if (Left > 50)           goleft(255); //Go forward!        else if (Left > 7)          goleft(128); //        else          mode = 2;      }  } //LET THE BEAT DROP! int makesomenoise() {    tailstick();    rightstick();    leftstick();    delay (500);          tailstick();    rightstick();    leftstick();    delay (500);    tailstick();    rightstick();    leftstick();    delay (500);    tailstick();    tailstick();    tailstick();    tailstick();    rightstick();    leftstick();    tailstick();    rightstick();    leftstick();    delay (500);    tailstick();    rightstick();    leftstick();    delay (500);    mode = 3; }      //Go Somewhere Else//  int runaway()  {    goreverse(255);  }               // setup void setup() {   pinMode(DCMotor1Drive, OUTPUT);                     // sets DCMotor1Drive as output   pinMode(DCMotor1Reverse, OUTPUT);                   // sets DCMotor1Reverse as output   pinMode(initPin, OUTPUT);                           // set init pin 13 as output   pinMode(echoPin, INPUT);                            // set echo pin 12 as input   pinMode(Pager1, OUTPUT);   pinMode(Pager2, OUTPUT);   pinMode(Pager3, OUTPUT);   digitalWrite(Pager1, 1);   digitalWrite(Pager2, 0);   digitalWrite(Pager3, 0);    // initialize the serial port, lets you view the  // distances being pinged if connected to computer  //    Serial.begin(9600);   } void loop() {   if (mode == 0)     findtarget();   else if (mode == 1)     lockontarget();   else if (mode == 2)   {     makesomenoise();     turnaround(255);     mode = 0;   }   // Serial.println(mode, DEC);         // print out the average distance to the debugg }  

Question by David97   |  last reply

Can Someone Modify an Arduino Sketch For Me? Answered

I recently got into Arduino, and my first long term project is an autonomous roaming robot. Now, I've been in electronics for a while, so the actual building of the thing was not a problem....but the programming is. I've found a couple examples of codes online, but they all use Sharp IR sensors, whereas I have a Ping))) Ultrasonic sensor. I was wondering if there were any Arduino experts out there that could modify a sketch that I found to only use the Ping))) instead of the IR sensor(s). This sketch actually uses both, and would be perfect if the Ping))) was used in place of the IR sensors, rather than with them. If anybody could modify the sketch below to do as I said, your help would be greatly appreciated. Thanks. Code: int micVal; int cdsVal; int irLval;  // Left IR int irCval;  // Center IR int irRval;  // Right IR int i;   // Generic Counter int x;  // Generic Counter int PLval;  // Pulse Width for Left Servo int PRval;  // Pulse Width for Right Servo int cntr;  // Generic Counter Used for Determining amt. of Object Detections int counter; // Generic Counter int clrpth;  // amt. of Milliseconds Of Unobstructed Path int objdet;  // Time an Object was Detected int task;  // Routine to Follow for Clearest Path int pwm;  // Pulse Width for Pan Servo boolean add;  // Whether to Increment or Decrement PW Value for Pan Servo int distance;  // Distance to Object Detected via Ultrasonic Ranger int oldDistance;  // Previous Distance Value Read from Ultrasonic Ranger float scale = 1.9866666666666666666666666666667;  // *Not Currently Used* int LeftPin = 6;  // Left Servo int RightPin = 9;  // Right Servo int PiezoPin = 11;  // Piezo int PingServoPin = 5;  // Pan Servo int irLPin = 0;            // Analog 0; Left IR int irCPin = 1;            // Analog 1; Center IR int irRPin = 2;            // Analog 2; Right IR int ultraSoundSignal = 7; // Ultrasound signal pin int val = 0;              // Used for Ultrasonic Ranger int ultrasoundValue = 0;  // Raw Distance Val int oldUltrasoundValue;  // *Not used* int pulseCount;        // Generic Counter int timecount = 0; // Echo counter int ledPin = 13; // LED connected to digital pin 13 #define BAUD 9600 #define CmConstant 1/29.034 void setup() {   Serial.begin(9600);   pinMode(PiezoPin, OUTPUT);   pinMode(ledPin, OUTPUT);   pinMode(LeftPin, OUTPUT);   pinMode(RightPin, OUTPUT);   pinMode(PingServoPin, OUTPUT);   pinMode(irLPin, INPUT);   pinMode(irCPin, INPUT);   pinMode(irRPin, INPUT);   for(i = 0; i < 500; i++) {     digitalWrite(PiezoPin, HIGH);     delayMicroseconds(1000);     digitalWrite(PiezoPin, LOW);     delayMicroseconds(1000);   }   for(i = 0; i < 20; i++) {   digitalWrite(PingServoPin, HIGH);   delayMicroseconds(655 * 2);   digitalWrite(PingServoPin, LOW);   delay(20);   }   ultrasoundValue = 600;   i = 0; } void loop() {   //Scan();   Look();   Go(); } void Look() {   irLval = analogRead(irLPin);   irCval = analogRead(irCPin);   irRval = analogRead(irRPin);   //if(counter > 10) {     //counter = 0;     //readPing();   //}   if(irLval > 200) {     PLval = 820;     PRval = 850;     x = 5;     cntr = cntr + 1;     clrpth = 0;     objdet = millis();   }   else if(irCval > 200) {     PLval = 820;     PRval = 850;     x = 10;     cntr = cntr + 1;     clrpth = 0;     objdet = millis();   }   else if(irRval > 200) {     PLval = 620;     PRval = 650;     x = 5;     cntr = cntr + 1;     clrpth = 0;     objdet = millis();   }   else {     x = 1;     PLval = 620;     PRval = 850;     counter = counter + 1;     clrpth = (millis() - objdet);     if(add == true) {       pwm = pwm + 50;     }     else if(add == false) {       pwm = pwm - 50;     }     if(pwm < 400) {       pwm = 400;       add = true;     }     if(pwm > 950) {       pwm = 950;       add = false;     }     digitalWrite(PingServoPin, HIGH);     delayMicroseconds(pwm * 2);     digitalWrite(PingServoPin, LOW);     delay(20);     readPing();     if(ultrasoundValue < 500) {       cntr = cntr + 1;       switch(pwm) {         case 400:           x = 7;           PLval = 650;           PRval = 650;           Go();           break;         case 500:           x = 10;           PLval = 650;           PRval = 650;           Go();           break;         case 600:           x = 14;           PLval = 850;           PRval = 850;           Go();           break;         case 700:           x = 10;           PLval = 850;           PRval = 850;           Go();           break;         case 950:           x = 7;           PLval = 850;           PRval = 850;           Go();           break;       }     }   }   //Serial.print("clrpth: ");   //Serial.println(clrpth);   //Serial.print("objdet: ");   //Serial.println(objdet);   //Serial.print("cntr: ");   //Serial.println(cntr);   if(cntr > 25 && clrpth < 2000) {     clrpth = 0;     cntr = 0;     Scan();   } } void Go() {   for(i = 0; i < x; i++) {     digitalWrite(LeftPin, HIGH);     delayMicroseconds(PLval * 2);     digitalWrite(LeftPin, LOW);     digitalWrite(RightPin, HIGH);     delayMicroseconds(PRval * 2);     digitalWrite(RightPin, LOW);     delay(20);   } } void readPing() {  // Get Distance from Ultrasonic Ranger timecount = 0; val = 0; pinMode(ultraSoundSignal, OUTPUT); // Switch signalpin to output /* Send low-high-low pulse to activate the trigger pulse of the sensor * ------------------------------------------------------------------- */ digitalWrite(ultraSoundSignal, LOW); // Send low pulse delayMicroseconds(2); // Wait for 2 microseconds digitalWrite(ultraSoundSignal, HIGH); // Send high pulse delayMicroseconds(5); // Wait for 5 microseconds digitalWrite(ultraSoundSignal, LOW); // Holdoff /* Listening for echo pulse * ------------------------------------------------------------------- */ pinMode(ultraSoundSignal, INPUT); // Switch signalpin to input val = digitalRead(ultraSoundSignal); // Append signal value to val while(val == LOW) { // Loop until pin reads a high value   val = digitalRead(ultraSoundSignal); } while(val == HIGH) { // Loop until pin reads a high value   val = digitalRead(ultraSoundSignal);   timecount = timecount +1;            // Count echo pulse time } /* Writing out values to the serial port * ------------------------------------------------------------------- */ ultrasoundValue = timecount; // Append echo pulse time to ultrasoundValue //serialWrite('A'); // Example identifier for the sensor //printInteger(ultrasoundValue); //serialWrite(10); //serialWrite(13); /* Lite up LED if any value is passed by the echo pulse * ------------------------------------------------------------------- */ if(timecount > 0){   digitalWrite(ledPin, HIGH); } } void Scan() {   // Scan for the Clearest Path   oldDistance = 30;   task = 0;   for(i = 1; i < 5; i++) {     switch(i) {       case 1:         //Serial.println("Pos. 1");         pwm = 1125;    ///  incr. by 100 from 1085         break;       case 2:         //Serial.println("Pos. 2");         pwm = 850; //// increased by 100 from 850         break;       case 3:         //Serial.println("Pos. 3");         pwm = 400;         break;       case 4:         //Serial.println("Pos. 4");         pwm = 235;         break;     }     for(pulseCount = 0; pulseCount < 20; pulseCount++) {  // Adjust Pan Servo and Read USR       digitalWrite(PingServoPin, HIGH);       delayMicroseconds(pwm * 2);       digitalWrite(PingServoPin, LOW);       readPing();       delay(20);     }     distance = ((float)ultrasoundValue * CmConstant);   // Calculate Distance in Cm     if(distance > oldDistance) {  // If the Newest distance is longer, replace previous reading with it       oldDistance = distance;       task = i;   // Set task equal to Pan Servo Position     }   }   //Serial.print("Task: ");   //Serial.println(task);   //Serial.print("distance: ");   //Serial.println(distance);   //Serial.print("oldDistance: ");   //Serial.println(oldDistance);   distance = 50;  // Prevents Scan from Looping   switch(task) {   // Determine which task should be carried out     case 0:  // Center was clearest       x = 28;       PLval = (850);       PRval = (850);       Go();       break;     case 1:  // 90 degrees Left was Clearest       x = 14;       PLval = (650);       PRval = (650);       Go();       break;     case 2:  // 45 degrees left       x = 7;       PLval = (650);       PRval = (650);       Go();       break;     case 3:  // 45 degrees right       x = 7;       PLval = (850);       PRval = (850);       Go();       break;     case 4:  // 90 degrees right       x = 14;       PLval = (850);       PRval = (850);       Go();       break;   } }    

Question by punkhead58   |  last reply