All Activity
- Today
-
CETECH started following Home Assistance on Raspberry Pi
-
Will guide you to install Home Assistance on Raspberry Pi 4. Things used in this project Hardware components Raspberry Pi 4 Model B × 1 Story To use most smart home devices, you need to download an app, create an account, and link them to an online cloud server. This makes them easy to control, but it also means that your usage data, such as when, where, or how you operate your devices, is stored online and may not be private. If you care about privacy, you can try Home Assistant, a software that lets you manage your smart IoT devices and automate your smart home locally —without any cloud connection or integration. Home Assistant: Home Assistant is a free, open-source, and lightweight home automation software that runs on top of Home Assistant Operating System. Home Assistant OS can be installed and configured on Raspberry Pi 4, which is a low-power and compact device for running Home Assistant. Get PCBs for Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Step 1: Flash Home Assistant OS Download the Home Assistant OS image for your Raspberry Pi 4 64-bit using this hyperlink. https://github.com/home-assistant/operating-system/releases/download/7.3/haos_rpi4-7.3.img.xz Then download, install, and open the Raspberry Pi Imager tool to flash the Home Assistant OS image to an SD card. In the Imager tool first select the downloaded OS image. Click Storage and choose the connected Micro SD card. Click Write and wait for the process to complete. This may take a while. After the Home Assistant OS image is flashed successfully, eject the Micro SD card, and connect it to the Raspberry Pi’s card slot. Step 2: Boot Raspberry Pi To boot Home Assistant, connect the LAN cable to the Ethernet port on Raspberry Pi. Connect the power supply to turn on the Raspberry Pi. Wait for a few minutes as it boots and updates. This can take up to 10-20 minutes. Step 3: Setup Home Assistant To set up and configure Home Assistant, open the web browser, and go to http://homeassistant.local:8123. If that standard URL is down open your router admin page and find the IP address of the raspberry pi. Then type the IP address of your Raspberry Pi in the web browser, such as http://xx.xx.xx.xx:8123. Alternatively, you can use the android application for home assistance. After installing all the updates, the Home Assistant will display the following screen to create an account. Enter your name, username, and password to create your account. Ensure the password you enter is strong. Then click Create Account. Then choose your location using the Detect button, select Unit System, Currency, and click Next. If there are smart devices in your home connected to your network, Home Assistant will automatically display them for integration. You can select them and set them up or do it later. Click Finish. At this stage, the Home Assistant installation and setup is complete. Wrap-Up: Once you have Home Assistant ready, you can create rooms and add your smart home devices to the Home Assistant dashboard. You can also automate your home based on events or activities. Home Assistant offers various add-ons and integrations that you can install to enhance its features and support more smart home devices.
-
- raspberry pi
- raspberri pi 4b
- (and 3 more)
-
Adjustable Low EMI Switching Power Supply
loribennms replied to sam.moshiri's topic in Electronic Projects Design/Ideas
It sounds like you have put a lot of effort into designing and implementing your power supply using the TPS54202 buck converter. Your choice of components, such as input and output filters, along with PCB design techniques, demonstrates your commitment to achieving low noise levels and high performance. Utilizing Altium Designer 23 and Altium-365 for schematic and PCB design collaboration is a smart choice. Octopart's component search engine and generating the Bill of Materials (BOM) streamlined your component selection process. Sending the Gerber files to PCBWay ensures high-quality fabrication. Testing the circuit for output noise and load step response using Siglent oscilloscope and DC load adds credibility to your design's functionality. Overall, your dedication to creating a compact and efficient power supply for electronics applications is commendable. It seems like you have taken all the necessary steps to ensure reliable performance on your electronics bench. - Yesterday
-
Vals rakt joined the community
-
Amar Sakla joined the community
-
Sam Bananas joined the community
-
Syakhisk Adani joined the community
- Last week
-
Patrick Worthen joined the community
-
Mohamed Meliani joined the community
-
sam.moshiri started following Adjustable Low EMI Switching Power Supply
-
A power supply is an essential tool on every electronics bench. The TPS54202 is a highly efficient 2A synchronous buck converter with a wide 28V input voltage range and low EMI figures, making it suitable for various applications. These features make the TPS54202 an excellent choice for building a power supply. To achieve a low noise level and ensure high performance, I implemented a variety of input and output filters, along with following several PCB design techniques. The chip operates at a switching frequency of 500KHz and is equipped with internal loop compensation. Setting up the power supply is simple—just connect the input to a step-down AC transformer (e.g., 220V to 15V) and use a multiturn potentiometer to adjust the output voltage to your desired level. For the schematic and PCB design, I utilized Altium Designer 23 and shared the project with my friends for feedback and updates using Altium-365. The fast component search engine, Octopart, proved invaluable in quickly obtaining component information and generating the Bill of Materials (BOM). To ensure high-quality fabricated boards, I sent the Gerber files to PCBWay. I tested the circuit for output noise and load step response using Siglent SDS2102X Plus oscilloscope and Siglent SDL1020X-E DC load. I am confident that this circuit will meet your requirements for a compact and efficient power supply, providing reliable performance on your electronics bench. References Schematic + PCB + Gerber: https://www.pcbway.com/blog/technology/Adjustable_Low_EMI_Switching_Power_Supply_9611437d.html [1]: TPS54202: https://octopart.com/tps54202ddct-texas+instruments-71538129?r=sp [2]: 470uF-35V: https://octopart.com/eee-fk1v471aq-panasonic-44406255?r=sp [3]: 22uH-3A: https://octopart.com/etqp5m220yfm-panasonic-24904108?r=sp [4]: 5K Potentiometer: https://octopart.com/ss34a-multicomp-18903924?r=sp [5]: SS34: https://octopart.com/ss34a-multicomp-18903924?r=sp
-
normq1 joined the community
-
addoxsheila joined the community
-
dhanakar joined the community
-
the circuit on the right is a darkness sensor while on the left is a motion detector using PIR. I want to combine these two circuits into one. The motion sensor must only function if the LDR detects darkness and it must not function if the LDR doesn't detect any darkness. im making a school project, the circuit at the right is a darkness sensor using LDR and its steps and components are: STEP 1 - Connect 555 timer IC on the breadboard STEP 2 - Connect Pin 8 of 555 Timer to VCC of Battery and Pin 1 of 555 Timer to GND of Battery STEP 3 - Connect pin 4 to VCC and Connect pin 6 of 555 Timer to the pin 7 of 555 Timer STEP 4 - Connect 330-ohm resistor to pin 7 and pin 8 of IC STEP 5 - Connect 4.7uf polarized capacitor to pin 5 of IC and its negative side to the ground STEP 6 - Connect 0.01uf ceramic capacitor to pin 6 of IC and its negative side to the ground STEP 7 - Connect 4.7k ohm resistor on pin 2 of IC and its negative side to the ground STEP 8 - Connect LDR to pin 2 and VCC STEP 9 - Connect 470-ohm resistor to pin 3 of IC and connect its other side to the anode of the LED and its cathode to the ground STEP 10 - Test if the circuit works while the circuit on the left is a motion detector alarm using PIR (HC-SR501) and its steps and components are: STEP 1 - Connect 555 timer IC on the breadboard and a 74HC04 IC STEP 2 - Connect Pin 8 of 555 Timer to VCC of Battery and Pin 1 of 555 Timer to GND of Battery. Also connect pin 14 of 74HC04 IC to VCC and pin 7 of 74HC04 IC to GND. STEP 3 - Connect pin 4 to VCC and Connect pin 6 of 555 Timer to the pin 7 of 555 Timer STEP 4 - Connect 100-kilo ohm resistor to pin 7 of 555 IC and its other side to the VCC STEP 5 - Connect 4.7uf polarized capacitor to pin 7 of 555 IC and its negative side to the ground STEP 6 - Connect 0.01uf ceramic capacitor to pin 5 of 555 IC and its negative side to the ground STEP 7 - Connect a buzzer to pin 3 of 555 IC and its negative side to the ground STEP 8 - Connect the pin 2 of 555 IC to pin 12 of 74HC04 IC STEP 9 - Connect the GND of PIR to the ground, its power pin to the VCC and its Signal/output to the pin 13 of 74HC04 IC STEP 10 - Test if the circuit works do u have any suggestions on how we can merge the two circuit into one according to the said output?
-
wear ostrich changed their profile photo
-
Fahad Administrator changed their profile photo
-
I have designed and manufactured a 48 vdc 25 kW BLDC motor. I prepared the attached driver circuit using Proteus 8.13 The circuit is controlled by Arduino UNO. The low side has 3 HCPL2531 and IR2130PBF The high side has 4 IRF3205 x 2 mosfets (will be upgraded to 6) I am getting "No model specified for Board1-U8" type of errors when I run simulation. I have tried <<Edit Properties..Attach hierarchy model..Goto Child Sheet>> and that led to Power rail errors Is my procedure correct ? Driver_v1.zip
-
strong boy started following How to Make Walkie Talkie Using Arduino
- Earlier
-
Ajay Marco Tilao changed their profile photo
-
Ashish Adhikari reacted to a post in a topic: Transformers PCB BADGE
-
Thanks a lot mate
- 2 replies
-
- transformers
- the rise of the beasts
- (and 4 more)
-
Satyadeo Vyas reacted to a post in a topic: Rechargeable D Cell Batteries And Silver Wire Making Ring
-
Hi Ashish, Nicely explained ... I love reading your article
- 2 replies
-
- transformers
- the rise of the beasts
- (and 4 more)
-
loribennms , thanks sir for your answer . This why I'm Here to discuss such a board. Hi everybody, it seems that I found a better board that is doing exactly what I'm Looking For, please check it here, LM386 Audio Amplifier Module (200 times Audio Amplifier) - RAM Electronics (ram-e-shop.com) and This is the wiring Video, It's also Cheaper. I'd like to know your opinion about it, and in case I'd Like to belt a professional plastic enclosure for it, where to find the right place for designing the enclosure to make a model of parts ready for the injection mold. And If I'd like to run it on AA battery how to calculate the right voltage to run the whole thing, an amplifier board, a mini speaker, and a mic piece.
-
drmina2023 reacted to a post in a topic: Simple Audio sensor board connection to a speaker
-
I hope that you can finish your job successfully. Good luck!
-
DMM6500 table multimeter and Accuracy
Volkath Alex Qanta Mganga replied to joseph20480's topic in Datasheet/Parts requests
I want to help you. But so sorry. I cannot download the pdf. Why did it activate? Haizzzzz -
Newbie needs advice on making continuity LED box.
loribennms replied to Paul R.'s topic in Electronic Projects Design/Ideas
To create a digital display continuity tester, you will need the following components: Microcontroller: Choose a microcontroller board such as Arduino or Raspberry Pi to control the digital display and handle the continuity testing logic. Digital Display: Select a suitable digital display such as a seven-segment display or an LCD display to show the pin numbers or continuity status. Pin Probes: Use probe wires or connectors to connect to the pins of the circular connector for testing continuity. Resistors: Depending on the specifications of your microcontroller and digital display, you may need resistors to limit the current and protect the components. Here's a general outline of the circuit and functionality: Connect the pin probes to the microcontroller's input pins, ensuring proper grounding. Write a program on the microcontroller to control the continuity testing logic. This program should check the input pins' continuity and control the digital display accordingly. Depending on the continuity test results, the microcontroller will send signals to the digital display to show the pin numbers or continuity status. You may need to include debouncing mechanisms in your program to handle any bouncing signals during pin probing. Remember to follow best practices for electrical safety, such as using appropriate insulation for the probes and ensuring the circuit is properly grounded. While this is a general overview, the specific details of the circuit and code will depend on your chosen microcontroller, digital display, and the requirements of your continuity tester. It's recommended to refer to the datasheets and documentation of the components you select and seek additional guidance from online forums or electronics communities for more specific assistance. -
IC and electronic components
HarryA replied to Noomi Jiang's topic in Sell/Buy electronics - Job offer/requests
Huh? Technological Arts ?- 1 reply
-
- chip
- electronic parts
-
(and 1 more)
Tagged with:
-
Noomi Jiang started following IC and electronic components
-
IC and electronic components
Noomi Jiang posted a topic in Sell/Buy electronics - Job offer/requests
a global supplier of electronic components, strong with active&passive components, transistor, diodes, chips, resistors, etc.- 1 reply
-
- chip
- electronic parts
-
(and 1 more)
Tagged with:
-
Because I cannot see the code, I don't find out it. However, I think you may be correct because your pic shows that.
-
Newbie needs advice on making continuity LED box.
HarryA replied to Paul R.'s topic in Electronic Projects Design/Ideas
The Mega 2560 has 54 digital I/O pins plus 16 analog pins for a total of 70. You lose 2 pins for the display for either the PC display or LCD. You can have speech on the PC for free. You may need a larger LCD for numerous pins. Mapping the Mega pin numbers to the cable pin numbers would have to be predetermined. Some connectors use alpha characters (A - Z) I gather. -
Airra Michaela Mapute changed their profile photo
-
High Precision Digital AC Energy Meter Circuit
Barragan replied to sam.moshiri's topic in Electronic Projects Design/Ideas
It's cool that you explained it in so much detail, I'm still new to this and am just learning about it. -
Akshayan Sinha started following Mosquitto MQTT | IoT Platform Series 🚀
-
What is MQTT? MQTT stands for Message-Queue-Telemetry-Transport, is a publish/subscribe protocol for machine-to-machine communication. This simple protocol, is easy to implement for any client. Termed as the Pub and Sub, both are used for same purpose but with different methods. Get PCBs for Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Getting Started Here, there are 2 sections - Publish and Subscribe. And then there is a middleman - Broker. Let us see in depth IoT Devices play the role to collect sensor data and send to the cloud (broker). While PC/Server/Mobile devices play the role to monitor and receive the sensor data to be viewed - Here, IoT Device is a Publisher, and PC Devices are Subscriber. According to the above analogy, the image that is published is the data, that was transferred from user1 to user2 📤. And that is the exact scenario in an MQTT Pub/Sub model. We have a more secure layer 🔒 to make sure the data is shared through a specific path, we call that 'topic', When user1 publishes data on topic, the subscriber automatically receives if already connected to the broker. Hence, the LOW latency. MQTT Broker Whenever there is a pub-sub model used as a message communication protocol, we require a broker that can transfer the information in the required device. This can be done by sending the message under correct topic. Let us understand this - A Broker is a runtime server (continuously running service), which can have 2 types of clients - Publisher (seller) & Subscriber (buyer) For instance, when a seller sells a product through a broker to a buyer, then it is using the Broker's service to reach & find a secured buyer. Similarly, when publisher publishes a piece of information, the data reaches to the subscriber through the Broker. The broker is responsible for having specific storage space where it can expect data from the publisher to store temporarily and then send to the subscriber. In the pub-sub MQTT, clients talk to each other through an MQTT broker. There are many MQTT Brokers in the market. It is even possible to create our own broker, or use an open-source broker 'paho'. For the current project, we shall first understand the mechanism and then watch a trial movement of data on Mosquitto MQTT Broker. Mosquitto Platform Now that we understand how MQTT works, let us use a cloud MQTT service and send data across the internet. In this article, we'll be using Mosquitto MQTT - test.mosquitto.org Under the Server section, we can see different ports provide feature-separated servers. These servers act like channels for sharing data over the cloud. Let us understand it first - MQTT Broker Port (default: 1883): This is the standard port used for MQTT communication. MQTT clients use I to connect to the Mosquitto broker and publish/subscribe to topics. It operates over TCP. MQTT Broker SSL/TLS Port (default: 8883): This is the secure version of the MQTT broker port. It uses SSL/TLS encryption to provide secure communication between MQTT clients and the Mosquitto broker. Clients connect to this port to establish a secure connection. WebSocket Port (default: 9001): Mosquitto also supports MQTT over WebSockets, allowing MQTT clients to connect to the broker using the WebSocket protocol. The WebSocket port is used for WebSocket-based MQTT communication. WebSocket SSL/TLS Port (default: 9443): This is the secure WebSocket port used for encrypted WebSocket-based MQTT communication. It provides a secure connection using SSL/TLS encryption. We shall be using 1883 port to send data and monitor. As we know, MQTT has 3 services - Publisher, Broker, and Subscriber. In this case, mosquito MQTT Cloud is already playing the role of a broker. Now, we'd be using ESP32 Dev Board, which has a wifi chip and is able to connect to the Internet, playing the role of a Publisher for sharing its temperature and humidity data from the sensor. On the other hand, we shall use the PC to view this data as a Subscriber. This will enable us to fully understand the working principle of the MQTT protocol used in IoT Communication between devices. Publisher (ESP32) To set up the ESP32 for MQTT, we need to install a library - PubSubClient. This library has functions that use variables as mentioned below to send data to the broker. mqtt_server: This variable represents the address or IP of the MQTT broker. We shall be using "test.mosquitto.org" mqtt_port: This variable represents the port number of the MQTT broker. In our case 1883. mqtt_topic: This variable represents the topic to which the publisher will send messages. For Example "schoolofiot/device1". Where 'schoolofiot' is the general-most topic level. And 'device1' is a sub-level. The provided code is an Arduino sketch that uses the ESP32 WiFi module and the PubSubClient library to connect to an MQTT broker and publish temperature and humidity data. Let's break down the code step by step: 1. Include necessary libraries: #include <WiFi.h> #include <PubSubClient.h> This code includes the required libraries for the ESP32 WiFi module and the MQTT client functionality. 2. Define WiFi & MQTT Server variables: const char* ssid = "XXXXXXXXXX"; const char* password = "XXXXXXXXXX"; const char* mqtt_server = "test.mosquitto.org"; These variables store the SSID (network name) and password for the WiFi network you want to connect to. The mqtt_server variable holds the IP address or hostname of the MQTT broker. 3. Declare global variables and objects: WiFiClient espClient; PubSubClient client(espClient); long lastMsg = 0; char msg[50]; int value = 0; float temperature = 0; float humidity = 0; Here, a WiFi client object (espClient) and an MQTT client object (client) are declared. The lastMsg variable stores the timestamp of the last message, and the msg is a character array for message storage. The value, temperature, and humidity variables are used to hold the respective sensor values. 4. Setup function: void setup() { Serial.begin(115200); setup_wifi(); client.setServer(mqtt_server, 1883); client.setCallback(callback); } The setup() function is called once at the start of the program. It initializes the serial communication, sets up the WiFi connection, configures the MQTT server and port, and sets the callback function to handle incoming messages. 5. WiFi setup function: void setup_wifi() { //... } The setup_wifi() function handles the connection to the WiFi network using the provided SSID and password. It waits until the connection is established and prints the local IP address to the serial monitor. 6. MQTT callback function: void callback(char* topic, byte* message, unsigned int length) { //... } This function is called when a message is received from the MQTT broker. It prints the received message along with the corresponding topic. 7. MQTT reconnection function: void reconnect() { //... } The reconnect() function is responsible for reconnecting to the MQTT broker if the connection is lost. It attempts to connect to the broker using a randomly generated client ID. If the connection is successful, it prints a success message. Otherwise, it waits for 5 seconds before retrying. 8. Main loop: void loop() { if (!client.connected()) { reconnect(); } client.loop(); long now = millis(); if (now - lastMsg > 2000) { lastMsg = now; sendData(); } } The loop() function is the main program loop that runs continuously after the setup() function. It checks if the MQTT client is connected and, if not, attempts to reconnect. It also calls the client.loop() function to maintain the MQTT client's internal state. Every 2 seconds, it calls the sendData() function to publish temperature and humidity data. 9. Publish sensor data function: void sendData() { //... } The sendData() function is responsible for publishing temperature and humidity data to specific MQTT topics. It generates random values for temperature and humidity, converts them to strings, and publishes them along with the corresponding topic. - Publish a gap message: client.publish("schoolofiot/gap", "--------------"); This line publishes a message consisting of a series of dashes (--------------) to the MQTT topic "schoolofiot/gap". It is used to indicate a separation or gap between different sets of data. - Read and publish temperature data: temperature = random(30, 40); char tempString[8]; dtostrf(temperature, 1, 2, tempString); Serial.print("Temperature: "); Serial.println(tempString); String tempdata = "Temperature: " + String(tempString); client.publish("schoolofiot/temperature", tempdata.c_str()); These lines generate a random temperature value between 30 and 40 degrees, store it in the temperature variable, and usedtostrf() function to convert decimal point data to String. The temperature value is then printed to the serial monitor and concatenated with the string "Temperature: ". The resulting string is stored in the tempdata variable. Finally, the tempdata string is published to the MQTT topic schoolofiot/temperature using the client.publish() function. - Read and publish humidity data: humidity = random(60, 70); char humString[8]; dtostrf(humidity, 1, 2, humString); Serial.print("Humidity: "); Serial.println(humString); String humdata = "Humidity: " + String(humString); client.publish("schoolofiot/humidity", humdata.c_str()); These lines generate a random humidity value between 60 and 70 percent, store it in the humidity variable. Overall, the sendData() function generates random temperature and humidity values, converts them to strings, and publishes them to specific MQTT topics for further processing or monitoring. Final Code can be found in the Code section But to confirm this, we also need to read the data from other the side - Subscriber. Subscriber (Windows PC) To set up the Subscriber on PC, we need to install Mosquitto MQTT Applcation. This application can create a broker, publisher & subscriber - all sections To install Mosquitto MQTT on your PC from the official website and make changes to the configuration file for listener 1883 and allow anonymous connections, you can follow these steps: 1. Download andInstall Mosquitto: Go to the official Mosquitto website (https://mosquitto.org/). Navigate to the "Downloads" section. Choose the appropriate installer for your operating system (Windows x64 in this case) and download it Install the application in desired location. 2. Edit Configuration File: Open the installation directory where Mosquitto is installed. Locate the mosquitto.conf file (usually found in the main directory). Open mosquitto.conf in a text editor of your choice.Add the below 2 lines - listener 1883 allow_anonymous true It should look somewhat like this - We can uncomment ad make changes in the file as well, but adding only 2 lines on the top is more simple and noticeable. 3. Run Mosquitto Subscriber We can run the Mosquitto broker and then subscribe to the topic we desire. But running directly the subscriber is best in our case. Open the folder/directory where the mosquitto.exe along with mosquitto_sub.exe is present. Run the PowerShell/CMD terminal from within the directory. For windows, open the directory > Press shift + right-mouse-button(right-click), and we'd see options for running a terminal like powershell. On the terminal, enter below command - > .\mosquitto_sub -h test.mosquitto.org -t "schoolofiot/#" In the above command, if you noticed, I did not subscribe to a specific topic. As per the topics we published (from ESP32), like "schoolofiot/gap", "schoolofiot/temperature" or "schoolofiot/humidity". The reason is, gap, temperature & humidity comes under the general topic of schoolofiot level. So, to access/view any data published as a sub-level of schoolofiot, we can use '#'. Apart from this, in case we need to subscribe to a specific topic (like temperature), we can use command like this - > .\mosquitto_sub -h test.mosquitto.org -t "schoolofiot/temperature" Therefore, no matter what name is put under the general topic, we can subscribe to it and view all of them together. Hurray! 🎉 We have learned another IoT Platform - Mosquitto MQTT (By Eclipse) Code #include <WiFi.h> #include <PubSubClient.h> // Replace the next variables with your SSID/Password combination const char* ssid = "XXXXXXXXXX"; const char* password = "XXXXXXXXXX"; // Add your MQTT Broker IP address, example: const char* mqtt_server = "test.mosquitto.org"; WiFiClient espClient; PubSubClient client(espClient); long lastMsg = 0; char msg[50]; int value = 0; float temperature = 0; float humidity = 0; void setup() { Serial.begin(115200); // default settings setup_wifi(); client.setServer(mqtt_server, 1883); client.setCallback(callback); } void setup_wifi() { delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } void callback(char* topic, byte* message, unsigned int length) { Serial.print("Message arrived on topic: "); Serial.print(topic); Serial.print(". Message: "); String messageTemp; for (int i = 0; i < length; i++) { Serial.print((char)message[i]); messageTemp += (char)message[i]; } Serial.println(); } void reconnect() { // Loop until we're reconnected while (!client.connected()) { Serial.print("Attempting MQTT connection..."); // Attempt to connect String clientId = "client-" + random(100, 999); if (client.connect(clientId.c_str())) { Serial.println("connected"); } else { Serial.print("failed, rc="); Serial.print(client.state()); Serial.println(" try again in 5 seconds"); // Wait 5 seconds before retrying delay(5000); } } } void loop() { if (!client.connected()) { reconnect(); } client.loop(); long now = millis(); if (now - lastMsg > 2000) { lastMsg = now; Serial.println(client.connected()); sendData(); } } void sendData(){ Serial.println(); client.publish("schoolofiot/gap", "--------------"); //Read Temperature temperature = random(30,40); char tempString[8]; dtostrf(temperature, 1, 2, tempString); Serial.print("Temperature: "); Serial.println(tempString); String tempdata = "Temperature: " + String(tempString); client.publish("schoolofiot/temperature", tempdata.c_str()); //Read Humidity humidity = random(60,70); char humString[8]; dtostrf(humidity, 1, 2, humString); Serial.print("Humidity: "); Serial.println(humString); String humdata = "Humidity: " + String(humString); client.publish("schoolofiot/humidity", humdata.c_str()); }
-
- iot
- iotplatform
-
(and 4 more)
Tagged with:
-
Difference between (EE) and (EEE)
Bilalzaidi replied to Viral Zone's topic in Datasheet/Parts requests
In the electrical engineering branch, EEE, EIE, and ECE are often the top choices. As the name suggests, one opting for ECE has to study electronics and some telecommunication concepts. On the contrary, EEE includes the study of both electronics and electrical engineering. https://www.laptopicker.com/04-best-laptops-with-ethernet-port/ -
Hello . Have a new problem with my motor who have 2 speed ( use in dehumidifier ) Why is there no information on the Internet how to calculate the thickness of a wire and the number of turns and power.
-
Newbie needs advice on making continuity LED box.
Paul R. replied to Paul R.'s topic in Electronic Projects Design/Ideas
How much more would it cost for unit that has 63 or more inputs? -
Newbie needs advice on making continuity LED box.
HarryA replied to Paul R.'s topic in Electronic Projects Design/Ideas
If it interest you, I could program the micro-controller for you. That would give you an introduction to micro-controllers. The micro-controller is about 21$, a LCD about 13$, You would need a 9 volt battery, a battery connector, a battery to micro_controller connector, and a switch also. An assortment of colored wire would be helpful. Plus a plastic or metal box to pack it all into. If you are checking your cables near a computer you could uses the computer as a simple display device instead of the LCD. LCD : https://www.amazon.com/SunFounder-Serial-Module-Arduino-Mega2560/dp/B01GPUMP9C/ref=sr_1_1_sspa?adgrpid=1335907194272933 Micro-controller: https://www.amazon.com/ELEGOO-ATmega2560-ATMEGA16U2-Arduino-Compliant/dp/B01H4ZDYCE/ref=sr_1_2_sspa?crid=1L06F0IP302BX&keywords=Arduino+R3+Mega2560&qid=1684882151 wire: https://www.amazon.com/TUOFENG-Hookup-Wires-6-Different-Colored/dp/B07TX6BX47/ref=sr_1_3?keywords=colored+wire+spool&link_code=qs&qid=1684885902&sourceid=Mozilla-search&sr=8-3 -
Newbie needs advice on making continuity LED box.
Paul R. replied to Paul R.'s topic in Electronic Projects Design/Ideas
Thank you. The display just needs to display "1", "2", etc. My colleague was interested in one that had 63 inputs or more. He also mentioned a Raspberry Pi. Unfortunately, I'm not familiar with either the Arduino or Raspberry Pi units. -
If you're looking to connect a small audio sensor board directly to a speaker without using an Arduino board, you'll need to design a simple analog circuit to amplify and process the audio signal. Here are a few general steps to consider: Study the specifications and documentation of the Sound Detector board you own to understand its input and output requirements. Determine the specifications of the speaker you intend to use, such as its impedance and power handling capabilities. This information will help you design a circuit that matches the speaker's requirements. Research basic audio amplifier circuits that can be used to amplify the signal from the audio sensor board. Look for amplifier designs that fit your project's needs, such as a single-ended amplifier or a class AB amplifier. Choose appropriate components for your analog circuit, including resistors, capacitors, and transistors or operational amplifiers. The specific values and types of components will depend on the amplifier circuit you select. Design the circuit on a breadboard or a PCB (Printed Circuit Board), following the schematic diagram provided by the amplifier circuit design. Take care to ensure proper connections and component placement. Test the circuit using the audio sensor board as the input and the speaker as the output. Make adjustments as necessary to optimize the sound quality and volume levels. Please note that designing and building analog circuits requires a good understanding of electronics and circuit design principles. If you're not familiar with these concepts, it may be beneficial to seek assistance from an experienced electronics hobbyist or consult resources such as electronics forums or books on audio circuit design.
-
A guide to LED Emergency Light Circuit with LDR
bidrohini replied to crystallin's topic in Electronic Projects Design/Ideas
Very simple but useful project. I was just wondering, have you made any PCB of this project? You can make a prototype by yourself or get it printed from: https://www.pcbway.com