jlkingiii
Posts: 23
Joined: Thu Dec 06, 2012 10:39 pm

Ideas

Thu Dec 06, 2012 11:35 pm

Greetings. I just order my Raspberry Pi and have not even received it yet. But it has already ignited my imagination. What do I do with it once I get it?

I can program in C and have found other languages kind of easy to pick up because of that lower level programming, but I know nothing about robotics. So, I want to start out small. Here are the ideas I have that I think I could do. I want your feed back.

1. Super bedroom clock with sound sensor. The idea is that the clock could be programmed not just for time but for days of the week too, whole calendars. The alarm would be more in line with growing light and bird sounds and not beeps. Also, we have neighbors below us who work late and can be loud late at night. So, my idea is to set up a sound sensor that listens to the dB of ambient sounds, and if they reach a threshold, white noise kicks in to cancel it. Actually I think there is some kind of pulse pink noise that is more conductive to sleep, but I will have to research that. Other sea and storm sounds could also be added. Is this doable?

2. Fan with thermostat . This is the simplest, but might be a good place to begin. But it does build toward my next somewhat disturbing art project which comes next. It seems straight forward to me. A thermistor measures the temperature. If it reaches say 80F the fan kicks on. The art would be to put the fan inside of a Greek god looking head that is blowing on you.

3. An arm holding a fan that - fans you. Like above, once the temperature reaches a certain level, a motorized arm kicks in and simply rotates the arm up and down. When it reaches the bottom, it switches and moves back up. It is holding a simple Oriental fan or even a palm frond. The arm is shrouded in a latex skin that makes it look like a human arm. So, you are sitting on the couch and it starts getting warm, when your slave boy robot arm (is that politically incorrect when taking about simple robotics?) starts fanning you. What kind of motor would you need for that? Is a simple DC motor with some kind of mechanical clutch best. Or a directional stepper motor or something else? How easy is this art project?

What else? :)

User avatar
Burngate
Posts: 6223
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Ideas

Fri Dec 07, 2012 11:21 am

3 Arm holding fan.
Have a look at windscreen wiper motors. You should be able to control the speed using something on the Gertboard

2 Thermostat.
Use Gertboard as interface, or consider USB or IIC

1 Clock.
Depending on the clothness of your ears, the 3.5mm analogue audio out fed to speakers could be good enough (my ears are cloth-ears, but it sounds good to me)
The clock face, however, could be more of a problem if you want more than an HDMI screen showing the time.
If you're happy with running an HDMI monitor all night, then driving that is just graphics programming, and you could have a virtual sunrise, video of cocks crowing, ...

The dB of ambient sound would be the most difficult.
A microphone connected to a USB sound-card would give you some sort of starting point, but you'll soon find yourself with difficulties.
Your ears are remarkable devices - they can pick out and lock onto low-level background sound from below, while ignoring sound you yourself are producing at 20-30dB louder.
Also, they automatically compensate for distance, so that someone talking across the room sounds little quieter than someone right beside you.
A microphone can't do that, so its position is critical.

Other than that, making a wiper motor look like a slave boy would be beyond my artistic skill

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Ideas

Fri Dec 07, 2012 12:50 pm

3. An arm holding a fan that - fans you.
In the back of my mind I have a novelty project for a simple robot arm which holds a lamp - to go over my "electronics workbench" (i.e. corner of my kitchen) so you could steer it where you wanted while working on anything tiny. There's a robot arm being talked about in the MagPi magazine, though I would probably look to make something longer for clearance.

Your project would probably need something heavier-dutier and maybe all the fast motion happening at the wrist. I like the novelty aspect anyway.

Years ago I was in a posh hotel/bar in Singapore and noticed the ceiling "fans" were literally waving metal (maybe) leaves of some sort - they pointed down from the ceiling and waved slowly, I think there was a lever system driving them all. I don't remember if they were effective (the place was air-conditioned anyway I think) but they looked nostalgic and Imperial.

jlkingiii
Posts: 23
Joined: Thu Dec 06, 2012 10:39 pm

Re: Ideas

Fri Dec 07, 2012 12:54 pm

After thinking about it, you are right, the microphone is a problem. Once the white noise kicks in, it would pick that up too and cause almost a feedback issue. Maybe if I place it in another room, but even then stuff like the heater kicking in would be picked up. I guess if you only listen at a small frequency range, you might be able to isolate sounds from downstairs, but I am not sure how to do that without a dedicated sound card. Even then, the project becomes a lot more complicated. I might better of just playing the white noise at a low level all night.

I was looking at the Gert board but no one has it in stock yet, at least not MCM or element 14. But when they do, that was the path I was thinking.

jlkingiii
Posts: 23
Joined: Thu Dec 06, 2012 10:39 pm

Re: Ideas

Wed Feb 06, 2013 3:57 am

Well I did build my robot arm, or at least the hardware. The art part of it is mostly toilet paper tubes with a small hand fan taped to the end right now. But, I was actually surprised at how much air it moves. It worked! LOL

I used Raspberry Pi Spy's one pin analog circuit.

http://www.raspberrypi-spy.co.uk/2012/0 ... -gpio-pin/

And Dr. Monk's servo circuit.

http://www.doctormonk.com/2012/07/raspb ... servo.html

But Dr. Monk's program was fatally flawed. He adds a refresh_period = 0.02 no matter how long the pulse is. That makes a pulse of almost 45HZ at times. I simply subtracted the pulse from the 0.02 delay to make sure the PWM was at least close to 50 Hz and actually got very good results. I know that there are now better solutions with Wiring Pi and C, but I am telling you it worked pretty well. I taped a long straw to the motor and it was steady. If I felt the motor, there was a slight vibration, but the straw did not jump around, it was steady at 0.0015 (that might have to do with the fact that the cheap servo has a rather poor resolution). That was in the GUI with a browser, and editor running. I would not use it for eye surgery or any thing, but if you are steering a RC car or robot or something, it is probably good enough.

There is a Linux command called 'nice'. With that you can set the priority of a running program with (dangling participle). I was going to use that, but did not need to. But It is worth a try. Don't play nice.

Anywho, first project down.

Next up, hack a cheap RC car transmitter with 8 wires, 4 transistors, 4 resistors. Then I should be able to by pass the button switches and write programs to control the car. Then you can just hack the car too. and do something else with the motors.

Also, just to see if I can do it, I want to hook a motor to a the blinds and control it with a web page hooked to my intranet. It is not the most useful utilization of the RPi, but once again, if I can do that, I can do other stuff. I am often asked to adjust the blinds. I am thinking you could adjust the blinds to the angular height of the sun, so that the optimal light enters the window, and close them when perverts might be tempted to look in my window at night. It would make the cat happy. She likes her sun.

One of my problems is I live in a 100 year old house that does not offer many options for home automation. If I hack my thermostat, I am risk being without heat for what remains of the winter. I actually thought about making a little arm that PHYSICALLY moved the thermostat lever. :) I am also thinking about a motion controlled trash can lid, but that seems like a waste of the Pi's potential.

Hoagie
Posts: 119
Joined: Sun Sep 23, 2012 7:19 pm

Re: Ideas

Wed Feb 06, 2013 8:24 am

"that seems like a waste of the Pi's potential."

Only if that's all the Pi is doing.

Si.
Posts: 24
Joined: Mon Apr 30, 2012 2:53 pm
Contact: Website

Re: Ideas

Tue Mar 10, 2015 5:12 pm

And Dr. Monk's servo circuit.

http://www.doctormonk.com/2012/07/raspb ... servo.html

But Dr. Monk's program was fatally flawed. He adds a refresh_period = 0.02 no matter how long the pulse is. That makes a pulse of almost 45HZ at times. I simply subtracted the pulse from the 0.02 delay to make sure the PWM was at least close to 50 Hz and actually got very good results. I know that there are now better solutions with Wiring Pi and C, but I am telling you it worked pretty well. I taped a long straw to the motor and it was steady. If I felt the motor, there was a slight vibration, but the straw did not jump around, it was steady at 0.0015 (that might have to do with the fact that the cheap servo has a rather poor resolution). That was in the GUI with a browser, and editor running. I would not use it for eye surgery or any thing, but if you are steering a RC car or robot or something, it is probably good enough.
Yikes! you are right - I'm not sure about 'fatally' but yes that was sloppy. In my defence, this was done along time ago. I suspect there are much better ways of doing this like: https://pythonhosted.org/RPIO/index.html

I'm in the process of proposing changes in the Raspberry Pi Cookbook to my editor at O'Reilly, so I'll be investigating this again soon, at which point I'll also update the Adafruit tutorial.

Si.

Return to “Automation, sensing and robotics”