Useful 3d printed parts for your Wemos projects

I sometimes like to use little project boxes for my electronic projects, another idea if you have access to a 3d printer is to design a custom box / enclosure for your project. This can take time but again there are a few useful looking examples on the internet. These examples can be downloaded and you can either use your own printer or there are even sites where you can send the files and someone locally can print it out and send you the printed parts

 

Here are some useful projects I was able to find that you may find useful

 

http://www.thingiverse.com/thing:1768820 – Wemos D1 Mini Enclosure

http://www.thingiverse.com/thing:1497889 – WeMos D1 Mini Button Shield Box

http://www.thingiverse.com/thing:1776349 – Wemos D1 Mini Stack Enclosure (Customizable)

http://library.zortrax.com/project/wemos-d1-mini-dht11-shield-case/ – Wemos D1 mini + DHT11 shield case

http://www.thingiverse.com/thing:1786517 – Wemos D1 mini enclosure, case with LED and sensor hole

http://www.thingiverse.com/thing:1715122 – WeMos DHT22 Case

http://www.thingiverse.com/thing:1795365 – MsgTerminal_WeMos_ESP8266_OLED_MQTT

http://www.thingiverse.com/thing:1940647 – Weather station – case for Wemos, SSD1306 and HTU21D

http://www.thingiverse.com/thing:1995963 – Wemos D1 mini box

Wemos and LX1972 light sensor example

The LX1972 is a low cost silicon light sensor with spectral response that closely emulates the human eye. Patented circuitry produces peak spectral response at 520nm, with IR response less than ±5%, of the peak response, above 900nm.

The photo sensor is a PIN diode array with a linear, accurate, and very repeatable current transfer function.

High gain current mirrors on the chip multiply the PIN diode photo-current to a sensitivity level that can be voltage scaled with a standard value external resistor. Output current from this simple to use two-pin device can be used directly or converted to a voltage by placing it in series with a single resistor at either of its two pins.

Dynamic range is determined by the resistors (typically in the range of 10K to 100K) and power supply values. Typically the LX1972 needs only 1.8V of headroom to operate at 1000 Lux illumination.

Internal temperature compensation allows dark current to be kept below 200nA over the full specification temperature range (-40 to +85°), providing high accuracy at low light levels. Usable ambient light conditions range is from 1 to more than 5000 Lux.The LX1972 is optimized for controlling back lighting systems in low cost consumer products such as LCD TV, portable computers, and digital cameras.

lx1972-module

FEATURES:
1. Near Human Eye Spectral Response
2. Very Low IR Sensitivity
3. Highly Accurate & Repeatable Output Current vs. Light
4. Scalable Output Voltage
5. Temperature Stable
6. Integrated High Gain Photo Current Amplifiers
7. No Optical Filters Needed

Code

void setup()
{
  Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
 
void loop()
{
      int val;
      val=analogRead(0);      //connect sensor to Analog 0
      Serial.println(val);//print the value to serial        
      delay(100);
}

 

Links

LX1972 Analog Light Sensor DIY Maker Illumination Sensor Module

Wemos and SHT11 example

The SHT1x digital humidity sensor is a reflow solderable sensor. The SHT1x series consists of a low-cost version with the SHT10 humidity sensor, a standard version with the SHT11 humidity sensor, and a high-end version with the SHT15 humidity sensor. As with every other Sensirion sensor type from the SHTxx humidity sensor family, they are fully calibrated and provide a digital output.

The humidity sensors are seamlessly coupled to a 14-bit-analog-to-digital converter and a serial interface circuit. This results in superior signal quality, a fast response time, and insensitivity to external disturbances (EMC).

One thing to note is that these sensors have been effectively replaced by others in sensirion’s range such as the SHT31 but they are still usable and for the hobbyist

Layout

wemos-and-sht11_bb

Code

You need to install the library from – https://github.com/practicalarduino/SHT1x

This is the built in example

#include <SHT1x.h>
 
// Specify data and clock connections and instantiate SHT1x object
#define dataPin  D4
#define clockPin D3
SHT1x sht1x(dataPin, clockPin);
 
void setup()
{
   Serial.begin(38400); // Open serial connection to report values to host
   Serial.println("Starting up");
}
 
void loop()
{
  float temp_c;
  float temp_f;
  float humidity;
 
  // Read values from the sensor
  temp_c = sht1x.readTemperatureC();
  temp_f = sht1x.readTemperatureF();
  humidity = sht1x.readHumidity();
 
  // Print the values to the serial port
  Serial.print("Temperature: ");
  Serial.print(temp_c, DEC);
  Serial.print("C / ");
  Serial.print(temp_f, DEC);
  Serial.print("F. Humidity: ");
  Serial.print(humidity);
  Serial.println("%");
 
  delay(2000);
}

 

Testing

OPne the serial monitor , all going well you should see something like this

Temperature: 19.8899993896C / 67.8559951782F. Humidity: 52.00%
Temperature: 20.9199981689C / 70.5739974976F. Humidity: 54.80%
Temperature: 24.1899948120C / 76.0639953613F. Humidity: 64.10%
Temperature: 26.0000000000C / 79.0879974365F. Humidity: 67.44%

 

Links
SHT11 Digital Temperature and Humidity Sensor,Single bus output temperature and humidity module

Wemos and PCF8591 example

The PCF8591 is a monolithically integrated, and a separate power supply, low-power, 8-bit CMOS data acquisition devices. The PCF8591 has the four analog inputs, one analog output and a serial I2C bus interface.

PCF8591 three address pins A0, A1 and A2 can be used in hardware address programmed 8 PCF8591 device allows access to the same I2C bus, without the need for additional hardware. On the PCF8591 device input and output of the address, control and data signals are transmitted in serial fashion via the two-wire bidirectional I2C bus.

PCF8591 Features

  • Single power supply
  • PCF8591 operating voltage range of 2.5V-6V
  • Via I2C bus serial input / output
  • PCF8591 by 3 hardware address pins addressing
  • PCF8591 I2C bus speed sampling rate decided
  • 4 analog inputs programmable single-ended or differential input
  • Automatic incremental channel selection
  • PCF8591 analog voltage range from VSS to VDD
  • PCF8591 built-in track-and-hold circuit
  • 8-bit successive approximation A / D converter
  • 1 analog output DAC gain

The easiest way as usual is to purchase a module, I found this interesting one which had integrated devices which can be used to test the analog inputs

pcf8591-module1

Features

  • Module supports external voltage input of the 4-way acquisition (voltage input range of 0-5v)
  • integrated photoresistor
  • integrated thermistor
  • integrated potentiometer
  • Modules power indicator
  • Modules with DA output indicator, when the module DA output interface voltage reaches a certain value, will be lit panel the DA output indicator, the higher the voltage, the more obvious indicator brightness
  • Remove shunts to bypass on board integrated devices

The left connector

  • AOUT chip DA output interface
  • AINO chip analog input interface 0
  • AIN1 chip analog input interface 1
  • AIN2 chip analog input interface 2
  • AIN3 chip analog input interface 3

  The right connector

  • SCL
  • SDA
  • GND
  • VCC – connected to  3.3v-5v

PCF8591 module functions

Control Register Function On board Device
0 channel 0 Read ADC 0 LDR
1 channel 1 Read ADC 1 NTC THERMISTOR
2 channel 2 Read ADC 2 NC
3 channel 3 Read ADC 3 POTENTIOMETER
+64 analog OE DAC output O/P LED

The O/P LED will begin to turn on with the output set to 140 or more with VCC at 3v3.

pcf8591_yl-40_schema

Code

#include "Wire.h"
#define PCF8591 (0x90 >> 1)
byte adcvalue0, adcvalue1, adcvalue2, adcvalue3;
 
void setup()
{
 Wire.begin();
 Serial.begin(9600);
}
 
void loop()
{
 Wire.beginTransmission(PCF8591);
 Wire.write(0x04);
 Wire.endTransmission();
 Wire.requestFrom(PCF8591, 5);
 
 adcvalue0=Wire.read();
 adcvalue0=Wire.read();
 adcvalue1=Wire.read();
 adcvalue2=Wire.read();
 adcvalue3=Wire.read();
 
 Serial.print(adcvalue0);
 Serial.print(" ,");
 Serial.print(adcvalue1); 
 Serial.print(" ,");
 Serial.print(adcvalue2); 
 Serial.print(" ,");
 Serial.print(adcvalue3); 
 Serial.println();
 
 delay(1000);
}

 

Links

1pcs PCF8591 module AD / DA conversion modules analog-to-digital / digital-to-analog conversion