Category Archives: Arduino

ESP32 DEVKIT V1

#76 ESP32 that is Arduino & MicroPython Compatible

ESP-WROOM-32 32-bit 240 MHz microprocessor

The ESP32 has already integrated an antenna and RF balun, power amplifier, low-noise amplifiers, filters, and power management module. The entire solution takes up the least amount of printed circuit board area. This board is used with 2.4 GHz dual-mode Wi-Fi and Bluetooth chips by TSMC 40nm low power technology, power and RF properties best, which is safe, reliable, and scale-able to a variety of applications.

DIY ATTINY85 ALARM

#62 SIMPLE DIY ATTINY85 ALARM

Working prototype PCB .

Upon experiencing a few break-ins on the farm I decided to look for a simple alarm system to monitor certain door. For such a simple project a full on alarm commercial alarm system would be overkill.. So I endeavored on the short and fruitful DIY journey.

My system is based on the simple circuit from Great Scott on YouTube. The brains of the circuit is the Arduino programmable Attiny85 MCU. A reset push button, notification LED, arm/disarm toggle switch, notification buzzer and magnetic read switch are the IN/OUT components used.

The project runs on 12 volts (12 volts for the siren) which is filtered down to 5 volts for the Attiny85. My plan is to use a 12 volts 7 ampere lead acid battery combined with a smart charge board to power the project effectively.

After soldering the components onto the board everything worked fine. However the siren was very soft and the 2N2222A transistor was getting extremely hot. This is because the transistor has to provide a ton of current to the siren in order to get it working at 100% capacity. A quick fix is to remove the 1k resistor between Attiny85 pin 1 and the transistors base.(replace it with normal wire) This allows the siren to be louder but the transistor is still hot. A possible permanent solution will be to just use a 5v relay or look for a transistor with a higher current tolerance.

In the end I decided to go with a 5v relay module since it’s a quick reliable solution but is more expensive than a transistor. In a future upgrade I will most likely use a BC517 darlington as referenced by this article. It will be cheaper than a relay and provides more than enough current for a 15W 1 tone siren (380ma).

DATASHEETS

INCREASE ANALOG SENSORS

#58 ANALOG MUX/DEMUX MC14051B

In some cases you will have a MCU with only one analog pin (A0). For example in my case I have the Wemose D1 mini with only one analog pin (A0) however I would like to increase these pins with the MC14051B Analog Multiplexer/Demultiplexer. This is a cheap easy fix but the downside is that it requires an additional chip (the MC14051B ).

MC14051B pin out.

The MC14051B analog multiplexer is a digitally–controlled analog switch. The MC14051B effectively implements an SP8T solid state switch, the device feature low ON impedance and very low OFF leakage current. Control of analog signals up to the complete supply voltage range can be achieved.

I created a small breakout board to make testing and experimenting a little easier.

Template outline.
Effective soldering and trace separation.
Finished product.

More information about increasing analog pins can be found here.

WEMOS D1 MINI

#57 WEMOS D1 MINI WIFI DEV BOARD

Wemos D1 mini

The Wemos D1 mini is a small WiFi based development board. The board is based off of the ESP-8266EX MCU developed by Espressif . The dimensions are 34.2*25.6 mm which allows this small package to be used effortlessly in large scale applications. Shields are also widely available and add to the ease of use for this board.

Features

  • 11 digital IO, interrupt/pwm/I2C/one-wire supported(except D0)
  • 1 analog input(3.2V max input)
  • a Micro USB connection
  • Compatible with MicroPython, Arduino, nodemcu

Technical specs

  • Operating Voltage 3.3V
  • Digital I/O Pins 11
  • Analog Input Pins 1(3.2V Max)
  • Clock Speed 80/160MHz
  • Flash 4M Bytes
  • Size 34.2*25.6mm
  • Weight 3g

My specific board comes from a company called Farylink. It looks like they make small boards with wifi capabilitys.

According to there website:

Shenzhen Huayulian technology co., LTD is an IOT company that integrates rd, production and sales and is technology-oriented and service-oriented. With a rich background in the IOT industry, it focuses on the research, development and production of IOT communications.

[datasheet]
Size fingers for scale.
Looks like someone rubbed of the programming IC’s serial markings. Or perhaps it was manufactured without any markings? Either way the fact remains its 100% a Chinese copy.

The link to the CH340 driver (which is required to program the Wemos D1 mini over USB) can be found here.

DIY VOLTAGE DIVIDER

#56 DIY VOLTAGE DIVIDER

In order to measure the voltage of a DC battery we will need a voltage divider sensor. I built an easy DIY voltage divider which works quite well. All we need are two resistors to measure the voltage in a certain way so our Arduino doesn’t fry.

After working out my requirements for a 12v 7Ah battery I came to the conclusion that I needed a 30k and a 7.5k resistor. This will allow me to measure DC voltage from 0.025v to 25v.

I built 2 sensors
Top of the board

I only had to break the connection on the trace where the screw terminal was soldered to.

After creating a simple Arduino sketch I was able to output the data to the serial monitor. I had to add the correction factor of -0.150 to get an accurate reading after checking with two multimeters.

voltage read sketch
Serial monitor display

I used the Arduino pro mini as the MCU of this project.

MADUINO ZERO SIM808

#48 MADUINO ZERO SIM808 GPS TRACKER

The Maduino Zero SIM808 GPS Tracker is an IOT (Internet of things) Solution based on the 32-bit Atmel’s SAMD21 MCU and GPRS/GSM GPS module SIM808. It intergrates a micro Controller ATSAMD21G18, GRRS/GSM module SIM808, which is the upgrade version of SIM900, power management and storage, to make the SIM808 GPS Tracker ready for IOT projects such as smart-home, outdoor monitoring, shared bicycle, etc. The Marduino Zero SIM808 GPS Tracker based on the Arduino, users can program it with Arduino IDE, which is very easy especially for the none-programmers.

This is the V3.4 version, Note that to ensure the module starts up right, a lipo battery is needed to power up the Maduino Zero SIM808 GPS tracker V3.4.

Quick Spec

  • AT Input Voltage: 3.4-4.2V
  • Microcontroller: ATSAMD21G18, 32-Bit ARM Cortex M0+
  • Clock Speed: 48 MHz
  • Micro SIM connector
  • Integrated Power Control System
  • AT command interface with “auto baud” detection Quad-band: 850/900/1800/1900Mz
  • Send and receive GPRS data (TCP/IP, HTTP, etc.)
  • GPS L1 C/A code
  • 22 tracking /66 acquisition channels
  • Tracking: -165 dBm
  • Cold starts: -148 dBm
  • Time-To-First-Fix:Cold starts-32s (typ.), Hot starts-1s (typ.),Warm starts-5s (typ.)
  • Accuracy: approx. 2.5 meters
  • Interface: I2C/SPI/UART/18*GPIO
  • Arduino compatible
  • Working Temperature: -40 – 85℃
  • Size: 40 x 55mm
  • Net Weight: 23g

ARM DEV BOARD STM32 MCU

#43 STM32 MCU ( BLUE PILL )

The STM32 F103C8T6  (AKA BLUE PILL) Is a great development board to upgrade to from the Arduino series. The STM32 platform is a massive powerhouse that can handle complex calculations extremely quickly. Examples such as quadcopter’s, robotics etc.

FEATURES

  • On-board Mini USB interface, you can give the board power supply and USB communication.
  • On-board test indicator LED
  • On-board reset button and power indicator LED
  • On-board 100ma 3.3V Regulator
  • All GPIO are led out and the names of the pins are marked
  • After soldering the headers, you can directly plug the board onto the breadboard

TECHNICAL SPECIFICATIONS

  • CPU Part Number: STM32F103C8T6
  • Core: ARM 32 Cortex-M3 CPU.
  • Debug mode: SWD (can be programmed with ST-LINK V2)
  • CPU Internal Maximum Clock : 72MHz
  • External Clock Source: 8MHz crystal
  • 64K flash memory, 20K SRAM
  • 2.0-3.6V power, I/O
  • Reset(POR/PDR)
  • Size:5.3cm x 2.2cm

Useful links can be found here

PRO MINI FARM ALARM V1.0

#42 PRO MINI FARM ALARM V1.0 BREADBOARD

The Pro Mini V1.0 testing for the Farm Alarm

The Pro Mini has proven to be a suitable solution. The board is very small and has more than enough specs to control the GSM/GPRS module while also sending data to a remote server via TCP.

The Pro Mini requires an FTDI programmer since there is no USB port on the board.

FTDI programmers pin out relative to the Pro Mini
Pro Mini ( ATMEL MEGA328P MU1039 )

FAILED ATTINY85 EXAMPLE

#41 A FAILED ATTINY85 EXAMPLE (GSM/GPRS)

A quick solder up to test the circuit (had issues with power sharing between GSM module and ATTINY85)

My first attempt to build a small circuit which controls a relay to an alarm speaker was a failure. Contrary to popular belief failure in electronics projects is quite common and I would argue that it is of paramount need if you want to learn anything.

Surprisingly my failure was in using the ATTINY85 instead a Pro Mini, Uno or Mega. Some problems I had were:

  • Not enough RAM to hold all my variables (I had to scrounge 😢)
  • Very limited FLASH memory.
  • GSM module interferes with the ATTINY’s 5v power source when connected using the same source with no filtering.

In a later project I created a reliably working solution with the Pro Mini as the brains.

My goal was to create a small circuit which uses the ATTINY85 as the brains. It uses the A6-GSM-Module to receive SMS’s, phone calls and sends TCP data. Finally it has a 5v relay which will switch on/off an alarm speaker. The theory is that when I’m on the farm in the fields and not near the house, I have the option of remotely starting an audio alarm at will. This should be a deterrent to potential criminals.

I made an easier to debug testing circuit with exposed copper traces (Same issues)

After making an easier to debug circuit I tried to get the ATTINY85 to work happily with the GSM module. This was going to be a bit complicated and I suspect I would have to isolate power between the ATTINY85 and the GSM module. This would require more components and the board is already looking cramped. A much easier solution is to use the Pro Mini instead of the ATTINY85.

The Pro Mini is most certainly a beauty.

DIGISPARK REV3 ATTINY85

#39 DIGISPARK REV3 ATTINY85 DEV BOARD

The Digispark rev3 USB board is an ATtiny85 based microcontroller development board. It comes with a USB interface. Coding is similar to Arduino, and it makes use of the familiar Arduino IDE for development.

BOARD SPECS

  • Support Arduino IDE 1.0+ (OSX/Win/Linux)
  • Can be powered by USB or 5v or 7-15v (automatic matching) extra power supply
  • There is a 500ma 5V regulator on the motherboard.
  • USB embedding (serial debugging)
  • 6 I/O Pins (2 for USB support)
  • 8k Flash Memory (about 6k after bootloader)
  • I2C and SPI (vis USI)
  • PWM on 3 pins (more possible with Software PWM)
  • ADC on 4 pins
  • Power LED and Test/Status LED (in Pin0)

The smallest USB Arduino

PDF Manual