The electronics for the Marsarium took a fair amount of debugging, and I had to phone a friend (Kurt Schoenhoff) to help figure out the last few quirks. Maintaining a reliable and consistent connection to all the I2C components was difficult. Under certain conditions, the BME280 pressure sensor would drop out and it would be difficult for the Intel Edison to reconnect.

It turns out, several of the other components were inducing a bit of voltage ‘noise’. Using the DC motor and large solenoid valves was enough to make the 3.3 volts needed by the pressure sensor to wobble low enough that it would reset. Kurt suggested:

“I would try a bypass capacitor and see if that smooths out the noise”

Bypass or ‘decoupling’ capacitors act like small rechargeable batteries. They pull a little current and ‘charge’ when the voltage to a component is good, when the voltage drops the capacitor kicks in and ‘tops up’ the supplied voltage. This all happens in fractions of a second and this kind of voltage wobble (or noise) is measured in hertz, the higher the frequency of the noise, the smaller the bypass capacitor. That makes sense, I don’t need to store as much charge if I know the blackouts are going to be frequent, but short, so I only need a small capacitor.

Photo of a bypass capacitor soldered to a BME280 pressure sensor.

Small ceramic capacitors are commonly used, and placed as close as you can to the integrated circuit, preferably with an equal distance between the ground and positive supply. If you are able to identify something as a source of noise (like a DC motor), you can also use a bypass capacitor to smooth out the noise before it has a chance to cause problems elsewhere.

Circuit diagram of multiple bypass capacitors in parallel

The most common bypass capacitors seem to be around 0.1uF, but sometimes different sized bypass capacitors are wired in parallel to smooth out a variety of noise signatures. If you have measured the noise in your circuit with an oscilloscope, you can use an online calculator or calculate by hand the optimal value for your bypass capacitor.



You can join the conversation on Twitter or Instagram

Become a Patreon to get early and behind-the-scenes access along with email notifications for each new post.