Show Posts
Pages: 1 2 [3] 4 5 ... 19
31  Topics / Science and Measurement / Re: Arduino Gear Position Sensor on: March 01, 2014, 01:08:56 pm
I wrote a code that may help you:
This code allows to identify various voltages steps applied to one of Arduino analog inputs. Gear shifts are used as example. Using permanent resistors as voltage dividers and keys it could be used to implement a one line keyboard without using digital inputs. I'm using a 5K potentiometer which wiper is connected to analog input A0 and the extremes to ground and Arduino 5V Power Supply. Rotating the pot simulates the shifts. The gear engaged can be viewed in the serial monitor.
Careful with that bike though. I ride mine every day and have to be dodging the cars constantly in this awful traffic. smiley-mad
Hope it helps you and others interested.
I'd like to see someone implementing the one line keyboard. I just don't have the time to do it.
32  Topics / Science and Measurement / Re: Arduino Gear Position Sensor on: March 01, 2014, 07:58:09 am
On a closer look there are more problems with the code.

1- You haven't post the complete code. That makes it harder to analyze.
2- I assume since gear is a counter it was defined as an int type variable. Then it can only take integer values. The statement gear=N; is just not possible as 'N' is a char type variable.
3- You should have alert messages at the bottom telling you of possible errors.
4- From:
if ((voltage >= 2.5) && (gear < 6)) { //Change loop to (gear = value) && (voltage = value) [same kick deflection]
     gear = gear + 1;
}
else if ((voltage <= -2.5) && (gear > 1)) {
     gear = gear - 1;
}
Problems: 
-The case voltage ==2.5 is true in both situations. You have to use the "=" in one of them only.
-Arduino can't read negative voltages. The condition voltage<=-2.5 is not possible and therefore always false.
-Unless you have made the conversion from the int value read by Arduino which must be within the interval (0-1023) you can't compare voltage to 2.5. I don't know, you did not presented that part in the posted code.

Shoud be

if(voltage>=2.5&&gear<6)
{
gear=gear+1;
}
else// Not needed
{
//Nothing. No else required.
}

if (voltage<2.5&&gear>1)
{
gear=gear-1;
}

Another way:

if(voltage>=2.5)
{
gear++;// Same thing as gear=gear+1;
}
else
{
gear--;
}
 I think you don't need to check for gear also. If properly done you can't have voltages and gears differing.
Anyways another way to go is:
gear=constrain(gear,1,6); //Check the constrain() function on the Reference at the top menu of this page.
33  Topics / Science and Measurement / Re: Arduino Gear Position Sensor on: February 28, 2014, 06:11:49 pm
Code:
else if ((voltage <= -2.5) && (gear > 1)) {

This (-2.5) could be an error. I haven't check thoroughly though. Please post all the code. I think its better to somehow have a permanent linkage between the pot and the shift system than saving the last position. What will happen if the gear gets shifted while Arduino is off? Can that be possible??? Conversely, Arduino will look for gear position at start up by reading the pot position regardless of changes while sleeping.
34  Topics / Science and Measurement / Re: Temp Chamber Project on: February 28, 2014, 05:49:08 pm
Did not know about the  GORE(tm) vent, very interesting. The silica I knew; but haven't made the connection. Glad you did it, it offers a real practical solution I haven't think about. Also good to know about your low temp experiences with Arduino. Everything is getting much clear now...
Really thanks for your help and excellent explanation.
35  Topics / Science and Measurement / Temp Chamber Project on: February 28, 2014, 10:29:46 am
Hi:
I'm seriously thinking on tackling a permanent problem which is having a temp chamber to test some of my projects performance with temp.
Since I need to lower the temp probably near 0 C or a bit lower for it to be really useful and with a fast temp change rate I think the best way is to use an existing working mini fridge??? and add a heating system such like a hair dryer or any other resistive element-fan combination that suits the purpose. I live in very hot weather so taking cold air from outside is just not possible. That way I will dodge the major task of building the cooling system by myself or even making any costly modifications to it. I'm planning on using a computer and Arduino to build the controls having a set of already preprogrammed temp change curves and modes and also some flexibility to manually program special modes and change parameters which will probably be needed; but that's still far away for now.
The main concern I have and still have to resolve before continue planning is condensation, very common around here considering relative humidity is always high. Just to give you an idea how permanent it is, I have to clear my glasses everytime I go outside a place with AC even in what is supposed to be "winter". Since there will be electronics inside probably even Arduinos I want to prevent that. Do you think condensation will become a major problem? If so, will there be ways to mitigate that? Maybe I'm wrong and if done right by only opening the chamber when its hot, I won't have the problem; but how about with the door closed? Condensation will take place inside?. I think the sample can't get cold faster than the surroundings for condensation to occur; but the surrounding air can get hot faster than the sample when heating. Will recirculating the same inside air with a fan when in heating mode, will be better than opening windows and feed fresh air from outside?.  I would like to have some help clarifying this point. Maybe it doesn't even matter to have some condensation. I don't know. Can Arduino sustain low temps??? I've heard of people sending Arduinos to the stratosphere; but I don't know the results. I don't want to put my Arduino inside the fridge without knowing of the possible outcomes. They have tried it all, so it probably happened already. Most of the people in this forum live in cold weather maybe they can tell what happens when they take their Arduinos for a walk and its -10C outside???
I would also be glad to get any other ideas and suggestions you may have. Since I haven't started with this yet, its better to get as much info as possible now that any thing can be changed, than later on in the process when I will have to modify already built things.
Although far away in time, it will also be good to have an idea of which preprogrammed temp control modes maybe be good to have.  I haven't think about that in detail yet; but again it will be good to have at least a general idea before hand.
Any ideas or suggestions are welcomed. Maybe there are people here who have worked doing these things before or are interested in doing them.
36  Topics / Science and Measurement / Re: problems in data measurement on: February 27, 2014, 11:47:56 am
I suggest this:
-Take a couple of days of break from the build up and go to the library with your circuits on hand, carefully read the postings and deeply study the subjects recommended. Compare what you learn with what you have actually built. When you have a better picture of the possible mistakes and only then return to the lab to continue with the build up. I honestly have told you everything I consider necessary for your approach to succeed to the best of my knowledge and experience.
-Talk to your project tutor and request some onsite help also. Its hard to figure out the details from reading posts. From short distance, he will have better clues than me.
37  Topics / Science and Measurement / Re: problems in data measurement on: February 27, 2014, 08:52:22 am
-The OP37E is an excellent choice. BTW, check pages 13 and 14 of its datasheet http://www.analog.com/static/imported-files/data_sheets/OP37.pdf for the Phono and Mic preamps configurations mentioned before. I still think that's a better choice than the Instrumentation Amp config  you are using in this particular case. The reasons for that are the high freq and gain levels you are using.
-Consider using another OP37E instead of the LM741P.  Although I can't find the datasheet for the P version you are using, I suspect, it might introduce more noise and its temp offset drift is probably higher and that will cause problems as explained before. What you are trying to build is uncommonly difficult and requires extreme care and attention to details. If you don't follow already known procedures and techniques you won't get acceptable results.
-I think there is no need for a buffer last stage unless the voltage level is too low; but having so many stages already that's difficult to accept if everything was done right. The low pass filter stage to recover the signal envelope acts as a buffer already. Adding another stage introduces more noise and problems. If there is not enough voltage try to increase the gain of that and previous stages with care not to surpass the Gain Bandwith product and slew rate as advised before. The more active components the more noise is introduced and the more problems are added. Plus added cost
-The 10pF cap used apparently is not right . According to f=1/2PIxRxC, with R=47K and c=10pF the cutoff freq should be 1/(2xPIx47x10^(3)x10^(-11))=1/(2xPIx47x10^(-8))~344KHz that's way above the 20KHz carrier and the cutoff freq. must be way below it for correctly detecting the envelope by averaging and properly measure the voltage. The filter is simply not filtering and the 20KHz half wave carrier is passing through. Arduino is sampling the non averaged signal and since there is no sync between it and the Arduino sampling rate, it gets the reading at any point of the "rectified signal" and therefore the readings are erratic. There could be other problems though, like the amplitude actually getting to Arduino, noise, bad rectification, etc. But lets begin by fixing that. Double check my calculations for accuracy please. I did it quickly and they may be wrong.
-Please post a picture of the "U shaped waveform" you are getting? Sounds like  a clear indication of distortion taking place along the signal path. Troubleshoot with the scope by measuring the signal at different points in its path, that is, at all amplifier stages inputs and outputs and check where that distortion begins to appear. That's the stage introducing it. Must be revised then.
-Please post scope screen pics of the signal waveforms at inputs and outputs where you think there is a problem.
38  Topics / Science and Measurement / Re: Fermentation Temperature Controller on: February 26, 2014, 08:25:02 am
All that being said, let's move on in a positive way. Why don't you use the cooler you know will give a better efficiency? On the other hand, people living in hot weathers like myself may want to build your project.
I'm particularly interested on this because I have been thinking for a while now on building a temp chamber to test many of my own projects behavior with temp. That's a constant need for me. The cooling system which I need for sure in this hot climate I live in, has been the major obstacle preventing me from starting that. I was of the impression a Peltier based cooling system for that will not have the necessary heat extraction punch I might need and the compressor type option will have required modifications and refrigerant recharging tools and equipment I don't have as you pointed out. I had a bad experience with a small Peltier based fridge I bought once and it was simply not cooling enough for my needs; but that was a particular case.
Anyways, I have other concerns and suggestions though.
-If you use plain water as the coolant and since this is a close circulation circuit, there is the possibility of bacteria and algae grow, which might end up clotting the pluming system in the long term. In this system, the temp (I think) will never reach high enough to kill them and keep the system sterile for long periods of time. The use of the transparent hose helps photosynthesis to take place and algae may thrive. This is something I've seen happening even in very sophisticated machines and chemicals had to be added periodically to prevent that as part of the regular maintenance. That takes me to the conclusion that since you might end up using a cooler, it will also be a good idea to place the Peltier element in direct contact with the interior which will benefit your project as you will not have the algae grow problem, will not need the pluming system, circulation pump and special coolant. Also, it will further increase the energy efficiency of your system by eliminating the heat transfer loses the coolant system introduces and the energy required for the circulation pump. This is just a suggestion for your consideration.
-The next concern/suggestion is regarding the heat pumping action of the Peltier element in use. If the heat production rate (Watts) of the brewing surpasses the heat pumping action of the Peltier element or if it is close to it, the system will not be able to lower the temp or only a few degrees at best. That, as you know, depends of many factors like size of the brewing, ingredients, volume of the chamber, Peltier element size and power, etc. This is not the case of a hot object placed inside a fridge for cooling and does not have an energy source to sustain heat production. In this case, it keeps generating heat by the energy released in the chemical reactions taking place in the brewing process. Therefore, long exposure to the cooling process will not be sufficient to lower temp as it would otherwise be with a massive; but passive object by slowly extracting the heat. The suggestion then, is to place a sample temp sensor inside the brewing to collect data from it, another sensor inside the chamber and another outside. You already have at least one of them to perform the temp control. The data collected from them will give a better idea of the cooling effect and operation of the system. Although I believe you have performed at least some preliminary measurements, that data will help to figure out what is really happening there.
Anyways, I still think you've done a great project; but like almost anything else it can be improved little bit here and there.
This project has made my mind clear that what I really need for my temp chamber is to modify an existing working mini fridge by adding a heating system. That will be way easier than adding a cooling system and resistive heating to a non working microwave oven being used as a the chamber, as I was wrongfully thinking. That will make that project way simpler and doable. I take the opportunity to offer this idea as a project to do to anyone interested. I'll give it try myself one of these days...
Thanks and Good Luck!
39  Topics / Science and Measurement / Re: problems in data measurement on: February 26, 2014, 07:52:56 am
I can't open the files format you used. I'm an antiquated computer user, so please just use a different file type like a simple picture file jpg or png if possible. PDF format is also OK.
40  Topics / Science and Measurement / Re: Fermentation Temperature Controller on: February 25, 2014, 06:51:33 pm
Quote
I didn't specify in my post how easy it would be to adapt this to a more efficient design, but here you go...
If that's regarding me, I was just trying to help your point, for 2 main reasons: I like the project and its obvious to me that you know what you are doing. If you look to the left under your screen name, there you have a karma. I gave it to you.
41  Topics / Science and Measurement / Re: Colorimetric CO2 Analysis on: February 25, 2014, 01:52:13 pm
Quote
It is much easier to modify the code inside an Arduino than the cranks and linkages in a mechanical device.
maybe true; but you will be surprised how difficult it can get  smiley-eek-blue smiley-roll-blue smiley-sad-blue lol... and how disappointing not making a penny out of it could be...  smiley-kiss  smiley-money
Enjoy the project...
42  Topics / Science and Measurement / Re: Fermentation Temperature Controller on: February 25, 2014, 11:06:51 am
Quote
Peltier cooling is very inefficient.  The device creates a lot of waste heat.    And the waste heat is going straight into your room,  (  and not "outside"  somewhere ).  The overall effect is heating your room and your beer keg,  more than offsetting the cooling effect.

I do agree with what you have said; but from the picture I can notice he tried to thermally insulate the keg from the rest of the room. How efficiently he did it? I don't know.. Maybe he just opened the insulation to take the picture???. Depending on the quality of the job,  the insulation will delay heat transfer back to the keg. If there is AC in the room (probably the case) and if efficiently done, the AC unit will extract the heat from the room faster than it can reach back into the keg surroundings or the "mini room" created by the insulation. I think it has some chances of working that way; but he will get a higher electricity bill. Placing the element outside as you have suggested by simply extending the coolant hoses, is way more efficient.
43  Topics / Science and Measurement / Re: Colorimetric CO2 Analysis on: February 25, 2014, 09:45:56 am
Quote
Now I just gotta have the system email me when my aquarium starts drastically deviating from ideal. Maybe even remote control...
Yeah, that's something pretty cool and I need to work on that too... In the project I showed you, I couldn't solve that... Have to try harder when I get some time.

Quote
I'm making this harder on myself every day  smiley-lol

It's very easy to fall onto that temptation... It happens to me constantly. In reality, all these projects are the never ending story and features can be added as you can imagine them and are willing to spend the time (and sometimes money) building them.

My recommendation is try to do one thing at a time and begin only with what is really necessary. That way you already have something at hand and that gives you more motivation to continue. In the process you learn and continue adding as needed.
44  Topics / Science and Measurement / Re: problems in data measurement on: February 25, 2014, 09:30:39 am
Quote
The next one I tried is the precision rectifier cirucit, which does not seem to be working at all. The output I am receiveing is AC signal which are amplitude reduced.  I am using a 1N4007 diode and from my observation from the outputs, their amplitudes are reduced 0.7Volts on both positive and negative cycles of the AC signal.  I used the circuits in the following link

In order to attempt finding the reason for that, could you please post the schematic of the actual circuit you have built, including the part number for the OpAmp you have used?.
Normally, for such low current applications the 1N4148 diode is more frequently used.
45  Topics / Science and Measurement / Re: Weight Scale Part 1 (High Resolution A/D Conversion and GUI) on: February 25, 2014, 09:23:16 am
Yes. In general is averaging with several modifications.
Pages: 1 2 [3] 4 5 ... 19