Arduino Nano 33 IOT sine wave genarator

I need to generate a sine wave to be used as input to 8 MQ type gas sensors (D input channels). These will be supplying the heater voltages. Does anyone know how to do this? Can the Arduino Nano 33 IOT be used?

Short answer - yes assuming that the Nano33 has analogue output channel(s) or could have an added D/A converter.

Long answer, what frequency, voltage, and power level is required?

But looking at the data sheet for the sensor -

it says that the heater can use 5v dc!! So why are you asking for ac? Did you read the manual?

jhaine:

Thank you for your answer. Yes, I know that it requires 5V DC. However, a recent trend is to modulate the sensor heater with an AC signal. It helps with the drifting problem. Can I generate a sinusoid using the DAC and pass that same signal to all 8 sensors? That would be ideal. My other worry is having to use 3.3V. I don't think I can use 5V.

Why not use a small transformer to provide a waveform derived from the mains - either power heater direct or use it to modulate your DC signal .

Please could you provide a reference for:

Or explain how it is done? AC excitation helps with drift when you actually detect a varying value from the sensor and rectify it - this means that low frequency drift is filtered out. In this case though trying to do this by modulating the heater current may not work very well because the thermal mass of the heater will reduce the variation, unless the frequency is very low.

The data sheet is also not very satisfactory - it just says "AC 5V +/-0.1V" but gives the heater resistance as 29 +/-3 ohms - why is the voltage so critical? It also doesn't specify the type of measurement, though by saying that dc or ac of the same voltage can be used it implies that the ac is an rms value.

If you really want to use AC I can't see why it has to be sinusoidal - it could just be a square wave. This could be generated using an Arduino PWM output set to 50% duty cycle, driving a suitable output stage. If you want to drive 8 heaters you will need nearly 8 watts so the output stage has to be reasonably beefy. With a 3.3v supply you would need an H-bridge circuit to get 5v across the output.

Below is a reference

M. J. Oates, J. D. González-Teruel, M. C. Ruiz-Abellon, A. Guillamon-Frutos, J. A. Ramos and R. Torres-Sánchez, "Using a Low-Cost Components e-Nose for Basic Detection of Different Foodstuffs," in IEEE Sensors Journal, vol. 22, no. 14, pp. 13872-13881, 15 July15, 2022, doi: 10.1109/JSEN.2022.3181513.

With an external DAC it can be done. The output of the DAC feeds onto the non inverting input of eight Op-Amps. You need a decent voltage supply though. I thought that I could use
the DAC already built into the Nano 33 IOT and save one component, but the voltage is a big issue.

Quoting from the reference:

"[The heaters] were subjected to sinusoidally varying heater voltages ranging
from 1.6 to 5 V cycling over a 128 second period. The sinusoid
was generated in 256 discrete time steps by the Arduino Nano,
which fed a PCF8591 8 bits Digital to Analogue Converter
(DAC). The resulting signal was fed to a L272M Operational
Amplifier (OA) configured in unity gain mode for each sensor
heater. As the nominal impedance of each sensor heater is
32 , the amplifiers were required to provide up to 160 mA
per sensor."

So you need just one sinusoidal signal that varies from 1.6 to 5V over 128 seconds. The nan33IoT has several PWM capable digital outputs so you could use one of those with an RC smoothing circuit to generate a sine wave that varies say from 1v to 3.3v. You would then need a bit of gain to get up to the 5V max but since the device needs a Vin of at least 5V but up to 18v and has an internal regulator you could supply it at say 12V, have one simple op amp with a gain of ~1.5 which then feeds the heaters through an L272M for each heater.

Or just give each driver op amp a gain of 1.5 - needs 2 resistors.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.