IOT BeeHive - Beehappy Project
Introduction: IOT BeeHive - Beehappy Project
For many beekeeper, distance between their home and their beehive is way too big. To make sure the beehive is working properly they have to physically see. With this project, beekeeper can now look on a website and see honey quantity and many other information. For example, you can also add an anti-theft mechanism and lot more.
Pour les francais, le compte rendu du projet est egalement en ligne a l'adresse suivante : https://docs.google.com/document/d/1c5zfOx-Dk0f9ZKs6T7R2ZxKnkmTd7tI0CWUsfRBZTYQ/edit?usp=sharing
Supplies
All SMD component :
* Atmega3208 or Atmega808 (The code use 92 % of the 808 Versions + you can only Tar 2 channel if using 808)
* ADS1241E (24 bits CAN with 4 channel multiplexed)
* Rak3172 (LoraWan emitter / receiver module)
* Ams1117 3.3V ( LDO 5V to 3.3V)
* K7803m-1000r3 ( Buck converter up to 20V to 5V)
* Some resistors 0605
* Some capacitor 0605
Through Hole component :
* 32.768 Khz crystal
* 2.459Mhz crystal
* Jack power plug
* Some Male and female pin header
* A transistor to power off the weight scale
Other component :
* Weight sensor
Step 1: Power Supply
In order to power the board , we used a small buck converter called k7805m-1000r3. This buck converter can go up to 1A. It can step down from more than 12V to 5V.
All components work by using a 3.3V power supply, so we have to convert a 5V to 3.3V.
We could use an other buck, but a buck as too many variation ! As we want to power a 24bits ADC, a small variation can make the system less accurate.
Obviously , we choose to use a LDO that can convert a 5V to 3.3V .
In order to stabilize the power supply, we also added some decoupling capacitor next to this components.
﻿
Step 2: ADS1241
This part is only for understanding purpose. You can skip if you only want to build the system.
The Ads1241 is used to amplified analog signal, then convert it into digital values by using his 24bits ADC, then it can send this data using SPI bus. It have up to 4 differential input for the 1421 version and 2 differential input for the 1420 version.
This is probably the hardest part because this component isn't easy to understand. To begin, we tried to send a simple command to the ads1241 using an Arduino . Then we tried to read a register by sending him the command Read Data = 0x10 followed by the register value. For example, we send the command readReg followed by 0x0A. The reply should be 59 or 89 in decimal.
If the previous step is working, you can now send the ReadData command. By default it should send the difference between pins Ain0 and Ain1. 33
You can change the input by modifying the MUX register value. It can be done by sending the command WREG = 0x50 followed by the input selection.
Step 3: SPI
The SPI protocol is made to control many peripheral using only 3 common wires and 1 wire for each peripheral . A peripheral is called a slave, and the controller is called master. There is two wire used to send and receive data (MISO and MOSI). One means Master Output Slave Input and the other means Master Input Slave Output. Then, an other wire is used to generate a clock signal. This wire is named SCLK and only control by the master. Last but not least, we have to select which slave are we speaking to. To do it there is an other wire named SS or Chip Select . Just send a low signal on this wire to select the slave.
In this system, when we send a command to the ADC, the clock is active. But, when the ADC is trying to reply the clock isn't active. We have to send fake data to receive data.
An other problem can occur when the distance between the master and the slave is too long or when the bus is working on mid frequency(1Mhz). To prevent this problem, you can add a 22ohm resistor on the line. You can also add a capacitor between the data line and GND. 152