I have a design project which is an infant incubator. This design consists of Fujitsu's MCU MB90f387s, a potentiometer (for input temperature), HSM20-G (analog temperature and humidity sensor), 2 bulbs, LCD, FAN and relay. I am using ADC of the MCU for the sensor and potentiometer.
The flow of the system is:
- read the input temperature
- on the bulb or fan until the sensor reads temperature similar to the input temperature.
- off the bulb or fan.
The problem is when the MCU turns the relay on (turning on the fan or bulb), there is a voltage drop in the power supply which makes the sensor and the potentiometer's data(reading) change.
A scenario: Initially, bulb1 off, bulb2 off, fan off
- input = 33C, sensor reading 29C
- bulb1 and bulb2 on, voltage drops .6V, input reading 30C, sensor reading 25C
- sensor reading 27C, bulb1 on, bulb2 off, supply voltage gains .3V, input reading 31C, sensor reading 26C
Explanation: whenever the mcu turn the bulb on, an amount of voltage drops, if the mcu turn on the other bulb, another voltage drop.
Question: What is the solution so that the sensor and the input temperature have consistent reading? i already read this, from arduino forum. Giving another supply (cellphone charger) to the sensor or relay makes the sensor/relay not work.
Please shed me some light about this. thank you.