Circuit with Thermistor and buzzer?

How do I build a simple ciruit that will cause a buzzing sound when the temperature rapidily increases?

Question by Emmsie 9 years ago  |  last reply 7 years ago


temperature of transformer? Answered

Dear all I would like to use a (temperature Controlled Switch Thermostat Auto Reset ) for protect my transformer (120ac to (60vac 2amp) .Could you point me how much the heat degree( C) of thermistor I must to use please                                      Thank you so much

Question by lam 5 years ago  |  last reply 5 years ago


Temperature sensor with cool thermistor

Hi, I am trying to make a temperature sensor using a thermistor. I've made a basic circuit using an Arduino and some tutorials from this site and couple others, which works well but the thermistor heats up way too much - perhaps to about 50 or 60 degrees - but it needs to stay around room temperature for my application. I'm using a 5V output from an Arduino through a 15Ohm thermistor - am I doing something wrong? Many thanks for the help! The one I've made is almost identical to the one in this tutorial: http://www.circuitbasics.com/arduino-thermistor-temperature-sensor-tutorial/ except a different thermistor

Topic by Mickey_blu_eyes 2 years ago  |  last reply 2 years ago


The different between this two thermistor and where to find their datasheet?

Hi Instructables members', Can anyone tell me the different between this two thermistor and it application circuit: 1 - Thermistor_50s (see attached picture) 2 - Ptc_thermistor_500-800r_hmz13-05m650rn (see attached picture) Thank you in advance

Question by GearUp 4 years ago  |  last reply 4 years ago


Which of this is the right Thermistor for this switching power driver board?

Hi Instructables Members' Schematic link http://www.ebay.com/itm/141408846492?_trksid=p2055119.m1438.l2649&ssPageName;=STRK%3AMEBIDX%3AIT please see the schematic on the most right. Which of this is the right Thermistor for this schematic: a) For 50S can I use this      1) http://www.aliexpress.com/item/Ptc-thermistor-500-800r-hmz13-05m650rn/1279794037.html or      2) http://www.aliexpress.com/item/2013-Thermistor-50s-50-free-shipping/1365188583.html ; and b) For NTC/10K can I use this      1) http://www.aliexpress.com/item/Free-Shipping-50pcs-10k-OHM-NTC-Thermistor-Resistor-NTC-MF52AT-10K-5-3950/715307132.html or      2) http://www.aliexpress.com/item/100PCS-10K-OHM-NTC-Thermistor-5mm-free-shipping/617213149.html Thank you in advance.

Question by GearUp 4 years ago


Battery pack rebuild

I read the instructable on rebuilding the 14.4v cordless tool battery pack and I've done it before with a decent Milwaukee battery. Now I have one that the thermistor is shot. It said 6k8j on it. It was a disc like an advil pill with two leads. Where would I find a replacement? I've looked on digikey.com but can't make heads or tails of it. I imagine you would want it to stop charging at 70 degrees c like a lot of r/c packs do.

Topic by jdubs 11 years ago  |  last reply 1 year ago


where can I find cheap thermistor probes like those found in digital meat thermometers? Answered

I've seen people use a copper lead soldered to a wick rapped around a thermistor, but I really want to use something a little more efficient than this.

Question by Spaceman Spiff 7 years ago  |  last reply 7 years ago


modify wine cooler thermostat refrigerator thermostat operating temperature

Hello. Can someone please tell me how to modify the thermostat on a wine cooler (that uses a compressor). I want to change the temperature from running between 10c-18c to 0c-5c. Please post an instructable or give me ideas- even if generic, it would be helpful.I am specifically trying to modify a baumatic bw18.

Topic by drosengarten 9 years ago  |  last reply 8 years ago


analogue-digital cmos chips? Answered

Is there a chip like the LM3914 that takes an analogue voltage input and turns it into a digital signal? (preferably BCD, but decimal is fine too), but without the inverting output, so I can use it with other CMOS chips? I basically just want a chip that takes an analogue signal, and based on a threshold, divides it up into a decimal (or binary) signal. Specifically, I want to use it with a thermistor and a 7-segment display to make a digital thermometer.

Question by andy70707 7 years ago  |  last reply 7 years ago


ntc thermistor for auto rpm pc fans

I have 470 ohm thermistors and i want to auto control my pc fans ie when the temperature is low the fans are off or low speed,when temperature go high the fans rpm follow up.is there a scematic how to do a pcb?

Question by napoleonis 9 years ago  |  last reply 7 months ago


Relay to control window air unit - first attempt failed (seeking advice)

I'm working on a thermostat project to control window AC units (which I will create an instructable for when it works). The need is to switch on and off an AC unit. The unit runs on 240 VAC (split phase) and the technical documentation says to put it on a circuit with a 20 AMP circuit breaker. I will be controlling the relay with 5 volts from an Arduino (although I suppose I can use an additional small relay to control the larger relay with a higher control voltage, if necessary... the less moving parts the better.) I already tried with a 20 AMP Solid State Relay (SSR) from Omron, but it failed. The problem is that, due to the voltage drop in an SSR, they get really hot. The hotter they get, the less current they are able to switch. The other problem is that SSRs fail with the circuit closed or partially closed. This is not ideal. You wouldn't want to come back to your place after a vacation and find your AC had been running constantly the whole time... I am thinking I need to use an electromechanical relay, but there are so many options on Mouser that I'm feeling a bit overwhelmed! Can someone please help point me in the right direction or suggest a good relay to use?

Topic by morph3ous 5 years ago  |  last reply 5 years ago


3D Printer Thermistor in a K type thermocouple

Hi all,Quick question before I butcher something unnecessarily.Can I connect a bog standard thermistor as found in Chinese 3D printer (of which I have spares) to a k type thermocouple plug (I have none) and use it in my k type thermometer?Or should I just buy the slightly more expensive correct lead?I want to monitor temps @ the heat break of a new hot end.

Topic by Squibo 6 months ago  |  last reply 6 months ago


Does anyone know were to purchase a "Thermistor" for a Ridgid 14.4 drill battery.

I have attempted to get it at Radios shack, and several rebuilders of batteries and they will not sell me one.

Question by reichardt55 8 years ago  |  last reply 8 years ago


Small Temperature Controlled Relay Circuit? Answered

I'd like to build a small temperature controlled relay circuit. I need to sense water temperature and send +12vdc if temp is <95F and -12vdc if >104F. It's driving a linear actuator so it should advance the rod (+12v) at low (<95F) temperature, hold position (0v) between 95 and 104, and retract the rod (-12v) at high temperature. (>104F) Any circuit suggestions? Thanks.

Question by dmcgraw7 9 years ago  |  last reply 9 years ago


What is a good mechanical relay to use to power on an off a wall airconditioning unit? Answered

Cross-posted from here: https://www.instructables.com/community/Relay-to-control-window-air-unit-first-attempt-f/ I'm working on a thermostat project to control window AC units (which I will create an instructable for when it works). The need is to switch on and off an AC unit. The unit runs on 240 VAC (split phase) and the technical documentation says to put it on a circuit with a 20 AMP circuit breaker. I will be controlling the relay with 5 volts from an Arduino (although I suppose I can use an additional small relay to control the larger relay with a higher control voltage, if necessary... the less moving parts the better.) I already tried with a 20 AMP Solid State Relay (SSR) from Omron, but it failed. The problem is that, due to the voltage drop in an SSR, they get really hot. The hotter they get, the less current they are able to switch. The other problem is that SSRs fail with the circuit closed or partially closed. This is not ideal. You wouldn't want to come back to your place after a vacation and find your AC had been running constantly the whole time... I am thinking I need to use an electromechanical relay, but there are so many options on Mouser that I'm feeling a bit overwhelmed! Can someone please help point me in the right direction or suggest a good relay to use?

Question by morph3ous 5 years ago  |  last reply 5 years ago


electronics

Can some help me to give a circuit diagram in heat sensor cooling fan using only thermistor, potentiomet and resistor. 

Topic by vcente.capio.1 4 years ago  |  last reply 4 years ago


Arduino + L298N controlling bipolar stepper with pot speed control and speed on lcd (also on lcd thermistor temp in C)?

Lcd 16 x 2 Motor http://www.banggood.com/JKM-Nema-17-42mm-Hybrid-Stepper-Motor-70oz-in-48mm-2_5A-For-CNC-p-942109.html 10K potentiometer L298N is a module Arduino controlled How can i control the motor and lcd?

Question by bonze77 3 years ago  |  last reply 3 years ago


i am making a overheating detector for my desktop PC, Please tell if the circuit shown below is right.?

 i am using an op amp 741 for this circuit, and a thermistor with P T C .plz tell me if this circuit would work in the real life and please mark the thermistor and resistance for it, that which one should i use.... the purpose of this circuit is to ON a led and a buzzer(not in the diagram i will get to it) when the system starts to get heat up (for more than 50 degree C) and the user will known thats he should On the extra fans..plz plz indicate for any problems and advancements.

Question by pizzadox747 8 years ago  |  last reply 8 years ago


Is it a current limiter or what???

when rebuilding a battery pack for a Sears cordless drill,I encountered a tiny diode or fuse or thermistor of sorts,in the wire coming from the negative pole.It appears this is only active during charging. At any rate,what is it and where do you find a new one??

Question by 9 years ago  |  last reply 9 years ago


Vacuum forming heat source

Hi! I am planning to build a vacuum forming machine that does not use a seperate oven to heat the plastic. For my 3D printing hobby I have come across many heated beds, also some on 230v. Could something like this (https://www.ebay.com/itm/30X30CM-750W-220V-Silicone-Heater-3D-Printer-Heated-Bed-Pad-30cm-Thermistor/401257671771?hash=item5d6cd22c5b:g:iVEAAOSwx6pYrp70) with a heat sink be used for such an application? Thanks!

Topic by ttreurniet 1 year ago  |  last reply 1 year ago


Capacitor charging circuit from a Mosquito zapper bat.

Hi, I want to make a coil gun from a Mosquito zapper bat can any buddy tell me that how to make it from parts like 400 volt capacitors (normal or siliocon coated) , Mosquito zapper bat circuit ( Used it because it makek an output of something 2000 + or - volts @ something 2.1 volt input ) circuit digram i will upload soon ,etc. i want to operate it @ 1.5 volt. can anyone help me in doing it and find me following answers = 1) circuit for charging the capacitors bank safely with over charge protection ( with thermistor or something like it) 2) led based capacitor charged indicator (specifically single led based) 3) any other circuit by which i can make a capacitor charging circuit with input 9 volt battery and output 800 volt. 4) also any voltage amplification circuit with input 9 volt battery and output 800 volt. 5) please tell me which parts to use like diodes, transistors, LED diode, resistors, transformer, thermistor, etc.

Topic by manpatpro 6 years ago  |  last reply 5 years ago


How can I modify a drinks chiller running at 10c-18c to run at temperatures of 0c-5c?

Help. I want to convert the baumatic bw18 drinks chiller into a refrigerator. The cooler runs between 10c-18c. I need to alter it to run at 0c - 5c. Is this possible? What parts can I modify? Do I purchase or modify the thermistor? I think it is more involved than resetting an appliance timer. I need to convert this model specifically. Here is the product link. http://www.baumatic.co.uk/products/catalogue/refrigeration/winecoolers/BW18Thanks.

Question by 9 years ago  |  last reply 9 years ago


temp controller

Hi dont know is anybody can help replacing the batteris in my drill pack and found that it has what looks like a thermistior??? to control chaging temp.  unfortunatly when dismantling I shorted it out to + and i believe blew it. i need to renew it as it lookslike it feeds relay in charger to switch  when fully charged (its a 1 hour fast charge)  how ever dont know what it is . it appear tobe connected in series with a resistor ???(again not sure can up load a photo if it helps) the thermistor is 2 wire and marked M20 tp118/c 02c if that helps, the resistor 05u-045G peter

Question by peter354 6 years ago  |  last reply 6 years ago


Color changing LED faucet?

I'm looking to make one of those faucets that changes color with the temperature of the water coming out of it. I already have a preliminary circuit using a thermistor, an LM311 comparator and a couple LED's. Just wondering if anyone had any tips of how to refine or whatever. Also hitting a roadblock on how to power this, as I want to make it entirely analog (no microcontrollers, just op amps and the like) and I want it to be fitted to an actual faucet nozzle. If it is fitted to a nozzle, space is very limited and batteries are really not desired. I was thinking along the lines of a mini waterwheel or something that uses kinetic energy from the water.

Question by jarredpickles87 6 years ago  |  last reply 6 years ago


How can I by-pass power supply from old overhead projector?

I am wondering how I can use the power supply of the overhead projector and also use the High voltage supply it comes with. It does seem to be dependent on other circuitry and a quick Google search doesn't reveal much about this. The power supply needs feedback from a thermistor and a motherboard that is attached to the supply with a dual row pin of total 20 pins. The motherboard needs to be there in order for anything to work. I am wondering if there is a pin I can short similar in fashion to a computer power supply.  Any suggestions?

Question by Hendrik0360 4 years ago  |  last reply 4 years ago


Temperature sensor using LTC2984

Dear Sir, I am using following device to measure temperature accurately,http://www.linear.com/solutions/5500 According to datasheet, the eval board can show a virtual temperature output using built in thermocouple thermister, RTD etc in ADC mode . http://www.linear.com/product/LTC2983, I need to measure real temperature which they apply in Heat bath or temperature calibration set up. I dont have such set up now, could you kindly give me a way out that without those set up I could manage Thermistor ? Kindly go through the page 43-47 in this datasheet, http://cds.linear.com/docs/en/datasheet/2983fb.pdf. Thanks in advance.

Topic by Hasan2015 3 years ago


Hamster's heating pad

The winter is on it way. I'm having a hamster, a winter white, but the last winter his caught cold and it cost very much for him to cure him. I don't want my hamster to be sicked any more, so I made a heating pad for him. I used this instructable  https://www.instructables.com/id/DIY-heated-clothing/ and I found it is very well. I use a two - meter 26 - gauge wire, and it only result in a 0.15 ohm resistance. With an 1.5 v voltage, It work well and i need a 10a fuse to protect this circuits:) But last week it overheated and my hamster was burned, quite bad. I'm wondering if there is a solution to this. Would you mind giving me a circuit in which: - there is a thermistor to sense the temperature. - If the temperature is to high (30 celcius degrees ), it gives a relay some voltage and the relay breaks the heater circuits. - And it component should be popular, cause I'm a kid and don't have many time go round n' round to find them. Me and my hamster will very appreciate your kindness. Thanks all.

Topic by vietanisme 4 years ago  |  last reply 2 years ago


Li-ion 5 pin, pinout?

Good Day Fellow TinkerersI have a battery that came out of a Android Tablet that i want to use for another project.It has a cuircuit board attache to the top which i would assume is a over/under charge protector and it has 5 wires coming off of that. 2 x Red, 1 x White and 2 x Black.The two black wires are connected to the same pad on the "protection circuit" and the two red are connected to the same pad. The white wire is on a separate pad i.e. 3 pads, 1 with 2x red, 1 with 2 x black and 1 with 1 x white.I figure the Red would be positive and the Black negative and then i would assume that the white is the Thermistor connection.My Question :How do i connect this externally from the tablet to charge? I figure red and black are the usual, but how do i connect the white wire?Thanks in advance for any help :)

Topic by GhengisKhan1981 11 months ago  |  last reply 11 months ago


Weed Whacker-Powered Bicycle

This is a bike I built a year ago. It uses a 30.5cc (about 1.5hp) weed whacker engine for propulsion. A version of the same thing was on Instructables, and that's what partially inspired me to make this. ;) The engine mounts are made out of wood, because I still have not learned to weld, but they hold up just fine. The engine is an ten-year-old Echo weed whacker. It has 10,000 max RPMs. The bike peg attached is 2" in diameter and gives about 25mph top speed. There is no clutch! The one that came with the engine was way too flimsy for a vehicle like this so I took it out. Saved a lot of space, too. For the throttle, I disconnected the back brake line and connected it to the engine. The front brakes are still intact, and you can turn the engine off to slow the vehicle as well. I added the extra heatsink to the engine to help keep it cooler, as it was never meant for this kind of exertion. It gets as hot as the engine, so I guess it conducts the heat away pretty effectively. There is a 10-LED bargraph to show the engine temperature. It uses an LM3914, an op-amp, and a thermistor. There is also a 555 to drive a buzzer when it gets too hot. The bike has head and taillights that are both driven from a joule thief. They are not very bright; they are more for being seen than to see. Here's a youtube video, taken almost a year ago: http://www.youtube.com/watch?v=bdySFqmK0Fw Some more photos and a little more information: http://forums.modretro.com/viewtopic.php?f=3&t;=656 Comments/criticisms? :)

Topic by 1up 8 years ago  |  last reply 8 years ago


How to connect higher voltage to PIC chip input reliably ?

The PICAXE 08M2+ IC is just an 8-pin flash PIC with nanowatt... I have been working on my 3000mW handheld laser monitoring system for ages. It is a picaxe 08M2 connected to an LED, a buzzer through a transistor, a thermistor, and an 8.4V input. It is almost perfect, the problem I have isn't really serious, but I want to make it perfect. Now read carefully what happens: The picaxe comes on when the laser's "armed" keyswitch is turned. An on/off pushbutton then controls turning the laser on/off, all the while the picaxe is still on. The PICAXE runs off a 78L05 connected to 8.4V. If I turn on the PICAXE, it works all fine as usual. When I turn on the laser (1.5A load), it is still perfectly fine due to the 0.22uF capacitor I put on the PICAXE 5V rail! BUT, if the laser pushbutton had been left on, and you turn the armed switch on, the laser comes on as usual, but the PICAXE doesn't boot. If I turn the laser pushbutton off then on, even for a millisecond, the PICAXE boots and works fine from then on. Now here is how it is wired up, I want the PICAXE to know when the laser is on, so I connected the pushbutton to INPUT3 on the PICAXE so INPUT3 gets power along with the laser when the pushbutton is pressed. I realise that the 8.4V input is too high for the PICAXE, so I experimented with resistors and discovered that a 47K resistor between the 8.4V and the INPUT3 worked fine (with a 10K pulldown). I have checked and it is not a software problem. What I don't get is why the PICAXE stays working fine when the laser load is turned on, but not if they are both turned on at the same time. The attached drawing is to help explain my set up. See how the PICAXE only fails to boot if the laser on/off switch was already on when the main keyswitch is turned on. If I turn the laser pushbutton off then on, even for a millisecond, the PICAXE boots and works fine from then on. I hope it wasn't too hard to understand...

Question by jdorne 6 years ago  |  last reply 6 years ago


Want advice on a brew temperature controller Answered

Some friends of mine have asked me to make them a brew temperature controller for their microbrewery. I have a rough idea about how I'm thinking of doing it, but would like to check out whether I am on the right track. What they want is something that will maintain a constant temperature inside an insulated box they are building (about 3x1x1m), which the vats will go in to brew. My idea is to use an arduino controller to switch a Solid State Relay and turn the heater on and off to maintain a set temperature. I want to try using low frequency PWM (at about 5Hz) and a proper PI control loop to get really accurate control, rather than just using a standard thermostat action. I'm thinking that given that the relay should switch on every half-cycle (100Hz), this will give me at least 20 levels of control. (Probably more because as the PWM frequency drifts against the mains frequency, the number of on cycles will jump up and down by 1 around an average value.) I decided on this method rather than using a phase angle controller because they are costly and need external components (e.g. a line filter) to work properly. As far as I can see, this switching method should give me pretty good control over the temperature, but it would be good to know if anyone can see any problems with it - I'm designing this more from theory than experience. One thing I'm not sure about is how to measure the temperature. I'm thinking of using an SPI chip rather than try to calibrate a thermistor, but these cost about 4 pounds, so I'm wondering if I could save a bit of money by using a simpler method. Another question is about safety - any advice on things I should do to ensure it's safe would be welcome. I've never done a mains powered project before, so I want to be really careful. I've written up some notes on my proposed design here.

Question by ganglion 7 years ago  |  last reply 7 years ago


Throwies reimagined - Really I did tried :) :| :/

Seeing other forms of making interactive throwies, eg using microchips impresses me.However i think it is important that we try parts of the B.E.A.M philosophyhttp://en.wikipedia.org/wiki/BEAM_roboticsNamely keeping things simple, and avoiding the use of microprocessor.The component of a interactive throwie is that it has1. Power storage2. Trigger3. Circuit4. LED5. (optional) Power collection of radiant energy.I like to see more suggestion on ways we can address each issues.But to kick start the issue, can you see if my idea is feasible.essentially for my prototype not-yet throwie, I used a circuit from http://unconventional-airsoft.com/2003/11/16/momentary-fan-switch/#more-21to create a throwie that on sensing motion, doesn't flicker but turns on for a while.By ensuring that i use few and simple componants, i hope to keep cost per throwing down.Unfortunately my problem is that using a resistor to keep the capacitor from draining too fast from the base, actually decreases the voltage drop to an unacceptable level at the led.On my end it is unsolvable for the moment. Maybe you can work out how to make a cheap throwie, that can still do these functions or more.Any ideas how to solve this?Other Ideas for throwies1.Open and attach a switch to a barometer, to have a air presser passive trigger.2. A leave shaped pad with two conductors that do not touch, to act as rain sensors. (Resistance increase when leaf dries)3. Is sensitive to infrared radiation from side, so that the throwie is trigger-able by other activated throwies. (As well infrared devices)4. Has a short loop of coil to recharged capacitors, by outside induction.5. If activated rarely, uses a tiny single solar cell to charge capacitor.6. Has a hook to be easily collected for recycling. (Using a simple loop of wire on a pole [Like a dog catcher pole] )7. A single thermistors in series with led.8. A tricolour LED, and a Two light resistor. One LDR acts to sense if it is day an night, if night a low power light is activated. Only when an object strays near, and reflect light into another LDR, does the throwie get triggered at all.9. A throwie triggered by vibration.10. A throwie that responds to radio waves.

Topic by akimbo m 11 years ago  |  last reply 11 years ago


Growduino Help?

Hello Everyone, I built a growduino for my dwarf citrus tree. I have an serial LCD display, a pushbutton switch to turn the screen on and off. I also have a couple of relays and LED's. I wanted to see if someone would take a look at my code, and help me figure out why the screen doesn't display my float variables? I've been banging my head against the wall trying to figure it out. Any help is appreciated. Some of the math formulas I have below were customily made to display the format in degree's F, and a moisture value of 0-10. Feel free to ask questions. I will upload a few photos of it later today. Also if it is easier, I can send you my code in .ino format as well. Thank you for your help in advance. Chris #include #include const int TxPin = 2;          //the lcd const int pushButton = 5;     // the number of the pushbutton pin const int redLed =  13; const int blueLed =  12; int val = 0;                    // variable for reading the pin status SoftwareSerial mySerial = SoftwareSerial(255, TxPin);  //initialize LCD and bring in library //Analog Input int moistureSensor1 = 0; int moistureSensor2 = 1;                                                                                     int moistureSensor3 = 2; int moistureSensor4 = 3; int tempSensor = 5; //Digital Input... int waterPump = 8; int heater = 7; //Initialize int variable to store values int moisture_value1; int moisture_value2; int moisture_value3; int moisture_value4; int temp_val; int buttonState = 0;  void setup() { //Open serial port   mySerial.begin(9600);      //intialize LCD     pinMode(TxPin, OUTPUT);     digitalWrite(TxPin, HIGH);         //initialize button depress       pinMode(pushButton, INPUT);     // declare pushButton as input         //initialize and start it turned off..     pinMode (blueLed, OUTPUT);                                                                   pinMode (waterPump, OUTPUT);     pinMode (heater, OUTPUT);     pinMode (redLed, OUTPUT);                                                                                                                      //Not sure if I needed to make these inputs, since I want a reading from them? pinMode(moistureSensor1, INPUT); pinMode(moistureSensor2, INPUT); pinMode(moistureSensor3, INPUT); pinMode(moistureSensor4, INPUT); pinMode(tempSensor, INPUT);        digitalWrite (blueLed, LOW);     digitalWrite (waterPump, LOW);     digitalWrite (heater, LOW);     digitalWrite (redLed, LOW); } void loop() { for(int n=0; n < 3; n++);   {                   // nested loop.. checks for 3 days for(int i=0; i<= 86400; i++);{                 //checks for 1 day. 86400 is how many seconds in a day   delay(1000);       buttonState = digitalRead(pushButton);        // read the state of the pushbutton value:   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState == HIGH) {                                                                           //tells it to do something when pushed moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else? moisture_value3 = analogRead(moistureSensor3); moisture_value4 = analogRead(moistureSensor4); temp_val = analogRead(tempSensor);  //read temp..   mySerial.write(17);                 // Turn backlight on   mySerial.write(12);                 // Clear   mySerial.print("Sensor 1 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value1);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 2 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value2);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 3 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value3);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 4 is:    ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value4);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   mySerial.print("Moisture average: ");   mySerial.write(13);                 // Form feed   mySerial.print(true_moisture);   // Second line                                                                mySerial.write(12);                 // Clear   delay(3000);                           // Required delay  temp_val = analogRead(tempSensor); // read the value from the thermistor                                          temp_val /= 6.64; mySerial.print("Current Temp in F:"); mySerial.write(13); mySerial.print(temp_val); mySerial.write(12); mySerial.write(18);                 // turn off backlight mySerial.write(21);                 // turn off display    delay(3000);     }   else {     temp_val = analogRead(tempSensor);  //read temp..                                                                                //not sure if I needed another temp value? but wanted to be safe..     temp_val /= 6.64;        while (temp_val < 75.0){                                                                                                       //initialize tempSensor again?     temp_val = analogRead(tempSensor);  //read temp..                                                                                //not sure if I needed another temp value? but wanted to be safe..     temp_val /= 6.64;         digitalWrite (heater, HIGH);     digitalWrite (redLed, HIGH);          mySerial.write(12);                 // Clear                    mySerial.write(17);                 // Turn backlight on        delay(5);                           // Required delay       mySerial.print("Heating Plant");  // First line       mySerial.write(220);                           //play at tone   for(int f; f<600; f++);{                                                                                                              //delay 10min while heating .. check for pushButton     delay(1000); buttonState = digitalRead(pushButton);        // read the state of the pushbutton value:   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState == HIGH) {                                                                           //tells it to do something when pushed moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else? moisture_value3 = analogRead(moistureSensor3); moisture_value4 = analogRead(moistureSensor4); temp_val = analogRead(tempSensor);  //read temp..   mySerial.write(12);                 // Clear   mySerial.print("Sensor 1 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value1);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 2 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value2);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 3 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value3);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 4 is:    ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value4);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay                                                                                                                                         float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   mySerial.print("Moisture average: ");   mySerial.write(13);                 // Form feed   mySerial.print(true_moisture);   // Second line                                                                mySerial.write(12);                 // Clear   delay(3000);                           // Required delay  temp_val = analogRead(tempSensor); // read the value from the thermistor                                          temp_val /= 6.64; mySerial.print("Current Temp in F:"); mySerial.write(13); mySerial.print(temp_val); mySerial.write(12); mySerial.write(18);                 // turn off backlight mySerial.write(21);                 // turn off display                                                                                   delay(3000);     digitalWrite (heater, LOW);     digitalWrite (redLed, LOW);            mySerial.write(18);                 // turn off backlight        mySerial.write(21);                 // turn off display                     }          }       }     }    } }   //3 days go by.. Now the plant needs water..     moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes     moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else?     moisture_value3 = analogRead(moistureSensor3);     moisture_value4 = analogRead(moistureSensor4); float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   int w = 0;    while (true_moisture < 5.0 && w < 4);{                //stop after watering 4 times..     w++;     digitalWrite(waterPump, HIGH);     digitalWrite(blueLed, HIGH);        mySerial.write(12);                 // Clear                    mySerial.write(17);                 // Turn backlight on        delay(5);                           // Required delay       mySerial.print("Watering Plant");  // First line       mySerial.write(220);                           //play at tone       delay(8000);                          //tested.. waterpump pumps 1 cup of water per 8 seconds       digitalWrite(waterPump, LOW);  //turns off pump       digitalWrite(blueLed, LOW); // LED off           for(int k=0; k<180; k++);{                                                                                                                      //wait 3 minutes         delay(1000);                  buttonState = digitalRead(pushButton);        // read the state of the pushbutton value:   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState == HIGH) {                                                                           //tells it to do something when pushed moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else? moisture_value3 = analogRead(moistureSensor3); moisture_value4 = analogRead(moistureSensor4); temp_val = analogRead(tempSensor);  //read temp..   mySerial.write(12);                 // Clear   mySerial.print("Sensor 1 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value1);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 2 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value2);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 3 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value3);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 4 is:    ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value4);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay                                                                                                                                           float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   mySerial.print("Moisture average: ");   mySerial.write(13);                 // Form feed   mySerial.print(true_moisture);   // Second line                                                                mySerial.write(12);                 // Clear   delay(3000);                           // Required delay  temp_val = analogRead(tempSensor); // read the value from the thermistor                                          temp_val /= 6.64; mySerial.print("Current Temp in F:"); mySerial.write(13); mySerial.print(temp_val); mySerial.write(12); mySerial.write(18);                 // turn off backlight mySerial.write(21);                 // turn off display                                                                                   delay(3000); }       }           moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes     moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else?     moisture_value3 = analogRead(moistureSensor3);     moisture_value4 = analogRead(moistureSensor4); float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;          mySerial.write(12);                 // Clear                    mySerial.write(17);                 // Turn backlight on        delay(5);                           // Required delay        mySerial.print("Finished Watering");  // First line        mySerial.write(12);                 // Clear               mySerial.write(220);                           //play at tone              mySerial.write(220);                           //play at tone        mySerial.write(18);                 // turn off backlight        mySerial.write(21);                 // turn off display                                 } }

Question by cburns02135 6 years ago  |  last reply 4 years ago


how to save float value EEPROM

Hi This is Eabul. i want to save data to eeprom from press button . when TemperatureUp button press. increase float data like as 0.01> 0.02--------30.10> 30.61 and this value save to eeprom. and when TemperatureDown button press . decrease float data like as 30.60>30.59-----29.10 and update minus value eeprom and increase and decrease valud view lcd display . but when press button save int number not float. and show me lcd display int value. please help how to write and read float value from eeprom. press button. hear my code. //For Display #include // 3wire display LiquidCrystal595 lcd(4, 3, 2); // DS, ST_CP, SH_CP //For time #include #include RTC_DS1307 RTC; //for humidity #include "DHT.h" DHT dht; //for stor tempereratur and humidity #include int SetHumidity; int HumidityUp = 10; // switch up is at pin 10 int HumidityDown = 11; // switch down is at pin 11 float fix = 0.01; float settemp; // make a variable called temp float TemperatureUp = 12; // switch up is at pin 12 float TemperatureDown = 13; // switch down is at pin 13 //result view int led = 0; // led is at pin 0 void setup() { //For timer Wire.begin(); RTC.begin(); //For welcome screen lcd.begin(16,4); lcd.setCursor(0,0); lcd.print("Welcome Elab"); delay(2000); lcd.clear(); //for dht-11 pin setup dht.setup(A1); // data pin 2 } void loop() { //For tempererature up / down float temp[3]; getTemp(temp); float tempererature = temp[1]; settemp = EEPROM.read(1); // read the settemp on the eeprom if(digitalRead(TemperatureUp) == 1 ) { settemp+=fix; settemp++; EEPROM.write (1, settemp); /* write the most recent settemp in eeprom data stoage*/ } else {} if(digitalRead (TemperatureDown) == 1) { settemp -= fix; settemp--; EEPROM.write (1, settemp); /* write the most recent settemp in eeprom data stoage*/ } if (tempererature >= settemp) { digitalWrite (led, 1); } else { digitalWrite (led, 0);} //else { }; lcd.setCursor(0,0); lcd.print("T:"); lcd.print(tempererature); lcd.setCursor(8,0); lcd.print ("ST"); lcd.print (settemp); lcd.print((char)223); //End tempererature controll //For humidity up / down SetHumidity = EEPROM.read(2); int humidity = dht.getHumidity(); if(digitalRead(HumidityUp ) == 0 ) {SetHumidity++ ; } // add one to the settemp else {} if(digitalRead (HumidityDown) == 0) { SetHumidity--; } // Reduse settemp else { }; lcd.setCursor (0, 1); lcd.print ("CH:"); lcd.print (humidity); lcd.print ("%"); lcd.setCursor (8, 1); lcd.print ("SH:"); lcd.print (SetHumidity); lcd.print ("%"); delay (1); // wait 100 milliseconds EEPROM.write (2, SetHumidity); /* write the most recent settemp in eeprom data stoage*/ //End tempererature controll controll } //analog temperature void getTemp(float * t) { const int analogPin = 0; // replace 0 with analog pin const float invBeta = 1.00 / 3380.00; // replace "Beta" with beta of thermistor const float adcMax = 1023.00; const float invT0 = 1.00 / 298.15; // room temp in Kelvin int adcVal, i, numSamples = 5; float K, C, F; adcVal = 0; for (i = 0; i < numSamples; i++) { adcVal = adcVal + analogRead(analogPin); delay(100); } adcVal = adcVal/5; K = 1.00 / (invT0 + invBeta*(log ( adcMax / (float) adcVal - 1.00))); C = K - 273.15; // convert to Celsius F = ((9.0*C)/5.00) + 32.00; // convert to Fahrenheit t[0] = K; t[1] = C; t[2] = F; return; }

Topic by esumon 1 year ago  |  last reply 1 year ago