Jump to content
Electronics-Lab.com Community

connecting a sensor to a switch and LCD display


Recommended Posts

I need help. I just bought a co2 sensor oem module and a lcd digital display module. now i need to make a swith that will turn on a co2 emmitter when c02 sensor reaches a certain level. I need to maintain a certain c02 level in this area. I also need to connect the display to the co2 module to get the c02 numeric read out. Can anybody HELPPPPPPP ! I also need to make a cycle timer for a water pump. 1 minute on and 5 minutes off for a continued 24 hours.
I have data sheets on the modules I bought which I can e-mail.

Link to comment
Share on other sites


The part you are missing is a microcontroller. The CO2 sensor has two types of serial communication available, either of which can be used by just about any uC. The LCD module (you didn't say it was just a DVM) will need to have te information spoon-fed. You will probably want to have a real-time-clock with it's own battery backup. Possibly an external EEPROM to keep any changes in schedule intact. Of course a keypad, maybe five buttons. External I/O for the CO2 valve, water pump, lamp. Assuming none of these items can share a line with anything else, that'll be 21 I/O pins needed.

One of the mid-range microcontrollers from Microchip in a 28 pin package has 22 I/O lines. If space is not a concern, a 40 pin chip will give you pins to spare. Microchip also has serial EEPROMs. Depending on your location, you may be able to request free samples from them. Be prepared to tackle a few programming projects before the greenhouse controller though, you'll need to be familiar with the hardware.

Maxim has a few real-time-clock chips. They offer engineering samples too. Be very careful that you pick one with a DIP package and a communications protocol that you want. Some of these have some extra memory on them, so they could be the external EEPROM as well to save on the parts count.

For the external controls, you'll almost certainly want to use optically isolated TRIACs to control more powerful TRIACs or relays. Fairchild has MOC301xM and '302x' (3010, 3011, 3012, 3020, 3021,3022, 3023). I haven't received any samples from them, but the devices aren't too spendy.

Once the unit is hooked up, the code can be written and modified without picking up the soldering iron again- this is a definite advantage. Oh yes, a google search for a "JDM type programmer" will give a schematic if you feel like building it- or a trip to Ebay will find one for $15 or less (shipping may even be part of that). The software for writing the uC programs and sending it the chip are available for free. I use MPlab for development, but ICprog for actual programming. Note: if you want to use basic or C, I don't know who offers free compilers- I use assembly.

Link to comment
Share on other sites

Ldanielrosa>>>>
You have given me enough information to keep me busy for a few days... Thank you. It is far more information that I hoped I would ever get. I will track downeverything you mentioned. Should everything I get have UART or SPI Communication Protocol ? how do I know what DIP package to get.?
The basic is Plastic , right ? I found a real-time clock (isl12081b8) and the 40 pin chip from microchip (pic16c74) How many fairchild moc301xm will i need ?
MPlab and ICprog free ? The only code i've ever written is some HTML i copied do you think I'll be able to.? you mention that I could find somthing on EBAY for under $15 dollars, what was that ? thanks
KURT

Link to comment
Share on other sites

The fewer communication protocols you have to deal with, the less code you will need to write. I would choose I2C because it allows several different devices to share the same communication bus- the first byte transmitted is an address header. The CO2 sensor does not have this, so it will have it's own dedicated pins and won't have to share.

I recommended getting DIP because it is the largest. The pin spacing will be easier to work with than surface mount. It will work with solderless breadboard for experimenting, and common protoboard types for construction- no need to make a PCB. Plastic is cheapest, and the only material likely to be available in samples.

The clock chip "ISL1208IB8" from Intersil is a surface mount package. Maxim has some in DIP.

As for the microcontroller, don't get anything with a "C" in the middle of the name. Be sure there is the letter "F" after the first two digits. The "16x74" is good, but why not ask for the best available. The '777 has twice the program space, six more analog inputs and master I2C built in. The '877 also has twice the program space, the same number of analog inputs- but ten bits of resolution, master I2C, and has 256 bytes of EEPROM (non-volatile). If available to you, Microchip will allow three of any device and up to five devices per sample request.

The optoisolators need not come from Farichild specifically, they're common enough that lots of companies make them. You'll need one for every device you want to control power to (fan, light, CO2 valve, heater, window flaps, water pump, stereo). You'll want to be sure the output can handle more than double the voltage that powers the devices- look for 400V ratings. The current will only be good to 100mA or so, don't worry- these will be controlling beefier TRIACs (which you'll have to select as well). Another option is to get SSRs (solid state relays), which will be more spendy but take care of some issues.

MPlab is available at http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=64 . It will let you run simulations of your programs and debug your code among other things.

ICprog is available at http://www.ic-prog.com/index1.htm , but may be of little use to you if you don't use a programming module it was written for. I looked on Ebay, and the programmer I was talking about isn't there anymore. I guess the guy ran out of them. A google search for "jdm programmer" should get the plans for one. They're simple enough, and don't need to have a PCB. Ugly is okay for these- mine sure is.

Programming ability comes with practice. I figure you'll have to spend some five or ten hours reading the data sheets and looking at other people's code, then you'll have enough to write a program to blink an LED. Once that much is done, you'll start writing more stuff. You'll test it, debug it, pull out some hair. This is a big project and you'll probably take several months to do it because you're starting at ground-zero, you're making the tools you'll need to work with.

Link to comment
Share on other sites

Thanks again, ok I think I have what I need. I down load th eMPlab and ICprog last night and will play with that once I have everything purchanced/ gathered and put together , I think it wit take mee few weeks just to gather everything..... and anther few weeks to figure out what I have....... so unless I have any questions in the meantime ... I leave you alone...... :) But I will definatley need some help or atleast need some questions anwered ..Thanks again....

KURT

Link to comment
Share on other sites

Hello,
I have a few questions for you. I found this on Microchips web-site but I am not sure if it it exactly what I need and their tech. support is threw e-mail so I could not get someone on the phone to answer any of my questions. i have added the links to the data sheet for each of the parts I have found.


Microcontroller from Microchip PN # pic16F59

http://ww1.microchip.com/downloads/en/DeviceDoc/41201B.pdf

Here is another microcontroller from Dallas Semiconductor

http://pdfserv.maxim-ic.com/errata/89C450A2.pdf


Are either of these what I need for my project.?????

I spoke with Tech. Support at Dallas Semiconductor and told him I needed a 40 pin Microcontroller, w/ I2C built in and he said "that wasn't enough information for him".

Real Time Clock PN# ds1307

http://pdfserv.maxim-ic.com/en/ds/DS1307.pdf

Also, I'm having trouble locating a keypad with five buttons and the different keypads I found have different connections 4 pin, 8 pin, and 10 pin does that make any difference ? Any suggestions on a keypad MFG ?

I am going to try to order the optoisolators and the TRAICs tommorrow.


Thanks,
Kurt


The 16F59 is a fairly new product in the 12 bit core family. I would recommend getting the 16F877 for several reasons. Any issues are likely to be known and documented, more people are familiar with them, "projects' are designed around them, and they have features you will want that the '59 lacks (I2C, USART, data EEPROM, analog to digital converter, more memory, more registers). If you qualify for and are requesting samples, you might consider getting the 16LF877, the 'L' indicates they are designed to run on a lower voltage if necessary. There is the '877A as well, this is a silicon revision (basically the same thing, but a few issues got dealt with).

I'm sure that Dallas makes good microcontrollers, but I don't know anybody that uses them. You may have trouble finding people to talk to.

The DS1307 is common enough. You should be able to get some comment from fellow hobbyists on that one. I have two, but I haven't started comunicating with them yet (need to write the routines). Maxim has several varieties of RTC. Look into the features, you may find something you like but remember you'll have to write a communication routine (repetitive use of another's routine is good) and you'll have to mount it (surface mount requires a PCB, just get DIP).

As for the keypad, keep it simple. My next project that uses one will have five buttons (up, down, left, right, commit). They will be independantly wired. That's one of the benefits you'll enjoy with so many extra pins- you won't have to multiplex your buttons.

You needn't be in a hurry to order the optoisolators and TRIACs just yet. Sure you can get familiar with them, but for the most part they'll have to wait for the microcontroller.

I hope you have a solderless breadboard, DMM, DC power supply, fair array of components to play with, soldering iron, the list goes on.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...